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 tests on macOS #1254

Merged
merged 2 commits into from
Nov 13, 2018
Merged

Fix tests on macOS #1254

merged 2 commits into from
Nov 13, 2018

Conversation

jasonkarns
Copy link
Member

Fixes #1056

PR #1038, specifically https://github.com/rbenv/ruby-build/pull/1038/files#diff-2b060f35496217f5f6b474e5552c11e2L6
broke the test suite on macOS.

This is because including /usr/local/bin in PATH makes
homebrew packages available to the tests, in particular readline.

Since ruby-build will prefer homebrew readline if available, making it
available in the tests will break any assertions that assume it won't
be available.

This PR also enables the test suite to run on macOS on Travis to prevent
regressions. The enabling of travis is the first commit, such that the
build can be seen to fail before the fix in the second commit.

For the tests to run on FreeBSD, the bash executable needs to be
available in PATH.

The test_helper PATH was modified by
49a9471 and f70d958
in order to be sure that bash is in PATH on FreeBSD.
(The default location for packages on FreeBSD is /usr/local/bin, and
since bash isn't provided by FreeBSD itself, that means /usr/local/bin
is the most common, if not only, location to find bash on FreeBSD.)

However, adding /usr/local/bin to PATH means that homebrew-managed
packages on macOS are now in PATH for the test suite. This is especially
important due to packages like readline. Since ruby-build prefers
homebrew readline when available, this makes the tests fail on macOS
(because the tests are written assuming no readline configuration.)

While the tests could stub brew in all cases, to ensure the readline
package is ignored by the tests, it seems more prudent to revert the
PATH to be as minimal as possible, and to only include /usr/local/bin by
precisely the OS that depends on it.
@hsbt
Copy link
Member

hsbt commented Nov 13, 2018

Great! I always switch /bin/bash for testing ruby-build. This helps me too.

@hsbt hsbt merged commit f18e085 into rbenv:master Nov 13, 2018
@jasonkarns jasonkarns deleted the osx-tests branch November 13, 2018 03:11
@mislav
Copy link
Member

mislav commented Nov 20, 2018

Thank you @jasonkarns!

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.

build tests failing on OS X (10.12.3)
3 participants