You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I've had to deal with both the "don't know how to build test:prepare" and "cannot load such file -- test_helper" errors with various kludges, so I don't know if that's causing ActionDispatch::PerformanceTest not to be initialized.
I added this line to my Rakefile:
task 'test:prepare'
As for the test_helper.rb, I created a new dummy Rails app and copied the test_helper.rb from it:
ENV['RAILS_ENV'] ||= 'test'require_relative'../config/environment'require'rails/test_help'classActiveSupport::TestCase# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.fixtures:all# Add more helper methods to be used by all tests here...end
My test/performance/serializer_test.rb currently is just the boilerplate file from rails generate performance_test serializer.
EDIT: Here's a weird thing I just noticed -- if I require require 'rails/performance_test_help' in a rails console, ActionDispatch::PerformanceTest comes back as a valid constant, so maybe it's worthwhile pasting my benchmark file:
require'test_helper'require'rails/performance_test_help'classSerializerTest < ActionDispatch::PerformanceTest# Refer to the documentation for all available options# self.profile_options = { runs: 5, metrics: [:wall_time, :memory],# output: 'tmp/performance', formats: [:flat] }test"homepage"doget'/'endend
I'm also invoking the test like this: bundle exec rails test:benchmark TEST=test/performance/serializer_test.rb
The text was updated successfully, but these errors were encountered:
Rails 6.1.7.3 / rails-perftest 0.0.7
First of all, I've had to deal with both the "don't know how to build test:prepare" and "cannot load such file -- test_helper" errors with various kludges, so I don't know if that's causing
ActionDispatch::PerformanceTest
not to be initialized.I added this line to my Rakefile:
As for the
test_helper.rb
, I created a new dummy Rails app and copied thetest_helper.rb
from it:My
test/performance/serializer_test.rb
currently is just the boilerplate file fromrails generate performance_test serializer
.EDIT: Here's a weird thing I just noticed -- if I require
require 'rails/performance_test_help'
in a rails console,ActionDispatch::PerformanceTest
comes back as a valid constant, so maybe it's worthwhile pasting my benchmark file:I'm also invoking the test like this:
bundle exec rails test:benchmark TEST=test/performance/serializer_test.rb
The text was updated successfully, but these errors were encountered: