【问题标题】:How to export Allure report to artifacts in gitlab ci job?如何将 Allure 报告导出到 gitlab ci 作业中的工件?
【发布时间】:2020-04-23 16:12:36
【问题描述】:

我正在尝试为 gitlab CI 配置作业,该作业应该运行放心测试并生成魅力报告。我想将报告导出到工件,但不知道如何。 这是作业配置

automation_tests:   
stage: autotests   
script:
        - chmod +x gradlew
        - echo "Starting automation testing"
        - ./gradlew -g /cache/.gradle test --tests "RestAssuredTests"
        - echo "Automation tests were executed"
        - ./gradlew clean build allureReport ((???))  
artifacts:
        when: always
        paths:
          - report

【问题讨论】:

    标签: gitlab-ci allure


    【解决方案1】:

    这是一个导出(模拟)报告的示例.gitlab-ci.yml

    myjob:
      script:
        - mkdir reports/
        - date >> reports/date.txt
      artifacts:
        paths:
          - reports/
    

    https://docs.gitlab.com/ee/ci/yaml/#artifactspaths

    【讨论】:

      【解决方案2】:

      已解决。 检查任务后报告的存储位置并指定工件的路径

      > Task :allureReport
       Report successfully generated to path/build/reports/allure-report
      
      automation_tests:
        stage: autotests
        script:
          - chmod +x gradlew
          - echo "Starting automation testing"
          - ./gradlew test --tests testClass
          - echo "Automation tests were executed"
          - ./gradlew clean build allureReport
        artifacts:
          when: always
          paths:
            - build/reports/allure-report/
          expire_in: 1 hour
      

      【讨论】:

        猜你喜欢
        • 2023-03-14
        • 2021-12-05
        • 2019-08-18
        • 2017-09-05
        • 1970-01-01
        • 2020-08-01
        • 2018-12-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多