authorjapps/zerocode

Maven single test build failure marked as success

Ouverte

#529 ouverte le 15 juin 2022

 (0 commentaire) (0 réaction) (0 personne assignée)Java (447 forks)auto 404
help wantednot-an-issuequestion

Métriques du dépôt

Stars
 (1 010 étoiles)
Métriques de merge PR
 (Merge moyen 1j 4h) (1 PR mergée en 30 j)

Description

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")

Guide contributeur