DEV: Add env variable to allow easier debugging of smoke tests

Set `DEBUG_NODE=1` when running `rake smoke:test` and use your favorite tool to debug the smoke tests. See https://nodejs.org/en/docs/guides/debugging-getting-started/ for more information.

The debugger will break at the beginning of the smoke tests when the env variable is set.
This commit is contained in:
Gerhard Schlager 2019-10-24 15:10:18 +02:00
parent decbc9194d
commit 452d541b74
1 changed files with 6 additions and 1 deletions

View File

@ -68,7 +68,12 @@ task "smoke:test" do
results = +""
IO.popen("node #{Rails.root}/test/smoke_test.js #{url}").each do |line|
node_arguments = []
node_arguments << '--inspect-brk' if ENV["DEBUG_NODE"]
node_arguments << "#{Rails.root}/test/smoke_test.js"
node_arguments << url
IO.popen("node #{node_arguments.join(' ')}").each do |line|
puts line
results << line
end