收到错误:作业失败:退出代码 1,但我在管道上收到警告和成功/通过的电子邮件

问题描述 投票:0回答:1

当测试失败时,我会收到管道警告而不是失败,并且会收到成功/通过的电子邮件而不是失败。 这是我的 .gitlab-ci.yml 下面

stages:   
  - qa 

image:
    name: maven:3-jdk-11
    pull_policy: [always, if-not-present]

variables:
    MAVEN_OPTS: "-Dmaven.repo.local=/.m2"

test_qa:
  stage: qa  
  script:
    - echo "testing against qa..."
    - mvn test
     
when: manual        
  artifacts:
        when: always
        reports:
            junit:
              - /target/surefire-reports/TEST-*.xml
        expire_in: 120 days

我的日志、管道和电子邮件的图像

测试结束后,我预计管道会失败,并会收到电子邮件通知来报告失败。 相反,我收到警告和已通过的电子邮件

selenium-webdriver gitlab automated-tests gitlab-ci playwright
1个回答
0
投票

如果您的作业显示警告标志状态,则意味着您的作业设置了

allow_failure:
(在本例中,因为它是针对具有
when: manual
的作业隐含的),因此作业失败不会影响整个管道通过/失败状态。

要解决此问题,请在您的作业上设置

allow_failure: false

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.