Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport rails/rails-perftest#2 to fix rake test:benchmark #9173

Merged
merged 2 commits into from Jun 27, 2013

Commits on Jun 27, 2013

  1. Copy the full SHA
    1db54d7 View commit details
    Browse the repository at this point in the history
  2. clear ARGV to prevent mintest autorun errors:

    Minitest expects the first argument in `ARGV` to be the path to a test file.
    Because `rails benchmarker` and `rails profiler` define an on-the-fly test-case,
    using the first `ARGV` to pass the code to execute this results in:
    
    ```
    /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: 1000.times{"a string"} (ArgumentError)
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:21:in `run'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
    	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
    ```
    
    clearing ARGV after defining the test-case solves this issue.
    senny committed Jun 27, 2013
    Copy the full SHA
    b47f8d0 View commit details
    Browse the repository at this point in the history