Ruby 中的 Selenium-Webdriver 和 minitest。如何定义 parallelize_me 数量

Selenium-Webdriver in Ruby with minitest. How to define parallelize_me amount

我正在测试 Minitest 以将其与 Rspec 进行比较,我现在正在测试 parallelize_me!选项。问题是它 运行 只能同时处理 2 个作业,而且,对于 4 核 CPU 我认为它可以同时 运行 最多处理 4 个作业,但也许我错了。

是否有参数或设置来定义同时 运行 的作业数量?

我说的是测试中的 parallelize_me! 选项。

require 'rubygems'
require 'minitest/spec'
require 'minitest/autorun'
require 'minitest/hell'
require 'selenium-webdriver'

class Web_Test < MiniTest::Test
    parallelize_me!
    def setup

我在这里找到了解决方案: http://chriskottom.com/blog/2014/10/exploring-minitest-concurrency/

$ N=4 rake test

$ N=4 ruby path/to/test/suite.rb

One additional feature that’s not documented anywhere that I could find except in the source code: you can specify the number of worker threads started and run by Minitest::Parallel::Executor by providing an environment variable on the command line when you run your tests like so: N=4 rake test. (Minitest defaults to N=2 if no other value is given.)