mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
DEV: allows smoke test to run on macOS (#7735)
This commit is contained in:
parent
bae7b75e23
commit
8cd13b22a1
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user