tests: handle file leaks and SVN test prompt.

- Ignore files that are generated by `brew tests`
- Make the SVN tests work without prompting for GitHub's SSL certificate
This commit is contained in:
Mike McQuaid 2018-09-02 13:43:58 +01:00
parent 5869842e7e
commit ec9e45a8f0
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
3 changed files with 7 additions and 2 deletions

2
.gitignore vendored
View File

@ -18,6 +18,8 @@
/Library/Homebrew/test/bin
/Library/Homebrew/test/coverage
/Library/Homebrew/test/fs_leak_log
/Library/Homebrew/test/.gem
/Library/Homebrew/test/.subversion
/Library/Homebrew/tmp
/Library/Homebrew/.npmignore
/Library/LinkedKegs

View File

@ -32,7 +32,9 @@ describe Utils do
it "returns true when remote exists", :needs_network, :needs_svn do
HOMEBREW_CACHE.cd do
system HOMEBREW_SHIMS_PATH/"scm/svn", "checkout", "https://github.com/Homebrew/install"
system HOMEBREW_SHIMS_PATH/"scm/svn", "checkout",
"--non-interactive", "--trust-server-cert", "--quiet",
"https://github.com/Homebrew/install"
end
expect(described_class).to be_svn_remote_exists(HOMEBREW_CACHE/"install")

View File

@ -10,6 +10,7 @@ module Utils
def self.svn_remote_exists?(url)
return true unless svn_available?
quiet_system "svn", "ls", url, "--depth", "empty"
ssl_args = ["--non-interactive", "--trust-server-cert"] if ENV["HOMEBREW_TEST_ONLINE"]
quiet_system "svn", "ls", url, "--depth", "empty", *ssl_args
end
end