Skip to content

Trim test helper and remove unused dependency#15

Merged
hsbt merged 6 commits intomasterfrom
fix-ci
May 7, 2026
Merged

Trim test helper and remove unused dependency#15
hsbt merged 6 commits intomasterfrom
fix-ci

Conversation

@hsbt
Copy link
Copy Markdown
Member

@hsbt hsbt commented May 7, 2026

No description provided.

hsbt and others added 2 commits May 7, 2026 13:43
Gem::Server itself never references the Zlib module; gzip helpers used
here go through Gem::Util.gzip / .gunzip, which require zlib lazily on
their own.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The helper was forked wholesale from ruby/rubygems and carried ~1500
lines of fixtures, FakeFetcher plumbing, MockGemUi wiring, and platform
helpers that none of the Gem::Server tests touch. Several of those
requires (benchmark, rubygems/mock_gem_ui) also fail on modern Ruby
where they are no longer default. Strip the helper down to just what
the two server test files actually use, and drop utilities.rb entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 7, 2026 04:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Streamlines the RubyGems test harness by removing a large, shared test utility module and trimming Gem::TestCase down to a smaller helper set, while also dropping an unused stdlib require and updating CI Ruby versions.

Changes:

  • Removed test/rubygems/utilities.rb and the related require_relative usage from the test helper.
  • Significantly reduced test/rubygems/helper.rb, keeping only a subset of helper APIs and simplifying quick_gem spec-file writing.
  • Updated CI Ruby matrix and removed require 'zlib' from lib/rubygems/server.rb.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/rubygems/utilities.rb Deleted the shared fake fetcher/spec fetcher/temp IO helpers previously used by tests.
test/rubygems/helper.rb Trimmed the test helper substantially; retained only a minimal set of helpers and simplified spec file writing.
lib/rubygems/server.rb Removed an unused zlib require at the file header.
.github/workflows/test.yml Updated the Ruby version matrix to newer versions and removed older/nightly entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/rubygems/helper.rb
Comment on lines 79 to 84
Gem.loaded_specs.clear
Gem.instance_variable_set(:@activated_gem_paths, 0)
Gem.clear_default_specs
Bundler.reset!

Gem.configuration.verbose = true
Gem.configuration.update_sources = true
hsbt and others added 2 commits May 7, 2026 14:09
Without Bundler.reset!, Gem::Specification still surfaces the gems
Bundler activated for `bundle exec rake test` (bundler, rake,
test-unit, webrick, ...) even after Gem.use_paths(@gemhome), which
makes the gem listing tests fail by including those gems in the
rendered HTML.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hsbt and others added 2 commits May 7, 2026 14:13
RDoc 4.0 shipped in 2013 and the gem's required_ruby_version is now
3.1, so the older "/doc_root/<gem>/rdoc/index.html" path can never be
reached. The version probe also breaks on rdoc 7.x: Gem::RDoc is
aliased to RDoc::RubygemsHook (a delegating shim to RubyGemsHook) and
the tests' direct @rdoc_version override on the shim has no effect,
so test_doc_root_3 / test_have_rdoc_4_plus_eh fail on Ruby 3.1 once
rdoc 7.x is in the bundle. Always emit the 4.0+ URL, drop
have_rdoc_4_plus?, and remove the version-probe tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hsbt hsbt merged commit 68c9ebe into master May 7, 2026
12 checks passed
@hsbt hsbt deleted the fix-ci branch May 7, 2026 06:14
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