Question

I'm using minitest and running tests against a rails backend for a gaming application. Because the "game world" has synthesized elements that are generated according to various random distributions, I want to run the test suite repeatedly to reveal any defects that might arise as a consequence of unlikely, but possible combinations of synthesized random attributes. (Like have it run repeatedly for several hours.)

Ideally, Id like the test suite to keep running until I stop it, or until it halts due to an discovered error scenario, at which point I will know what unlikely set of events caused it to fail.

I'm not sure how exactly to the go about this. There doesn't seem to be a rake test option for "run multiple times" or "run till fail".

Was it helpful?

Solution

create a file called "run_tests_forever.rb with:

while true
  puts "running tests again..."
  `rake test`
end

(note: those are backticks to make a system call)

then run with:

ruby run_tests_forever.rb

:)

(or your equivalent requirements...)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top