Hi Stefan,

I don't understand why You're so anxious the run the tests only once on Your CI environment. You're dealing with two different purposes (build and reporting), that are often handled independently from each other. And normally the CI environment isn't too busy, so that it can easily afford executing the tests twice. Insisting on Maven to run the test only once, generate the test result report AND fail the build on errors won't work, You'll need to accept some limitations or tweak on of the Surefire plugin or Team City.

I see the following possibilities:

1. Just accept having to independent build configurations - my favorite, too ;)

2. Change the invocation sequence: 'mvn site-deploy deploy'. Problem: the site generation doesn't fail, but the build won't fail either (because it won't execute the tests a second time).

3. Creating a second build configuration for 'mvn site-deploy', and trigger it when the 'mvn deploy' build is finished - it can be triggered even if the build 'mvn deploy' build failed. You could try to use the same working directory for both build configurations or at least the same report output directory and configure the 'maven-surefire-report-plugin' with the report set 'report-only'. A shared report output directory could e.g. be defined using a Team City environment variable. Use a profile, that is automatically activated when Maven is invoked by Team City, to configure the Surefire plugins with the shared report output directory.
(I didn't verify all this)

I could imagine some more possibilities, but they would be evil and I won't describe them here ...

Kind regards

   Marc

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to