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

Upgrade to new Minitest constant + new dev env + 3.3 bugfix #325

Merged
merged 9 commits into from
Jul 16, 2024

Conversation

davetron5000
Copy link
Owner

Problem

A few:

  • Minitest changed from MiniTest to Minitest like 10 years ago, but compatibilty was removed somewhat recently. Discovered by @rsanheim in
    Can't build/run tests - due to old ruby version / minitest changes? #323
  • Scaffold test failed on Ruby 3.3
  • Build matrix in CircleCI was out of date, plus Circle doesn't really work and was failing due to their ever-changing YAML configuration
    nonsense, which I absolutely despise.
  • Dev environment is kinda nonexistent.

Solution

  • Update build matrix to only the supported versions of Ruby. At this time, that is 3.1, 3.2, and 3.3
  • Update dev environment tooling to allow easily running GLI's tests on all three using Docker (see CONTRIBUTING.md for docs).
  • Change MiniTest to Minitest to avoid having to deal with compatibility. That change is 10 years old, so even super old unsupported
    Rubies should still work.
  • Fix bug in scaffolded Gemspec discovered on Ruby 3.3. Have to use Gem::Specification.load to load the spec into the Rakefile.
  • Remove CircleCI. The replacement is that I will just run the tests. Sadly, this is a far better and more reliable way of doing things than Circle CI. I do not wish them well.

@davetron5000
Copy link
Owner Author

Fixes #323


I am responsive on issues, so reach out there if you have a question.

## How to Do Development
Copy link
Owner Author

Choose a reason for hiding this comment

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

Clearer docs on how to do local dev for GLI

@@ -92,16 +92,20 @@ Get a more detailed walkthrough on the {main site}[http://davetron5000.github.io

== Supported Platforms

See `.circleci/config.yml` for the supported rubies, but general we're running tests on the all MRI rubies receiving support, which tends to be the most recent four versions.
See `dx/docker-compose.env` and the variable `RUBY_VERSIONS` for the versions that are supported. This should generally track with the supported version of Ruby from Ruby's maintainers.
Copy link
Owner Author

Choose a reason for hiding this comment

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

Ref to which versions are supported

@@ -80,6 +80,9 @@ Rake::TestTask.new("test:unit") do |t|
ENV["RUBYOPT"].split(/\s/).each do |opt|
t.ruby_opts << opt
end
if t.ruby_opts.none? { |x| x =~ /^\-W/ }
Copy link
Owner Author

Choose a reason for hiding this comment

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

Stop showing warnings - some of the code in the tests does stuff you wouldn't want in prod code but I don't feel like fixing it and don't think they are issues. RUBYOPT can be set explicitly to avoid this behavior

@@ -26,5 +26,5 @@ spec = Gem::Specification.new do |s|
s.add_development_dependency("rdoc")
s.add_development_dependency("rainbow", "~> 1.1", "~> 1.1.1")
s.add_development_dependency("sdoc")
s.add_development_dependency("minitest")
s.add_development_dependency("minitest", "~> 5")
Copy link
Owner Author

Choose a reason for hiding this comment

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

Clarify the version of minitest

@@ -121,7 +121,7 @@ def self.mk_rakefile(root_dir,dry_run,project_name,create_test_dir)
rd.title = 'Your application title'
end

spec = eval(File.read('#{project_name}.gemspec'))
spec = Gem::Specification.load("#{project_name}.gemspec")
Copy link
Owner Author

Choose a reason for hiding this comment

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

Bug in Ruby 3.3 - not sure why eval(File.read(...)) didn't work but Gem::Specification.load seems to be the more correct way to do this.

@davetron5000 davetron5000 merged commit e7758f5 into main Jul 16, 2024
@davetron5000
Copy link
Owner Author

Released as 2.21.2

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.

1 participant