-
Notifications
You must be signed in to change notification settings - Fork 613
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
Fix breaking change of execution order on TestTask #368
Conversation
Due to ruby#357, execution order on Rake 13.0.2 changes from Rake 13.0.1. Example: ``` Rake::TestTask do |t| t.test_files = [ "test/a.rb", "test/b.rb", ] end ``` On 13.0.2, Rake executes test/b.rb before test/a.rb because test/a.rb are loaded before rake_test_loader.rb. rake_test_loader.rb executes the Ruby code in ARGV using Kernel.#require, but does not execute test/a.rb which is already loaded. In addition, Rake 13.0.1 allows specifying test_files without .rb but 13.0.2 doesn't allows. This commit also fixes this problem. ``` Rake::TestTask do |t| t.test_files = [ "test/setup", "test/a.rb", ] end ```
Thanks for finding this! I hope this gets merged soon. |
@ysakasin Thanks to your report and patch. I merged it and release rake-13.0.3 now. Can you confirm to fix your issue with rake-13.0.3? @mattbrictson Also confirm it with rake-13.0.3? |
@hsbt confirmed, it is fixed in rake-13.0.3. Thanks! |
@hsbt I confirmed to fix my issue with rake-13.0.3. Thank you merging and releasing! |
Thanks! 13.0.3 also fixes the test issues we've been seeing in our environment. Would it be a good idea to yank 13.0.2 from Rubygems so that users don't accidentally install it? |
Apologies for the unintentional breaking change and thanks @ysakasin for the quick fix, @hsbt for the quick release and @mattbrictson for the quick testing ❤️. @evgeni No, that's not a good idea. The use case for yanking a gem is if someone stole your credentials and pushed a malicious version of your gem, or if you accidentally pushed sensitive data together with your gem, or things like that. Yanking a gem has bad consequences on lockfiles locked to the yanked version and in general is not recommended for deleting gems that have bugs. Imagine if every gem that has a bug needed to be yanked, we'd be wiping out the whole rubygems.org DB 🤣. |
Due to #357, execution order on Rake 13.0.2 changes from Rake 13.0.1.
Example:
On 13.0.2, Rake executes test/b.rb before test/a.rb because test/a.rb are loaded before rake_test_loader.rb.
rake_test_loader.rb executes the Ruby code in ARGV using Kernel.#require, but does not execute test/a.rb which is already loaded.
In addition, Rake 13.0.1 allows specifying test_files without .rb but 13.0.2 doesn't allows.
This commit also fixes this problem.