Skip to content

Run benchmark only when ENV['BENCHMARK'] == 'yes' #446

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

Closed
wants to merge 1 commit into from

Conversation

aycabta
Copy link
Member

@aycabta aycabta commented Apr 2, 2017

The test suite of RDoc has a benchmark test. The benchmark test is run when ENV['BENCHMARK'] is set, but Rakefile locks ENV['BENCHMARK'] is 'yes'. Nobody can change whether to run benchmark. This won't serve the purpose.

This Pull Request serves new behavior:

  • Run benchmark test only when ENV['BENCHMARK'] is 'yes'
  • Rakefile sets ENV['BENCHMARK'] as 'yes' only when ENV['BENCHMARK'] isn't set

The benchmark test runs with rake. The benchmark test doesn't run with BENCHMARK=no rake.

This is for avoidance of dependence on CI circumstances.

@zzak
Copy link
Member

zzak commented Apr 3, 2017

Can we skip this test too?
https://github.com/rdoc/rdoc/blob/master/test/test_rdoc_context.rb#L410

I think there is only one benchmark in the whole suite:
https://github.com/rdoc/rdoc/search?utf8=%E2%9C%93&q=bench&type=

@aycabta
Copy link
Member Author

aycabta commented Apr 3, 2017

MiniTest runs assert_performance_* only if require 'minitest/benchmark' evaluated. This Pull Request makes control of run/skip assert_performance_linear what is just one benchmark test in RDoc by require 'minitest/benchmark' or not, over ENV['BENCHMARK']

@aycabta
Copy link
Member Author

aycabta commented Apr 3, 2017

README.txt of RDoc 4.x describes those at "Benchmark" section.

@aycabta
Copy link
Member Author

aycabta commented Apr 3, 2017

@zzak I'll explicitly renpond your question.

I think there is only one benchmark in the whole suite

Yes, I think the same way.

Can we skip this test too?

Yes, BENCHMARK=no rake skips the only one benchmark by this Pull Request.

@aycabta aycabta closed this Apr 8, 2017
@aycabta aycabta mentioned this pull request Apr 8, 2017
@aycabta aycabta deleted the use-benchmark-env branch April 9, 2017 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants