创建报告组 (buildspec) - Amazon CodeBuild
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

创建报告组 (buildspec)

使用 buildspec 创建的报告组不会导出原始测试结果文件。您可以查看报告组并指定导出设置。有关更多信息,请参阅更新报告组

使用 buildspec 文件创建报告组
  1. 选择与您 Amazon 账户中的报告组无关的报告组名称。

  2. 使用此名称配置 buildspec 文件的 reports 部分。在此示例中,报告组名称为 new-report-group,并使用 JUnit 框架创建使用测试用例:

    reports: new-report-group: #surefire junit reports files: - '**/*' base-directory: 'surefire/target/surefire-reports'

    也可以通过在 buildspec 中使用环境变量来指定报告组名称:

    version: 0.2 env: variables: REPORT_GROUP_NAME: "new-report-group" phases: build: commands: - ... ... reports: $REPORT_GROUP_NAME: files: - '**/*' base-directory: 'surefire/target/surefire-reports'

    有关更多信息,请参阅 指定测试文件Reports syntax in the buildspec file

  3. commands 部分中,指定运行测试的命令。有关更多信息,请参阅 指定测试命令

  4. 运行构建。构建完成后,将使用 project-name-report-group-name 格式的名称创建一个新的报告组。有关更多信息,请参阅报告组命名