-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
test_integration_cmds: allow testing offline. #430
test_integration_cmds: allow testing offline. #430
Conversation
👍 Thanks, Mike. |
@@ -46,6 +46,7 @@ def cmd_output(*args) | |||
ENV["HOMEBREW_BREW_FILE"] = HOMEBREW_PREFIX/"bin/brew" | |||
ENV["HOMEBREW_INTEGRATION_TEST"] = cmd_id_from_args(args) | |||
ENV["HOMEBREW_TEST_TMPDIR"] = TEST_TMPDIR | |||
ENV["HOMEBREW_NO_GITHUB_API"] = "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to cmd/tests.rb
and hide it behind an --offline
argument? I'm not too happy disabling this unconditionally and only for the integration tests (some other parts of the tests might exercise the GitHub API in the future) as I consider this to be a temporary measure until we have a better solution for offline testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no tests shouldn't require you to be online to pass but it's currently only integration tests that have this issue. I could instead add this to brew tests
and apply it globally but I'd rather the flag be --online
rather than --offline
for that reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed; this makes more sense. I mainly wanted to avoid special casing the integration tests (even though they are currently the only ones that do require a network connection).
👍 on setting HOMEBREW_NO_GITHUB_API
in cmd/tests.rb
unless --online
is passed (also better aligns with brew audit
where we also use --online
).
Did this. |
Thanks! Looks good to me! 👍 Would you mind sneaking in this additional option into the help text at the top of the file (maybe in post)? |
Set HOMEBREW_NO_GITHUB_API to allow running all tests (but search's integration test specifically for now) offline. This can be overridden with `--online`.
Set HOMEBREW_NO_GITHUB_API to allow running all tests (but search's integration test specifically for now) offline. This can be overridden with `--online`.
brew tests
with your changes locally?Set HOMEBREW_NO_GITHUB_API to allow running all integration command tests (search specifically for now) offline.
CC @eirinikos