【问题标题】:AWS Code build don't fail if no test files found如果未找到测试文件,AWS 代码构建不会失败
【发布时间】:2022-11-14 02:40:05
【问题描述】:

我的代码构建规范 yml(2.0 版)报告部分如下所示

reports:
  surefire-reports:
    files:
      - '**/target/surefire-reports/*.xml'
    discard-paths: false

如果没有报告文件,则代码构建作业将失败并出现以下错误

2022-11-11T13:19:32.9976751Z Error in UPLOAD_ARTIFACTS phase: [surefire-reports: [report files not found in build]]
2022-11-11T13:20:03.7200288Z ##[warning]The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2022-11-11T13:20:03.7249054Z ##[error]Build status: FAILED

如果没有找到报告文件,有人可以告诉我如何才能不失败吗?

【问题讨论】:

    标签: amazon-web-services aws-codepipeline aws-codebuild maven-surefire-plugin


    【解决方案1】:

    我在<java_src_root>/target/surefire-reports 下创建了一个空的肯定报告xml,dummy.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" name="" time="" tests="0" errors="0" skipped="0" failures="0"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-01
      相关资源
      最近更新 更多