|
Project
|
TeamCity
|
|
Priority
|
Major |
|
Type
|
Feature |
|
State
|
Open |
|
Assignee
|
Kirill Maximov |
|
Subsystem
|
Agent |
|
Affected versions
|
Benares EAP (5813) |
|
Fix versions
|
Medium Priority Pool |
|
Fixed in build
|
No Fixed in build |
TeamCity sets the build status based on the build process exit code.
In this case it seems that the build script exited normally. Can you check this?
BTW, what runner do you use?
If Ant, junit task parameters need to be corrected, if Maven TW-3701 can be the case
I actually have two ant junit tasks - one that runs unit tests, one that runs integration tests, both have the same junit parameters as shown above. I have two builds in TeamCity, the main build is triggered by a commit and runs the full deployment tasks from the ant file then the junit task for the unit tests. The second build triggers on the success of the first build that only runs the junit task for integration tests (which does trigger compilation and dependency tests). The unit tests are running fine and TeamCity is capturing the output for them (even showing progress of number passing or failing, even before there's an exit code from the ant process), but the integration test build has the problems in the screenshots.
Why isn't TeamCity parsing the test output, regardless of the exit code? Oh - I guess that's not in the screenshot - but the status for the integration test build is "Success" and I have no Tests tab at all.
In the build log you provided there is a ClassNotFound exception that means that no tests were actually run, so there is nothing to show on the Tests tab.
TeamCity has the ability to fail the build if at least one test failed (this is configurable - see " Fail build if at least one test failed" option in the General settings of the build configuration) But in your case no tests were actually run: test case initialization failed before running any tests.
For now, your build script can be modified to fail the build if junit task results in error.
This can be done either by changing haltonerror="true" in the junit task (note that this way all other ant tasks will not be executed after error in junit), or by adding failureproperty="my_failure_property" to junit task and then failing the build in the end of the build script if the property was set.
e.g. ensuring Ant's "check_failures" target is called in the end of the build and defining the task:
<target name="check_failures" if="my_failure_property"> <fail message="Failures found"/> </target>Can we try to detect errors reported by JUnit on test case loading and fail the build accordingly (if " Fail build if at least one test failed" is on)?
FWIW, I have noticed since I reported this that I did get "failing" notifications for these builds, just not "failed".
Ideally, I agree with Yegor's comment, but this is sort of a weird case, so I wouldn't be concerned if it wasn't fixed.
[18:56:15]: [testng] [ERROR]: Cannot instantiate class jetbrains.buildServer.requirements.RequirementTypeTest
TW-3917 (Fail build on specific messages appearing in the build log) can help here. Runners can provide the messages that should be considered as build failure identification.