如何在非rails应用中并行运行rspec测试?

问题描述 投票:1回答:1

我想知道如何使rspec测试成为多线程的。

describe 'Suite' do
  it 'first' do
    ...
  end

  it 'second', type: :thread do
    ...
  end

  it 'third', type: :thread do
    ...
  end
end

在这种情况下,我想并行运行指定类型的测试作为线程,非指定类型的测试应该在单线程中运行。如何才能做到这一点?

ruby-on-rails ruby multithreading rspec
1个回答
2
投票

你有没有试过像这样的宝石 并行测试守卫 ?

另外,你可以用标签@slow标记一些慢速测试,然后用不同的命令运行。rake rspec:slow_testsrake rspec:other_tests 在不同的终端标签intime等。

© www.soinside.com 2019 - 2024. All rights reserved.