我想知道如何使rspec测试成为多线程的。
describe 'Suite' do it 'first' do ... end it 'second', type: :thread do ... end it 'third', type: :thread do ... end end
在这种情况下,我想并行运行指定类型的测试作为线程,非指定类型的测试应该在单线程中运行。如何才能做到这一点?
你有没有试过像这样的宝石 并行测试 和 守卫 ?
另外,你可以用标签@slow标记一些慢速测试,然后用不同的命令运行。rake rspec:slow_tests 和 rake rspec:other_tests 在不同的终端标签intime等。
rake rspec:slow_tests
rake rspec:other_tests