Introduction
Projects using based on common_build.xml are provided with Cobertura code coverage and JUnit test targets. Bamboo is now executing these targets and producing test and coverage reports.
This may raise some general questions, such as:
I will attempt to answer these here...
Common questions regarding Bamboo and unit tests
What do I do about my failed Bamboo builds?
When a unit test fails during a continuous integration build, Bamboo will mark the build as failed. For example, the platform engine project is shown (see image below) to have failed because 1 test out of 27 is broken. Tests are run in our continuous environment in order to provide visibility to the engineering team so we can react to unstable builds and bring them back to stability.
How do I see my test results in Bamboo?
If you see your project is failing because of tests, you can see the test results in Bamboo by clicking on the link to the failed build, in this case it is 20-ENG-107. You will then see an overview of the build. Your test report is visible in the Test section (see image below). So in this example you can see the test that failed is called Audit sql entryin AuditSQLEntryTest.
How do I get my unit tests running in Bamboo?
If your project is building on Bamboo but is not reporting on unit tests, this could be because:
- Your project is not yet based on the common build and your customized Ant file does not include a test and/or coverage target
- If these targets don't exist, Bamboo cannot report anything. Once your project has been ported to the common build talk with the build team about getting Bamboo to execute your unit tests.
- Bamboo is not executing your test and/or coverage Ant target
- Get with the build team or make the change yourself (see Enrico for Bamboo permissions)
- Your project is based on the common build but is not yet building on Bamboo
- One solution here is to get this effort placed on the build team's backlog, but the preferred approach is...
- Setup your CI build yourself in Bamboo. You will need to interact with Enrico for a Bamboo login and build creation credentials. There is a wiki page under construction for how to setup Bamboo builds.