authorjapps/zerocode

Maven single test build failure marked as success

Aperta

#529 aperta il 15 giu 2022

 (0 commenti) (0 reazioni) (0 assegnatari)Java (447 fork)auto 404
help wantednot-an-issuequestion

Metriche repository

Star
 (1010 stelle)
Metriche merge PR
 (Merge medio 1g 4h) (1 PR mergiata in 30 g)

Descrizione

Hello,

when running single test using maven:

mvn -B -f /app/jenkins/workspace/SingleIntegrationTest/tests/pom.xml clean compile -Dtest=SingleTest#testMethod test -Dio.netty.tmpdir=/var/tmp -Djava.io.tmpdir=/var/tmp -pl integration-tests -am -Dsurefire.failIfNoSpecifiedTests=false

I'm getting assertion errors: 15:16:01.285 [main] ERROR o.j.z.c.r.StepNotificationHandler - Assertion failed for :-

[Single step with assertions] | | +---Step --> [failing_step]

Failures:

Assertion jsonPath '$.body[1].name' with actual value 'A' did not match the expected value 'B'

Assertion jsonPath '$.body[3].id' with actual value '123' did not match the expected value '456'

Assertion jsonPath '$.body[2].type' with actual value 'Water' did not match the expected value 'Sand'

(See below 'Actual Vs Expected' to learn why this step failed)

But still build if marked as success and no tests are marked as executed:

[INFO] [INFO] Results: [INFO] [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 ... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:14 min [INFO] Finished at: 2022-06-13T15:16:08+02:00 [INFO] ------------------------------------------------------------------------

Test class defined with:

@SpringBootTest @TargetEnv("application.properties") @RunWith(ZeroCodeUnitRunner.class)

and method with:

@Test @Scenario("tests/SingleTest/failingTest.yml")

Guida contributor