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

[Rspecs] Make error message expectation more flexible in runner_spec.rb to support Ruby 2.6 error message format #21591

Merged
merged 1 commit into from Oct 21, 2023

Conversation

AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Oct 20, 2023

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

We recently merged #21587 into trunk, but while the CI was all green when it ran on the PR, it didn't run on Ruby 2.6 on macOS (because we intentionally disabled those to avoid running out of CI credits) and thus failed to detect a small glitch/difference in how Ruby 2.6 formats the error message we were testing in our Unit Tests (specs).

As a result, CI started to fail on trunk after the PR landed

Description

That PR makes the expect of the offending tests more flexible in the way they check the expected ArgumentError message, so that the tests can pass on every version of Ruby and be flexible enough to accommodate the different formats used by different Ruby versions for that error message.

Testing Steps

  • Check that CI is green.
  • If you still have an Intel mac around and thus can still install Ruby 2.6 on your machine, run rbenv local 2.6.6 (or make sure you use a Ruby version 2.6.x system-wide) then run the tests using bundle exec rspec.

Note that CI won't run on { macOS + Ruby 2.6 } in the PR, so it won't be immediately obvious if we fixed that configuration. That being said, We still have some CI jobs that run 2.6 (especially on Linux and Windows) so those could be a way to check the behavior on Ruby 2.6, even if not on macOS.

To support different Ruby versions formatting the error message slightly differently
@AliSoftware AliSoftware self-assigned this Oct 20, 2023
@AliSoftware AliSoftware changed the title Make error message expectation more flexible [Rspecs] Make error message expectation more flexible in runner_spec.rb to support Ruby 2.6 error message format Oct 20, 2023
Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

💯 Great improvement!

Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

I tested this locally on my machine on Ruby 2.6.6 and it works 💪

@rogerluan rogerluan merged commit 72d83cd into master Oct 21, 2023
7 checks passed
@rogerluan rogerluan deleted the fix-specs-symbols-in-error-message branch October 21, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants