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

Allow "nonexistent version" test to work without brew #2432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piperswe
Copy link

Currently, this test fails if Homebrew isn't present as it expects a
Homebrew-specific output. This commit varies the expected output based
on whether Homebrew is installed.

This patch was originally created for the Debian package for ruby-build:
https://salsa.debian.org/ruby-team/ruby-build/-/blob/607093e5198cc75ffa8e9a3b551843be5f2f6d93/debian/patches/0001-Fix-nonexistent-version-test-to-work-regardless-of-e.patch

Copy link
Member

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Hi, thank you for offering to make the test more stable. I'm unclear about the original failure on systems without brew, though. The test scenario in question has this line:

stub_repeated brew false

This creates a test-specific stub for the brew binary for the duration of the test. This stub is dynamically injected into PATH in test mode. So, for the purpose of the test it should not matter whether brew exists on the user's system or not. Our brew stub should take precedence.

So if this test fails on systems without brew for anyone, we shouldn't aim to fix a single test scenario and its output, but to fix the stub_repeated brew system that's used in tests. Thoughts?

This patch was originally created for the Debian package for ruby-build:

When was this patch created? Did you author it? Have you experienced the test failure in question?

@piperswe
Copy link
Author

Turns out I had forgotten the context - the patch is a few years old at this point. It's not actually anything to do with Homebrew, and I can remove that part. The Debian build environment doesn't have the .gitdirectory. I'll update this PR to only check for the existence of .git - I think it's reasonable to want this test to pass when you download the tarball from GitHub instead of cloning.

Currently, this test fails if .git isn't present as it expects a
Git-specific output. This commit varies the expected output based
on whether the .git directory is present.

This patch was originally created for the Debian package for ruby-build:
https://salsa.debian.org/ruby-team/ruby-build/-/blob/607093e5198cc75ffa8e9a3b551843be5f2f6d93/debian/patches/0001-Fix-nonexistent-version-test-to-work-regardless-of-e.patch
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.

2 participants