Whenever I trigger my plan for running automated test cases using maven
It is showing build as success however the test cases executed is always 0
My framework is build using Cucumber, testng and maven
Hello Pramodh,
Welcome to Atlassian community
As I see you are using Maven, is your build producing test files. This should be in the xml format and should be present inside the build directory where Bamboo can read it, are you able to confirm if the xml files exist?
By default Maven will look into the default location, but you can modify it to look into a specific directory where the xml files are present
You can read more about it at https://confluence.atlassian.com/bamboo/configuring-a-test-task-289277052.html , there is also an option to use the test parser task to separately parse these test files if you which locations they are generated within the build directory.
Regards,
Shashank Kumar
**please don't forget to Accept the answer if your query was answered**
Hi Shashank,
When I run it is not showing reports at all, and also in the logs it is showing as 0 test runs
[INFO] -------------------------------------------------------[INFO] T E S T S[INFO] -------------------------------------------------------[INFO] Running TestSuite[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.247 s - in TestSuite[INFO][INFO] Results:[INFO][INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0[INFO][INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------
this is what I meant 0 test cases running
Regards,Reddy Pramodh A
This means your build is not producing any Test XML, which Bamboo will read to understand if it contains any test cases or if the XML is produced it is not in right format.
Can you check your code to validate if it produces valid test XML files which contains test cases which Bamboo can parse?
Can you see the location of these XML's in your build directory and make sure maven task is configured correctly to read those.
See one example repo which produces test cases like below which Bamboo can parse and show in the results.
https://github.com/testhub-io-examples/java-maven-junit
The structure of the XML looks something like below
<UnitTest name="Storage_ReplaceAllAttributes_PathExist_1" storage="/data/active/alf/csharp/unittests/bin/x64/release/net48/unittests.dll" id="5ebe42c2-19b3-1d69-c76a-16997a3ce3c8"><Execution id="0c097683-05f2-4220-aa5b-83014d724e29" /><TestMethod codeBase="/data/Active/alf/csharp/UnitTests/bin/x64/Release/net48/UnitTests.dll" adapterTypeName="executor://mstestadapter/v2" className="UnitTests.StorageTests+SQLiteInMemoryStorageTests" name="Storage_ReplaceAllAttributes_PathExist_1" /></UnitTest>
When I'm running the maven command from the agent directly it is working fine without any issues able to run the test cases, however running from the bamboo plan it is not picking any test cases, I haven't changed any directory while running from agent. I'm running it from working directory where the code is checked out
It looks like you're new here. Sign in or register to get started.