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

Migrate test suite to switchblade #977

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

robdimsdale
Copy link
Member

  • delete low-value tests.

@robdimsdale robdimsdale requested a review from a team as a code owner July 25, 2024 04:13
@robdimsdale robdimsdale changed the base branch from master to develop July 25, 2024 04:14
- delete low-value tests.
Comment on lines -15 to -20
It("works with old version of bundler 2", func() {
app = cutlass.New(Fixtures("bundler_2"))
PushAppAndConfirm(app)
Expect(app.Stdout.String()).To(MatchRegexp(`Your Gemfile.lock was bundled with bundler 2\.\d+\.\d+, which is incompatible with the current bundler version \(2\.\d+\.\d+\)`))
Expect(app.Stdout.String()).To(ContainSubstring(`Deleting "Bundled With" from the Gemfile.lock`))
Expect(app.GetBody("/")).To(ContainSubstring("Hello world!"))
Copy link
Member

Choose a reason for hiding this comment

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

if we support building apps with EOS Bundler versions, this feels like something we should test

Copy link
Member Author

Choose a reason for hiding this comment

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

When this test was written it wasn't really designed to be an EOL test, bundler 2 was just new. The log statements were added later.

Bundler 2 isn't EOL, and I'm not aware of any reason why we should care about testing that apps bundled with older bundlers should work with the buildpack. My understanding is that bundler handles this. It's not a buildpack behavior.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like we actually delete the line in the Gemfile.lock file that causes issues here -

match := regexp.MustCompile(`BUNDLED WITH\s+(\w|\.|-)+\n`)
output := match.ReplaceAll(file, []byte(""))
and then redo the build. Checking that deleting something from a lockfile leads to a successful build seems important to test. Especially because this. might change in newer bundler versions

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. I think that's fair feedback. I'd be happy to include that.

Expect(app).To(HaveUnchangedAppdir("BuildDir Checksum Before Supply", "BuildDir Checksum After Supply"))

Expect(app.GetBody("/")).To(ContainSubstring("Successfully required execjs"))
Expect(app.Stdout.String()).ToNot(ContainSubstring("ExecJS::RuntimeUnavailable"))
Copy link
Member

Choose a reason for hiding this comment

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

is this not a case we care to test for anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

As far as I can tell, there's nothing special about execjs that isn't covered by other apps with javascript (rails6_sprockets, rails7, etc). It's just a library that happens to have a dependency on javascript.

This test was added 9 years ago. There's no real context in the tracker story other than "using the latest version of nodejs".

So I wonder if this test was just the one example they used to drive out nodejs support. But we have that covered by other tests.

@sophiewigmore
Copy link
Member

It's hard to comment because my GH UI keeps freezing. My main point of review is understanding the reasons we deleted some tests with no replacement. I understand some might not be good tests, or might be out of date. Some explanation of the more controversial removals might be useful

@robdimsdale
Copy link
Member Author

It's hard to comment because my GH UI keeps freezing

😬

Some explanation of the more controversial removals might be useful

Sure. But I don't know what you consider controversial :)

I can go through and explain each test removal

@sophiewigmore
Copy link
Member

@robdimsdale I can try to save you some time and make a list of the ones im wondering about

@sophiewigmore
Copy link
Member

@robdimsdale I think we covered the main items I was concerned about, let's get this merged in

@sophiewigmore sophiewigmore merged commit 5e6a591 into develop Aug 2, 2024
7 checks passed
@sophiewigmore sophiewigmore deleted the rewrite-using-switchblade branch August 2, 2024 19:31
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.

3 participants