Skip to content

Commit

Permalink
tests: default to testing offline. (Homebrew#430)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
MikeMcQuaid authored and souvik1997 committed Jul 25, 2016
1 parent 92d8e45 commit 3228f99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Library/Homebrew/cmd/tests.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#: @hide_from_man_page
#: * `tests` [`-v`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`<test_script/test_method>] [`--seed` <seed>] [`--trace`]:
#: * `tests` [`-v`] [`--coverage`] [`--generic`] [`--no-compat`] [`--only=`<test_script/test_method>] [`--seed` <seed>] [`--trace`] [`--online`]:
#: Run Homebrew's unit and integration tests.

require "fileutils"
Expand All @@ -11,6 +11,7 @@ def tests
ENV["TESTOPTS"] = "-v" if ARGV.verbose?
ENV["HOMEBREW_NO_COMPAT"] = "1" if ARGV.include? "--no-compat"
ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if ARGV.include? "--generic"
ENV["HOMEBREW_NO_GITHUB_API"] = "1" unless ARGV.include? "--online"
if ARGV.include? "--coverage"
ENV["HOMEBREW_TESTS_COVERAGE"] = "1"
FileUtils.rm_f "coverage/.resultset.json"
Expand Down

0 comments on commit 3228f99

Please sign in to comment.