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 sorbet-static-and-runtime version in tests #406

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

egiurleo
Copy link
Contributor

Fixes #404

Description

Spoom tests install gems on an instance of TestProject, including the most recent version of Sorbet. When Sorbet implements a change that breaks existing Spoom tests, that change will likely be surfaced on CI in an unrelated Spoom PR, which creates a lot of confusion amongst developers as they try to track down the reason for the change.

This PR adds a line that fixes the Sorbet version in Spoom tests to the version in Spoom's Gemfile.lock. This is adapted from the approach we take in Tapioca. Now, tests will only break when Sorbet is bumped in Gemfile.lock, which will make it easier to identify the cause of these breaking tests and reduce confusion.

Questions

It looks like all the tests are passing with this change -- are there any tests that should be opted out of this approach?

Testing

To test this, I reverted two recent PRs that bumped Sorbet and fixed a test failure related to the new version of Sorbet; when I ran the test without my change, it failed, and then once my change was implemented, it passed.

Because we do not fix the version of Sorbet used in the Spoom Gemfile,
the Spoom tests have always been run on the newest version of Sorbet.
This can cause tests to fail when a breaking change is made to Sorbet,
without it being obvious to developers why the tests are failing.

This commit fixes the version of `sorbet-static-and-runtime` in the
context of the tests to whatever is currently listed by Gemfile.lock.
Breaking changes in Sorbet will not cause tests to fail until the Sorbet
version is bumped in Gemfile.lock, which leads to test failures that are
easier to identify and fix.
@egiurleo egiurleo requested a review from a team as a code owner June 22, 2023 21:37
@egiurleo egiurleo requested review from Morriar and KaanOzkan June 22, 2023 21:37
Copy link
Contributor

@KaanOzkan KaanOzkan left a comment

Choose a reason for hiding this comment

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

Assuming spoom won't start to use older versions of sorbet in the very near future this lgtm.

@egiurleo egiurleo merged commit 0c1dc7a into main Jun 23, 2023
@egiurleo egiurleo deleted the emily/fix-sorbet-version-in-tests branch June 23, 2023 15:21
@@ -30,6 +30,7 @@ def spoom_gemfile
source("https://rubygems.org")
gemspec name: "spoom", path: "#{SPOOM_PATH}"
gem "sorbet-static-and-runtime", "#{Gem::Specification.find_by_name("sorbet-static-and-runtime").version}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind moving this as a constant here please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sure! Here you go: #408

@shopify-shipit shopify-shipit bot temporarily deployed to production August 8, 2023 17:59 Inactive
@Morriar Morriar added the chore Chore task label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Sorbet version used in tests
3 participants