summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused lettests/fix_flaky_failuresDavid Rodríguez2020-01-201-2/+0
|
* Fix running updater specs in isolationDavid Rodríguez2020-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, ``` $ bin/rspec ./spec/bundler/compact_index_client/updater_spec.rb:47 Randomized with seed 40401 /home/deivid/.rbenv/versions/2.7.0/lib/ruby/2.7.0/tmpdir.rb:81: warning: method redefined; discarding old mktmpdir /home/deivid/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/method_double.rb:63: warning: previous definition of mktmpdir was here F Retried examples: 0 Failures: 1) Bundler::CompactIndexClient::Updater when bundler doesn't have permissions on Dir.tmpdir Errno::EACCES is raised Failure/Error: expect do updater.update(local_path, remote_path) end.to raise_error(Bundler::PermissionError) expected Bundler::PermissionError, got #<RSpec::Mocks::MockExpectationError: #<Double :fetcher> received unexpected message :call with (#<Double :remote_path>, {"Accept-Encoding"=>"gzip"})> with backtrace: # ./spec/bundler/compact_index_client/updater_spec.rb:51:in `block (4 levels) in <top (required)>' # ./spec/bundler/compact_index_client/updater_spec.rb:50:in `block (3 levels) in <top (required)>' # ./spec/spec_helper.rb:109:in `block (3 levels) in <top (required)>' # ./spec/spec_helper.rb:109:in `block (2 levels) in <top (required)>' # ./spec/spec_helper.rb:76:in `block (2 levels) in <top (required)>' # ./spec/support/rubygems_ext.rb:98:in `load' # ./spec/support/rubygems_ext.rb:98:in `gem_load_and_activate' # ./spec/support/rubygems_ext.rb:45:in `gem_load' # ./spec/bundler/compact_index_client/updater_spec.rb:50:in `block (3 levels) in <top (required)>' # ./spec/spec_helper.rb:109:in `block (3 levels) in <top (required)>' # ./spec/spec_helper.rb:109:in `block (2 levels) in <top (required)>' # ./spec/spec_helper.rb:76:in `block (2 levels) in <top (required)>' # ./spec/support/rubygems_ext.rb:98:in `load' # ./spec/support/rubygems_ext.rb:98:in `gem_load_and_activate' # ./spec/support/rubygems_ext.rb:45:in `gem_load' Finished in 0.24158 seconds (files took 0.21522 seconds to load) 1 example, 1 failure Failed examples: rspec ./spec/bundler/compact_index_client/updater_spec.rb:47 # Bundler::CompactIndexClient::Updater when bundler doesn't have permissions on Dir.tmpdir Errno::EACCES is raised Randomized with seed 40401 ``` It's the `Updater#initialize` method that requires `tmpdir` making `Dir.mktmpdir` available. In the offending spec, first we stub `Dir.mktmpdir`, and then we initialize the updater, requiring `tmpdir`, and "undoing the stub". That means the test no longer does what it's supposed to. So, my fix is to early instantiate the update, so that by the time we stub `Dir.mktmpdir`, `tmpdir` has already been required, so the stub is not reverted.
* Merge #7577Bundlerbot2020-01-1810-24/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7577: Update references to old repo location r=deivid-rodriguez a=duckinator Related: #7572. ### What was the end-user problem that led to this PR? A lot of things use the outdated `https://github.com/bundler/bundler` URL (and similarly for e.g. `bundler/bundler-site`). ### What is your fix for the problem, implemented in this PR? My fix was to update the outdated URLs. :slightly_smiling_face: ### TODO - [x] `bundler.gemspec` - [x] `CHANGELOG.md` (Moved to its own PR, #7582) - [x] `CODE_OF_CONDUCT.md` - [x] `doc/`, excluding reference to now-dead `pullreview.com` - [x] `doc/contributing/HOW_YOU_CAN_HELP.md` reference to long-dead `pullreview.com` - [x] `.github/config.yml` - [x] `lib/` (comments) - [ ] `lib/` (functional changes) - [ ] `man/` - [x] `README.md` - [x] `spec/` (comments, `skip` messages) - [ ] `spec/` (functional changes) - [ ] `task/release.rake` Co-authored-by: Ellen Marie Dash <me@duckie.co>
| * [repo move] Update GitHub URL in comments and `skip` messages in spec/Ellen Marie Dash2020-01-1610-24/+24
| |
* | Use copy instead of movingci/fix_flakyDavid Rodríguez2020-01-181-1/+1
| | | | | | | | | | | | I'm not really sure why, but the rename syscall sometimes is raising Errno::EXDEV under Windows. I figure using a copy will fix the issue, and it stills reproduces the regression the test is meant to check for.
* | Merge #7559Bundlerbot2020-01-171-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7559: Reactivate usused code for ruby version resolution r=deivid-rodriguez a=larskanis The code was changed in commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 so that RubyVersion.system was no longer respected. This is reactivated now and specs are adjusted accordingly. ### What was the end-user problem that led to this PR? Not known. ### What was your diagnosis of the problem? I read the bundler source code and noticed this. ### What is your fix for the problem, implemented in this PR? My fix re-adds the ruby version as it was before commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 , since it seems to be a mistake. ### Why did you choose this fix out of the possible options? As a alternative I added #7558 that removes the code in question. Co-authored-by: Lars Kanis <kanis@comcard.de>
| * | Reactivate usused code for ruby version resolutionLars Kanis2020-01-161-2/+2
| |/ | | | | | | | | The code was changed in commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 so that RubyVersion.system was no longer respected. This is reactivated now and specs are adjusted accordingly.
* | Don't use needless specific APISutou Kouhei2020-01-171-1/+1
| | | | | | Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>
* | Revert MatchPlatform#platforms_match?Sutou Kouhei2020-01-171-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because some examples are failed: rspec ./spec/cache/gems_spec.rb:236 # bundle cache when previously cached doesn't remove gems that are for another platform rspec ./spec/commands/install_spec.rb:220 # bundle install with gem sources the simple case with a gem that installs multiple platforms installs gems for the local platform as first choice rspec ./spec/commands/update_spec.rb:39 # bundle update with --all updates the entire bundle rspec ./spec/commands/update_spec.rb:49 # bundle update with --all doesn't delete the Gemfile.lock file if something goes wrong rspec ./spec/commands/update_spec.rb:104 # bundle update with a top level dependency unlocks all child dependencies that are unrelated to other locked dependencies rspec ./spec/commands/update_spec.rb:115 # bundle update with an unknown dependency should inform the user rspec ./spec/commands/update_spec.rb:119 # bundle update with an unknown dependency should suggest alternatives rspec ./spec/commands/update_spec.rb:126 # bundle update with a child dependency should update the child dependency rspec ./spec/commands/update_spec.rb:299 # bundle update in a frozen bundle should suggest different command when frozen is set globally rspec ./spec/runtime/platform_spec.rb:60 # Bundler.setup with multi platform stuff will add the resolve for the current platform
* | Don't ignore resolved platform informationSutou Kouhei2020-01-171-0/+23
|/ | | | This is a follow-up change of #7522.
* Add no required_ruby_version againSutou Kouhei2020-01-151-0/+17
|
* Sort available platformsSutou Kouhei2020-01-151-2/+2
|
* Always add a spec group for all platforms to candidatesSutou Kouhei2020-01-152-0/+23
|
* Always add "ruby" version to selected spec groups as fallbackSutou Kouhei2020-01-151-3/+5
|
* Fix the name of Ruby requirementSutou Kouhei2020-01-151-2/+2
| | | | We should use "Ruby\0" instead of "ruby\0".
* Revert unskippable skipsSutou Kouhei2020-01-152-0/+14
|
* Try unskipping on WindowsSutou Kouhei2020-01-152-18/+0
|
* Add support for force_ruby_platform with specific_platform againSutou Kouhei2020-01-152-8/+3
|
* Don't set platforms to dependency registered by gemspecSutou Kouhei2020-01-151-35/+0
| | | | | | | | | Platform related dependencies are resolved in Resolver now. So we don't need to register all available platforms explicitly. This reverts commit 0a8ca4879e0b79aa4109a0dc424940b079ef38d0. See also: #4150 and #4102
* Update expected for specific_platform feature flags caseSutou Kouhei2020-01-152-4/+17
| | | | | In this case, Bundler uses specific platform to resolve dependency. So error message includes specific platform information.
* Improve platform specific gem resolutionSutou Kouhei2020-01-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | It resolves #6247. This changes includes the patches that add (RSpec) specs for this situation in #6247. If there is a platform specific gem but it can't be resolved available version, Bundler reports an error. For example, @index = build_index do gem "bar", "1.0.0" gem "foo", "1.0.0" gem "foo", "1.0.0", "x64-mingw32" do dep "bar", "< 1" end end dep "foo" platforms "x64-mingw32" raises an error because foo-1.0.0-x64-mingw32 requires bar<1 but there isn't bar<1. With this change, foo-1.0.0 (no x64-mingw32) is used as fallback. Because foo-1.0.0 doesn't depend on bar<1.
* Add a spec for when differing dependencies cause the generic version gem to ↵Samuel Giddins2020-01-151-0/+14
| | | | be the only option
* Add two specs for choosing platform specific gemsLars Kanis2020-01-151-0/+29
| | | | The first spec succeeds, but the second spec fails currently.
* Merge #7554Bundlerbot2020-01-131-0/+174
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7554: Fix ruby version parsing in compact index r=deivid-rodriguez a=kou ### What was the end-user problem that led to this PR? The end-user can't use multiple Ruby version requirements (e.g. ">= 2.2, < 2.7.dev") provided by each gem to resolve suitable version. See also: https://github.com/bundler/bundler/pull/7522#issuecomment-571090513 ### What was your diagnosis of the problem? https://rubygems.org/info/ffi returns the following information: ```text 1.11.3-x86-mingw32 |checksum:99e4845796c8dec1c3fc80dc772860a01633b33291bd7534007f5c7724f0b876,ruby:>= 2.2, < 2.7.dev ``` The current parser doesn't parse the line correctly. It drops "< 2.7.dev" requirement for Ruby version. It means that the parsed requirement is "ruby >= 2.2" instead of "ruby >=2.2 && ruby < 2.7.dev". ### What is your fix for the problem, implemented in this PR? I implemented a new parsing logic for "requirements". It assumes that "requirements" has at most three fields: "checksum", "ruby" and "rubygems". Because https://github.com/rubygems/compact_index/blob/master/lib/compact_index/gem_version.rb#L26-L28 implements so. ### Why did you choose this fix out of the possible options? I chose this fix because it's difficult to implement generic parsing logic without "," escape in version. For example, "," leading to "2.2" and "," leading to "2.7.dev" in "ruby:>= 2.2, < 2.7.dev,rubygems:> 1.3.1" are conflict. We need to know field name such as "ruby" and "rubygems" to detect "," as field delimiter. "," in "dependencies" are escaped as "&": https://github.com/rubygems/compact_index/blob/master/lib/compact_index/gem_version.rb#L37 Co-authored-by: Sutou Kouhei <kou@clear-code.com>
| * Fix ruby version parsing in compact indexSutou Kouhei2020-01-121-0/+174
| | | | | | | | | | We can't use the same logic as "dependencies" for "requirements". Because "," in "requirements" isn't escaped as "&".
* | Load `CompactIndexClient` upfronttests/fix_autoload_thread_safety_issueDavid Rodríguez2020-01-131-0/+3
| | | | | | | | | | | | To prevent potential autoloading issues in our parallel tests. I think this could be the cause of https://github.com/rubygems/bundler/runs/386607433.
* | Remove global directory switching from specstests/less_flakynessDavid Rodríguez2020-01-1252-647/+511
| | | | | | | | | | | | | | | | `Dir.chdir` is not thread safe, so it makes our parallel specs flaky. Instead, use the following alternatives: * Use `:chdir` parameter to `Open3` methods for specs that shell out. * Stub `find_gemfile` or other relevant helpers for unit tests.
* | Make warnings spec independent of LOAD_PATHDavid Rodríguez2020-01-121-3/+3
| |
* | Don't load default URI gem during specsDavid Rodríguez2020-01-122-2/+2
| |
* | Extract `man_tracked_files` path helperDavid Rodríguez2020-01-123-2/+8
| |
* | Pass a generic options hash to `sys_exec`David Rodríguez2020-01-125-9/+9
| | | | | | | | For consistency with the rest of helpers.
* | Simplify `gem_command` to pass full args to `gem` togetherDavid Rodríguez2020-01-122-6/+6
| |
* | Extract `bundled_app_gemfile` path helperDavid Rodríguez2020-01-1211-40/+44
| |
* | Extract `bundled_app_lock` path helperDavid Rodríguez2020-01-1219-81/+85
|/
* Lock rack to 2.0.8 for teststests/lock_rackDavid Rodríguez2020-01-111-1/+1
|
* Merge #5521Bundlerbot2020-01-081-4/+61
|\ | | | | | | | | | | | | | | 5521: bundler gem: Support test-unit as a testing framework r=hsbt a=kou Co-authored-by: Kouhei Sutou <kou@clear-code.com>
| * bundler gem: Support test-unit as a testing frameworkKouhei Sutou2019-12-111-4/+61
| |
* | Skip the rest of the failures on WindowsDavid Rodríguez2020-01-0728-33/+372
| |
* | Add missing assertion to one specDavid Rodríguez2020-01-071-0/+2
| |
* | Exclude another permissions spec from Windows buildDavid Rodríguez2020-01-071-1/+1
| |
* | Add fiddle to default gem exemptionsDavid Rodríguez2020-01-071-1/+3
| | | | | | | | | | Since it doesn't seem to work, I guess Windows ruby loads it at some point?
* | Remove redundant installs and raise if they failDavid Rodríguez2020-01-071-4/+2
| |
* | Make sure to pass URI's to `:git`David Rodríguez2020-01-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Passing paths should work in most cases, but on Windows the driver letter is interpreted as the scheme and causes some case mismatches because ``` irb> URI.parse("E:").to_s => "e:" ``` We fix this by passing file URI's instead.
* | Use OS-independent path separatorDavid Rodríguez2020-01-072-5/+5
| |
* | Try fix some specsDavid Rodríguez2020-01-071-1/+1
| | | | | | | | Github actions has lowercase drive letters.
* | Split test gem installation to a separate taskDavid Rodríguez2020-01-071-8/+28
| | | | | | | | | | | | | | We run into a race condition when testing in parallel when all processors install test gems to their test folder (due to shared gem cache). So I figure we can instead run this setup sequentially beforehand.
* | Remove unneeded LOAD_PATH modificationDavid Rodríguez2020-01-071-1/+0
| |
* | Simplify `install_gems` methodDavid Rodríguez2020-01-071-4/+1
| |
* | We don't need a manifestDavid Rodríguez2020-01-071-10/+1
| | | | | | | | This is precisely what the `--conservative` flag to `gem install` does.
* | Use shellescape instead of manually escapingspecs/fix_subprocess_escapingDavid Rodríguez2020-01-051-2/+1
| |