您可以在构建项目 buildspec 文件的 reports
部分中为每个报告组指定测试结果文件及其位置。有关更多信息,请参阅 Reports syntax in the buildspec file。
以下是 reports
部分的示例,该示例为构建项目指定了两个报告组。其中一个使用 ARN 指定,另一个使用名称指定。files
部分指定包含测试用例结果的文件。可选的 base-directory
部分指定测试用例文件所在的目录。可选的 discard-paths
部分指定是否丢弃将测试结果文件上传到 Amazon S3 存储桶的路径。
reports:
arn:aws:codebuild:your-region:your-aws-account-id:report-group/report-group-name-1: #surefire junit reports
files:
- '**/*'
base-directory: 'surefire/target/surefire-reports'
discard-paths: false
sampleReportGroup: #Cucumber reports from json plugin
files:
- 'cucumber-json/target/cucumber-json-report.json'
file-format: CUCUMBERJSON #Type of the report, defaults to JUNITXML