title: rails performance test -run one test
body: <p>I have couple performance tests in my rails app</p>
  <p>which resides in test/performance/some_file.rb
  so file contain couple methods. I need run only one to get good logs</p>
  <p>inside file I have couple test_* methods.</p>
  <p>Is there any way to run only one performance test?
  I'm  execute:</p>
  <pre><code> rake test:benchmark TESTOPTS=&quot;--name=test_with_pet_care_job&quot;
  </code></pre>
  <p>and looks like my test started but it freeze for some reason
  how can I run only one test?</p>
  <p>here is source files:</p>
  <h1>test/performance/registrations/parent_full_test.rb</h1>
  <pre><code>require './test/test_helper'
  require 'rails/performance_test_help'
  require 'benchmark_test_helper'
  require './test/performance/registrations/logging_methods'
  
  module Registration
    class ParentFullTest &lt; ActionDispatch::PerformanceTest
      attr_reader :parent_data
  
      include Registrations::LoggingMethods
  
      def test_with_pet_care_job
        registration_step '01 Member should be created' do
          post registration_submit_path, parent_data[:base_info]
        end
  
        registration_step '02 Job should be posted' do
          post registration_submit_path, parent_data[:petcare_job]
        end
      end
  
      def test_with_companion_care_job
        registration_step '01 Member should be created' do
          post registration_submit_path, parent_data[:base_info]
        end
  
        registration_step '02 Job should be posted' do
          post registration_submit_path, parent_data[:companion_care_job]
        end
     end
  
     def setup
       refresh_member_data
       delete logout_path
  
       write_to_log(&quot;performance test started&quot;)
     end
  
     def teardown
       Account::Member.last.profile.destroy # to clean mongo data
     end
  
  
     private
  
     def refresh_member_data
       @parent_data = BenchmarkTestHelper.yaml_data(data_file)
     end
  
     def data_file
       File.join(File.expand_path('..' ,__FILE__), 'data/parent.yml.erb')
     end
   end
  </code></pre>
  <p>end</p>
  <h1>test/performance/registrations/logging_methods.rb</h1>
  <pre><code>module Registrations
    module LoggingMethods
  
      def registration_step(step_name)
        before_count = Profile::MemberActivity.count
        write_to_log(step_name + ' started')
        yield
        write_to_log(step_name + ' finished')
        assert_equal Profile::MemberActivity.count, before_count+1, step_name
      end
  
      def write_to_log(message)
        Rails.logger.debug message
      end
  end
  </code></pre>
  <h1>test/benchmark_test_helper.rb</h1>
  <pre><code>require 'yaml'
  
  module BenchmarkTestHelper
    class &lt;&lt; self
      def yaml_data(file_name)
        YAML.load(ERB.new(File.read(file_name)).result).with_indifferent_access
      end
    end
  
  end
  </code></pre>