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
Use absolute paths with autoload #3100
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes the following flaky test failure under ruby 2.4: ``` $ rake TESTOPTS="--name=/\(test_activate_via_require_respects_loaded_files\|test_validate_license_values_or_later\)/ --seed=16773" Run options: "--name=/(test_activate_via_require_respects_loaded_files|test_validate_license_values_or_later)/" --seed=16773 # Running: .F Finished in 0.110757s, 18.0575 runs/s, 63.2012 assertions/s. 1) Failure: TestGemSpecification#test_validate_license_values_or_later [/home/deivid/Code/rubygems/test/rubygems/test_gem_specification.rb:3159]: Expected "WARNING: license value 'GPL-2.0-or-later' is invalid. Use a license identifier from\n" + "http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.\n" + "Did you mean 'GPL-2.0', 'GPL-2.0+'?\n" + "WARNING: See https://guides.rubygems.org/specification-reference/ for help\n" to be empty. 2 runs, 7 assertions, 1 failures, 0 errors, 0 skips rake aborted! Command failed with status (1) Tasks: TOP => default => test (See full trace by running task with --trace) ``` The first test removes `lib/` from the $LOAD_PATH for the duration of the test. During the test, `Gem::Licenses` is autoloaded, but since `lib` is not in the $LOAD_PATH, it's autoloaded from the rubygems version that comes with the ruby installation (rubygems 2.6). In that rubygems version, `GPL-2.0-or-later` was not part of the list of licenses, so the following spec about licenses validation fails. To fix it, we stop relying on the $LOAD_PATH for the `Gem::Licenses` autoload. For consistency, I also migrated the rest of the autoload's.
@bundlerbot merge |
ghost
pushed a commit
that referenced
this pull request
Jan 26, 2020
3100: Use absolute paths with autoload r=deivid-rodriguez a=deivid-rodriguez # Description: Fixes the following flaky test failure under ruby 2.4: ``` $ rake TESTOPTS="--name=/\(test_activate_via_require_respects_loaded_files\|test_validate_license_values_or_later\)/ --seed=16773" Run options: "--name=/(test_activate_via_require_respects_loaded_files|test_validate_license_values_or_later)/" --seed=16773 # Running: .F Finished in 0.110757s, 18.0575 runs/s, 63.2012 assertions/s. 1) Failure: TestGemSpecification#test_validate_license_values_or_later [/home/deivid/Code/rubygems/test/rubygems/test_gem_specification.rb:3159]: Expected "WARNING: license value 'GPL-2.0-or-later' is invalid. Use a license identifier from\n" + "http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.\n" + "Did you mean 'GPL-2.0', 'GPL-2.0+'?\n" + "WARNING: See https://guides.rubygems.org/specification-reference/ for help\n" to be empty. 2 runs, 7 assertions, 1 failures, 0 errors, 0 skips rake aborted! Command failed with status (1) Tasks: TOP => default => test (See full trace by running task with --trace) ``` The first test removes `lib/` from the $LOAD_PATH for the duration of the test. During the test, `Gem::Licenses` is autoloaded, but since `lib` is not in the $LOAD_PATH, it's autoloaded from the rubygems version that comes with the ruby installation (rubygems 2.6). In that rubygems version, `GPL-2.0-or-later` was not part of the list of licenses, so the following spec about licenses validation fails. To fix it, we stop relying on the $LOAD_PATH for the `Gem::Licenses` autoload. For consistency, I also migrated the rest of the autoload's. Closes #3095. # Tasks: - [x] Describe the problem / feature - [ ] Write tests - [x] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md). Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Build succeeded
|
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Fixes the following flaky test failure under ruby 2.4:
The first test removes
lib/
from the $LOAD_PATH for the duration of the test. During the test,Gem::Licenses
is autoloaded, but sincelib
is not in the $LOAD_PATH, it's autoloaded from the rubygems version that comes with the ruby installation (rubygems 2.6). In that rubygems version,GPL-2.0-or-later
was not part of the list of licenses, so the following spec about licenses validation fails.To fix it, we stop relying on the $LOAD_PATH for the
Gem::Licenses
autoload. For consistency, I also migrated the rest of the autoload's.Closes #3095.
Tasks:
I will abide by the code of conduct.