vendredi 26 mars 2021

Go test succeed but pipeline fails with exit code 2

I execute a go test suite where all tests seem to PASS

.
.
.

    envs_test.go:366:   Unit Testing handleCommonVarsBuf function
=== RUN   TestUnitHandleCommonVarsBuf/Testing_truncated_output_same_value_for_common_variable
=== RUN   TestUnitHandleCommonVarsBuf/Testing_expected_error
=== RUN   TestUnitHandleCommonVarsBuf/Testing_expected_functionality_common_value
=== RUN   TestUnitHandleCommonVarsBuf/Testing_expected_functionality_different_value
--- PASS: TestUnitHandleCommonVarsBuf (0.00s)
    --- PASS: TestUnitHandleCommonVarsBuf/Testing_truncated_output_same_value_for_common_variable (0.00s)
    --- PASS: TestUnitHandleCommonVarsBuf/Testing_expected_error (0.00s)
    --- PASS: TestUnitHandleCommonVarsBuf/Testing_expected_functionality_common_value (0.00s)
    --- PASS: TestUnitHandleCommonVarsBuf/Testing_expected_functionality_different_value (0.00s)
PASS
coverage: 51.6% of statements
ok      github.com/myrepo/pkg/pkg1  126.921s    coverage: 51.6% of statements
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/myrepo/pkg/pkg2  0.497s  coverage: 0.0% of statements [no tests to run]

but my (jenkins) pipeline fails apparently because the exit code is 2

▶ echo $?
2

why is that?

There are a lot more tests being executed but there is no occurence of the word FAIL.

Aucun commentaire:

Enregistrer un commentaire