Merge pull request #8679 from MikeMcQuaid/tests-tweaks
Tweak tests annotations
This commit is contained in:
commit
5875f74c4d
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@ -60,6 +60,14 @@ jobs:
|
|||||||
- name: Run brew man
|
- name: Run brew man
|
||||||
run: brew man --fail-if-changed
|
run: brew man --fail-if-changed
|
||||||
|
|
||||||
|
- name: Install brew tests dependencies
|
||||||
|
if: matrix.os == 'macOS-latest'
|
||||||
|
run: |
|
||||||
|
brew install subversion
|
||||||
|
Library/Homebrew/shims/scm/svn --homebrew=print-path
|
||||||
|
which svn
|
||||||
|
which svnadmin
|
||||||
|
|
||||||
- name: Run brew tests
|
- name: Run brew tests
|
||||||
run: |
|
run: |
|
||||||
# brew tests doesn't like world writable directories
|
# brew tests doesn't like world writable directories
|
||||||
|
|||||||
@ -125,17 +125,23 @@ RSpec.configure do |config|
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.before(:each, :needs_svn) do
|
config.before(:each, :needs_svn) do
|
||||||
skip "Subversion is not installed." unless quiet_system "#{HOMEBREW_SHIMS_PATH}/scm/svn", "--version"
|
svn_shim = HOMEBREW_SHIMS_PATH/"scm/svn"
|
||||||
|
skip "Subversion is not installed." unless quiet_system svn_shim, "--version"
|
||||||
|
|
||||||
|
svn_shim_path = Pathname(Utils.popen_read(svn_shim, "--homebrew=print-path").chomp.presence)
|
||||||
svn_paths = PATH.new(ENV["PATH"])
|
svn_paths = PATH.new(ENV["PATH"])
|
||||||
|
svn_paths.prepend(svn_shim_path.dirname)
|
||||||
|
|
||||||
if OS.mac?
|
if OS.mac?
|
||||||
xcrun_svn = Utils.popen_read("xcrun", "-f", "svn")
|
xcrun_svn = Utils.popen_read("xcrun", "-f", "svn")
|
||||||
svn_paths.append(File.dirname(xcrun_svn)) if $CHILD_STATUS.success? && xcrun_svn.present?
|
svn_paths.append(File.dirname(xcrun_svn)) if $CHILD_STATUS.success? && xcrun_svn.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
svn = which("svn", svn_paths)
|
svn = which("svn", svn_paths)
|
||||||
|
skip "svn is not installed." unless svn
|
||||||
|
|
||||||
svnadmin = which("svnadmin", svn_paths)
|
svnadmin = which("svnadmin", svn_paths)
|
||||||
skip "Subversion is not installed." if !svn || !svnadmin
|
skip "svnadmin is not installed." unless svnadmin
|
||||||
|
|
||||||
ENV["PATH"] = PATH.new(ENV["PATH"])
|
ENV["PATH"] = PATH.new(ENV["PATH"])
|
||||||
.append(svn.dirname)
|
.append(svn.dirname)
|
||||||
@ -143,7 +149,7 @@ RSpec.configure do |config|
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.before(:each, :needs_unzip) do
|
config.before(:each, :needs_unzip) do
|
||||||
skip "UnZip is not installed." unless which("unzip")
|
skip "Unzip is not installed." unless which("unzip")
|
||||||
end
|
end
|
||||||
|
|
||||||
config.around do |example|
|
config.around do |example|
|
||||||
|
|||||||
@ -149,14 +149,14 @@ describe Utils::Git do
|
|||||||
expect { described_class.ensure_installed! }.to raise_error("Git is unavailable")
|
expect { described_class.ensure_installed! }.to raise_error("Git is unavailable")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs git" do
|
unless ENV["HOMEBREW_TEST_GENERIC_OS"]
|
||||||
skip if ENV["HOMEBREW_TEST_GENERIC_OS"]
|
it "installs git" do
|
||||||
|
expect(described_class).to receive(:available?).and_return(false)
|
||||||
|
expect(described_class).to receive(:safe_system).with(HOMEBREW_BREW_FILE, "install", "git").and_return(true)
|
||||||
|
expect(described_class).to receive(:available?).and_return(true)
|
||||||
|
|
||||||
expect(described_class).to receive(:available?).and_return(false)
|
described_class.ensure_installed!
|
||||||
expect(described_class).to receive(:safe_system).with(HOMEBREW_BREW_FILE, "install", "git").and_return(true)
|
end
|
||||||
expect(described_class).to receive(:available?).and_return(true)
|
|
||||||
|
|
||||||
described_class.ensure_installed!
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user