Skip to content

Commit 35a0bfe

Browse files
Merge pull request #9416 from Fryguy/cypress_add_simulator
Add running a simulated queue worker during cypress tests
2 parents 1a9995f + 53b1bc7 commit 35a0bfe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Rakefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,18 @@ namespace :spec do
9797
end
9898
puts "== Rails server started with PID #{rails_pid} =="
9999

100+
puts "\n== Starting simulated queue worker =="
101+
simulator_pid = Bundler.with_original_env do
102+
spawn("bin/rails app:evm:simulate_queue_worker", [:out, :err] => "/dev/null")
103+
end
104+
puts "== Simulated queue worker started with PID #{simulator_pid} =="
105+
100106
Rake::Task["spec:cypress:run"].invoke
101107
ensure
108+
if simulator_pid
109+
puts "\n== Killing simulated queue worker with PID #{simulator_pid} =="
110+
Process.kill("INT", simulator_pid)
111+
end
102112
if rails_pid
103113
puts "\n== Killing Rails server with PID #{rails_pid} =="
104114
Process.kill("INT", rails_pid)

0 commit comments

Comments
 (0)