authorjapps/zerocode

Maven single test build failure marked as success

开放

#529 创建于 2022年6月15日

 (0 条评论) (0 个反应) (0 位负责人)Java (447 个派生)auto 404
help wantednot-an-issuequestion

仓库指标

星标
 (1,010 个星标)
PR 合并指标
 (平均合并 1天 4小时) (30 天内合并 1 个 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")

贡献者指南