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

✨ Support eval_gemfile #248

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Conversation

pboling
Copy link
Contributor

@pboling pboling commented Feb 3, 2025

@pboling
Copy link
Contributor Author

pboling commented Feb 3, 2025

I think the test suite was already broken before I made any changes @nickcharlton

The new test I wrote for eval_gemfile should be passing though.

end

def build_gemspec(path = ".")
Dir.mkdir("tmp/stage/#{path}") rescue nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was an existing pattern in the tests I merely copied.

end

def build_modular_gemfile
Dir.mkdir("tmp/stage/gemfiles") rescue nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was an existing pattern in the tests I merely copied.

@pboling pboling force-pushed the eval_gemfile branch 3 times, most recently from 9f19d18 to 05d6d9c Compare February 3, 2025 15:44
pboling added a commit to VitalConnectInc/turbo_tests that referenced this pull request Feb 3, 2025
@pboling
Copy link
Contributor Author

pboling commented Feb 12, 2025

ping @nickcharlton 🔶

@pboling pboling mentioned this pull request Feb 18, 2025
@n-rodriguez
Copy link
Contributor

@pboling

I think the test suite was already broken before I made any changes

I don't think so, see: https://github.com/thoughtbot/appraisal/actions/runs/10999060013, but it might be due to a change in Bundler 😢

@pboling
Copy link
Contributor Author

pboling commented Feb 20, 2025

Interesting. Actually there may only be a few minor failures. From the Ruby 3.4 build:

            expected: 
"# This file was generated by Appraisal\n\nsource \"[https://rubygems.org\](https://rubygems.org/)"\n\nruby({:file=>\".ruby-version\"})\n\ngem \"appraisal\", :path => \"/home/runner/work/appraisal/appraisal\"\n"
            got:
"# This file was generated by Appraisal\n\nsource \"[https://rubygems.org\](https://rubygems.org/)"\n\n:ruby({file => \".ruby-version\"})\n\ngem \"appraisal\", :path => \"/home/runner/work/appraisal/appraisal\"\n"

The difference is there are spaces around the => for :file in got, but not expected. Oddly the spaces around => for :path are the same in both...

Also there is a semicolon before ruby for expected, but not for got. This seems like tests may not have been modified properly according to the way hashes print in Ruby 3.4?

@pboling
Copy link
Contributor Author

pboling commented Feb 20, 2025

@nickcharlton I tihnk some of the failures were legit broken stuff. I've fixed pretty much everything (and done some other things too) in a new PR:
#249

@n-rodriguez
Copy link
Contributor

@pboling thank you!
@nickcharlton LGTM

- Support debug for debugging with Ruby >= 2.7
- Support byebug for debugging with Ruby < 2.7
…d matrix

- all current jruby and truffleruby are compatible with Ruby 3.1 at minimum, thus are supported by latest bundler
- Use strip_heredoc uniformly in acceptance tests
- Differences in handling of whitespace between versions of Ruby are often seen as minor, and go unnoticed unless tests explicitly test white space as appraisal's test suite does.
@pboling
Copy link
Contributor Author

pboling commented Feb 21, 2025

Rebased on top of the PR that fixes the build (#250) down to Ruby 2.7.

@pboling
Copy link
Contributor Author

pboling commented Feb 24, 2025

Rebased on my lts branch again, which should make the build green here.

desc "Run the given task for all appraisals"
task appraisal: "appraisal:all"
desc("Run the given task for all appraisals")
task(:appraisal => "appraisal:all")
Copy link

Choose a reason for hiding this comment

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

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.

ARGV.shift
exec "bundle exec appraisal rake #{ARGV.join(' ')}"
exec("bundle exec appraisal rake #{ARGV.join(" ")}")
Copy link

Choose a reason for hiding this comment

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

Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.

exec "bundle exec appraisal #{appraisal.name} rake #{ARGV.join(' ')}"
warn("`rake appraisal:#{appraisal.name}` task is deprecated and will be removed soon. " \
"Please use `appraisal #{appraisal.name} rake #{ARGV.join(" ")}`.")
exec("bundle exec appraisal #{appraisal.name} rake #{ARGV.join(" ")}")
Copy link

Choose a reason for hiding this comment

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

Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.
Metrics/LineLength: Line is too long. [84/80]

"Please use `appraisal #{appraisal.name} rake #{ARGV.join(' ')}`."
exec "bundle exec appraisal #{appraisal.name} rake #{ARGV.join(' ')}"
warn("`rake appraisal:#{appraisal.name}` task is deprecated and will be removed soon. " \
"Please use `appraisal #{appraisal.name} rake #{ARGV.join(" ")}`.")
Copy link

Choose a reason for hiding this comment

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

Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.
Metrics/LineLength: Line is too long. [83/80]

warn "`rake appraisal:#{appraisal.name}` task is deprecated and will be removed soon. " +
"Please use `appraisal #{appraisal.name} rake #{ARGV.join(' ')}`."
exec "bundle exec appraisal #{appraisal.name} rake #{ARGV.join(' ')}"
warn("`rake appraisal:#{appraisal.name}` task is deprecated and will be removed soon. " \
Copy link

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [103/80]

@@ -24,30 +31,31 @@ def self.format_string(object, enclosing_object = false)
end
end

# Appraisal needs to print Gemfiles in the oldest Ruby syntax that is supported by Appraisal.
# This means formatting Hashes as Rockets, until support for Ruby 1.8 is dropped.
Copy link

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [85/80]

@@ -24,30 +31,31 @@ def self.format_string(object, enclosing_object = false)
end
end

# Appraisal needs to print Gemfiles in the oldest Ruby syntax that is supported by Appraisal.
Copy link

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [97/80]

@@ -15,7 +22,7 @@ def self.format_string(object, enclosing_object = false)
end

if enclosing_object
"{ #{items.join(', ')} }"
"{ #{items.join(", ")} }"
Copy link

Choose a reason for hiding this comment

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

Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.

end

# Appraisal needs to print Gemfiles in the oldest Ruby syntax that is supported by Appraisal.
# Otherwise, a project would not be able to use Appraisal to test compatibility
Copy link

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [83/80]

Gem::Version.create(Bundler::VERSION) > Gem::Version.create("2.4.22")
end

# Appraisal needs to print Gemfiles in the oldest Ruby syntax that is supported by Appraisal.
Copy link

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [97/80]

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.

Appraisal doesn't support eval_gemfile
2 participants