是否可以将 "ERROR No tests to run" 变成警告?

Is it possible to turn "ERROR No tests to run" in to a Warning?

作为我的 CI/CD 过程的一部分,我正在通过 CircleCi 运行ning TestCafe,使用 "Smoke" test-meta 标签(为了 运行我们的回归测试每个构建部署)。

作为 运行 的一部分,CircleCi 在不同的容器上并行地将测试 suites/specs 拆分为 运行,结果是:

testcafe chrome:headless tests/someFolder/someTestSuite.js --test-meta smoke=true

但是,并非每个套件都包含 "Smoke" 测试,因此这些套件将失败并显示 'ERROR No tests to run. Either the test files contain no tests or the filter function is too restrictive'。

有没有办法将其切换为警告,而不是失败?我试过使用 --disable-test-syntax-validation 标志,但可以理解这没有帮助。

您不能通过 public API 执行此操作。您可以考虑定义一个 custom filter 或添加一些带有 meta='smoke' 的空测试来避免此错误。