authorjapps/zerocode

Maven single test build failure marked as success

オープン

#529 opened on 2022/06/15

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Java (447 件のフォーク)auto 404
help wantednot-an-issuequestion

Repository metrics

Stars
 (1,010 個のスター)
PR merge metrics
 (平均マージ 1d 4h) (30d で 1 merged PR)

説明

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

コントリビューターガイド