在 Jenkins 中禁止显示 Simpletest JUnit XML 输出中的警告



我正在使用Drupal 7多站点安装,该安装位于Vagrant创建的VM中。我正在使用 Jenkins 在这个环境中的几个站点上运行 Simpletests。

这些测试的输出是JUnit XML格式的,由Jenkins读取。我遇到的问题是输出包含一些与测试结果无关的 php 警告,但由于这些警告,测试被标记为失败。

通知示例:

`exception: [Notice] Array to string conversion [theme.inc:129]`

上述"通知"被标记为测试失败。

我想禁止显示这些警告和通知,以便测试仅在错误或实际失败的测试时失败。

下面是一个测试的完整输出:

Error Message
Number of unexpected errors: 2
Stacktrace
exception: [Notice] Array to string conversion [theme.inc:129]
exception: [Notice] Array to string conversion [theme.inc:129]
Standard Output
exception: [Notice] Array to string conversion [theme.inc:129]
exception: [Notice] Array to string conversion [theme.inc:129]

我能够通过添加以下内容来抑制这些警告和通知:error_reporting(E_ERROR);到全局设置文件的顶部。 所有测试均通过!

最新更新