A platform for community discussion. Free, open, simple.
DEV: allows smoke test to run on macOS (#7735)
Joffrey JAFFEUX8cd13b22a109
diff --git a/lib/tasks/smoke_test.rake b/lib/tasks/smoke_test.rakeindex 57630f6c4b4..70abebcc985 100644--- a/lib/tasks/smoke_test.rake+++ b/lib/tasks/smoke_test.rake@@ -2,12 +2,18 @@desc "run chrome headless smoke tests on current build"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"end- if Gem::Version.new(`$(command -v google-chrome) --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59")- abort "Chrome 59 or higher is required to run smoke tests in headless mode."+ if Gem::Version.new(`\"#{google_chrome_cli}\" --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59")+ abort "Chrome 59 or higher is required to run tests in headless mode."endsystem("yarn install --dev")