In my project, We have written many test cases and one Configuration method with annotation @AfterSuite to delete all the test data. Some times this configuration methos is failing but in final result this failure is not getting considered and my Test Suite is passing. Can some one please provide the solution how can we fail the Test Suite in case of Configuration failur as well.
Results :
Failed tests:
QueryResourceTests>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
[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