Skip to content
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 test_loaded_gem_types faling in test-bundled-gems (take 3) #49

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Dec 16, 2024

#46 and #48 was both insufficient.

When running test-bundled-gems with make test-bundled-gems, "prism" does not appear in Gem.loaded_specs.

require 'prism'; require 'rbs'
Gem.loaded_specs.keys #=> ['rbs']

When running test with tool/test-bundled-gems.rb, this does not happen.

require 'prism'; require 'rbs'
Gem.loaded_specs.keys #=> ['prism', 'rbs']

So, we need to avoid using Prism as a loaded gem test (#46) and also need to omit test when RBS's gem_dir does not have sig directory (#48).
This pull request is a mix of #46 and #48.

Additional info

It's because prism is a default gem. Same for irb.

[build]% ./exe/ruby -e "require 'prism'; require 'irb'; require 'rbs'; p Gem.loaded_specs.keys"
["rbs"]

[build]% ./ruby -e "require 'prism'; require 'irb'; require 'rbs'; p Gem.loaded_specs.keys"
["error_highlight", "did_you_mean", "syntax_suggest", "prism", "io-console", "reline", "stringio", "date", "psych", "rdoc", "irb", "forwardable", "tempfile", "delegate", "fileutils", "tmpdir", "io-wait", "singleton", "pathname", "shellwords", "rbs", "set", "json", "prettyprint", "pp", "logger", "tsort", "yaml", "digest", "open3", "find"]

Gem.loaded_specs does not include prism when running with `make test-bundled-gems`.
`require 'prism'; Gem.loaded_specs['prism']` returns nil.
This does not happend when running the test with `tool/test-bundled-gems.rb`.
This does not happen with RBS.
Revert again to use sig defined in RBS instead of Prism.
@tompng tompng merged commit 3d8e382 into main Dec 16, 2024
28 checks passed
@tompng tompng deleted the fix_test_bundled_gems_take3 branch December 16, 2024 12:08
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