0

我们在@AfterSuite 中编写了清理代码来清理数据库中的所有测试数据。它只是一种测试用例,但我们希望在所有测试完成后执行,所以保存在@AfterSuite。如果@AfterSuite 方法失败,我的管道没有失败,我们是否可以对其进行自定义,以便在@AfterSuite 方法失败时我们可以失败???

输出快照-

Results :

Failed tests: 
  TestA>AbstractCommonBaseTest.afterSuite:179->AbstractCommonBaseTest.verifyDeleteSuccessResults:186->AbstractCommonBaseTest.printErrorFromRPAS:170 1 Excepted success but error or exception was thrown from RPAS = com.kobylynskyi.graphql.codegen.model.graphql.GraphQLError@22d86754

**Tests run: 334, Failures: 1, Errors: 0, Skipped: 0**

*Here it is failing @AfterSuiteMethod but at down it is showing as* **SUCCESS**

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6:11.466s
[INFO] Finished at: Thu Mar 18 11:37:14 UTC 2021
[INFO] Final Memory: 39M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project rpas-functional-test: There are test failures.
[ERROR] 
[ERROR] Please refer to /ibp/data/ibpslave/workspace/8794421764755340381/test_rpas_integration/rpas-functional-test/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
Saving reports...
Processing '/var/jenkins_home/jobs/8794421764755340381/jobs/test_rpas_integration/builds/40/testng/testng-results.xml'
TestNG Reports Processing: FINISH
**Finished: SUCCESS**
4

0 回答 0