DEV: allows smoke test to run on macOS (#7735)

This commit is contained in:
Joffrey JAFFEUX 2019-06-07 18:20:48 +02:00 committed by GitHub
parent bae7b75e23
commit 8cd13b22a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,12 +2,18 @@
desc "run chrome headless smoke tests on current build" desc "run chrome headless smoke tests on current build"
task "smoke:test" do task "smoke:test" do
unless system("command -v google-chrome >/dev/null;") if RbConfig::CONFIG['host_os'][/darwin|mac os/]
google_chrome_cli = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
else
google_chrome_cli = "google-chrome"
end
unless system("command -v \"#{google_chrome_cli}\" >/dev/null")
abort "Chrome is not installed. Download from https://www.google.com/chrome/browser/desktop/index.html" abort "Chrome is not installed. Download from https://www.google.com/chrome/browser/desktop/index.html"
end end
if Gem::Version.new(`$(command -v google-chrome) --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59") if Gem::Version.new(`\"#{google_chrome_cli}\" --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59")
abort "Chrome 59 or higher is required to run smoke tests in headless mode." abort "Chrome 59 or higher is required to run tests in headless mode."
end end
system("yarn install --dev") system("yarn install --dev")