Ruby 如何将CI:Reporter或Minitest CI与Minitest自定义运行程序一起使用?

Ruby 如何将CI:Reporter或Minitest CI与Minitest自定义运行程序一起使用?,ruby,continuous-integration,watir-webdriver,bamboo,minitest,Ruby,Continuous Integration,Watir Webdriver,Bamboo,Minitest,我正试图在一个用Ruby编写的带有MiniTest的CI服务器上运行一套自动化测试。我已经为下面的问题写了一个定制的小型测试跑步者 测试正在运行基于web的自动化(Watir Webdriver),我需要自定义运行程序设置浏览器和环境一次,而不是为每个单独的测试 我正在努力让这些测试在持续集成服务器上运行。我想利用来自或的报告 当我尝试将这些宝石包括在内时,我没有收到任何报告。使用ci reporter,我会收到一些错误,表明没有调用来自自定义运行程序的before_套件代码 如何配置其中一个

我正试图在一个用Ruby编写的带有MiniTest的CI服务器上运行一套自动化测试。我已经为下面的问题写了一个定制的小型测试跑步者

测试正在运行基于web的自动化(Watir Webdriver),我需要自定义运行程序设置浏览器和环境一次,而不是为每个单独的测试

我正在努力让这些测试在持续集成服务器上运行。我想利用来自或的报告

当我尝试将这些宝石包括在内时,我没有收到任何报告。使用ci reporter,我会收到一些错误,表明没有调用来自自定义运行程序的before_套件代码

如何配置其中一个CI reporter Gem,以便使用自定义的minitest runner运行它

这是我的跑步者:

MiniTest::Unit.autorun

class MyMiniTest
class Unit < MiniTest::Unit

def before_suites
  # code to run before the first test
end

def after_suites
  # code to run after the last test
end

def _run_suites(suites, type)
  begin
    before_suites
    super(suites, type)
  ensure
    after_suites
  end
end

def _run_suite(suite, type)
  begin
    suite.before_suite if suite.respond_to?(:before_suite)
    super(suite, type)
  ensure
    suite.after_suite if suite.respond_to?(:after_suite)
  end
end


MiniTest::Unit.runner = MyMiniTest::Unit.new
MiniTest::Unit.autorun
类MyMiniTest
类单位<最小测试::单位
德福套房酒店
#要在第一次测试之前运行的代码
结束
德福套房酒店
#上次测试后要运行的代码
结束
def_run_套件(套件,类型)
开始
前套房酒店
超级(套房,类型)
确保
后套房酒店
结束
结束
def运行套件(套件,类型)
开始
suite.before_suite如果suite.response_to?(:before_suite)
超级(套房、类型)
确保
suite.after_suite如果suite.response_to?(:after_suite)
结束
结束
MiniTest::Unit.runner=MyMiniTest::Unit.new

谢谢你的建议

你说“当我尝试包含…”时,你试图在代码中的什么地方进行包含?我试图在rake文件和mini_testhelper.rb文件中要求gem加载到所有测试中。我不是minitest的专家,但是如果你在运行程序的顶部执行要求呢?对于CI reporter,您可能需要在他们首选的支持场所问这个问题,我没有看到它的标签,这让我怀疑他们可能不会看到stackoverflowRake不知道如何构建任务,而不需要rake文件中的CI:reporter。