Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-14692

Append the testsuite names to the test report in Junit

    • Icon: Bug Bug
    • Resolution: Low Engagement
    • Icon: Low Low
    • None
    • None
    • Tests

      When XML report file is analyzed by the parsers, we're not expecting to get duplicate testcases and then a new occurence of a testcase with the same classname+name, Bamboo ignores the second occurrence. Now the problem comes when in some rear cases the classname /name appear in different testsuites.

      Perhaps we could implement the parsers in such a way to prefix the test cases with the testsuite names so that we don`t ignore dupes from different testsuites

            [BAM-14692] Append the testsuite names to the test report in Junit

            Ishwinder Kaur added a comment -
            Atlassian Update - 9 April 2025

            Hi,

            At Atlassian, our goal is to ensure we’re providing the best experience for our customers. With our new Data Center strategy, Atlassian's focus is on security, compliance, and performance and is a key driver in prioritizing bugs. Closing the bugs that do not fall into those categories will allow us to focus on the ones in the most current versions of our products.

            This bug is being closed due to a lack of engagement in the last four years, including no new watchers, votes, or comments; this inactivity suggests a low impact.

            Please note the comments on this thread are not being monitored.

            You can read more about our bug fix policy here and how we prioritize bugs.

            To learn more about our recent investments in Bamboo Data Center, please check our public roadmap.

            Kind regards,
            Bamboo Data Center

            Ishwinder Kaur added a comment - Atlassian Update - 9 April 2025 Hi, At Atlassian, our goal is to ensure we’re providing the best experience for our customers. With our new Data Center strategy, Atlassian's focus is on security, compliance, and performance and is a key driver in prioritizing bugs. Closing the bugs that do not fall into those categories will allow us to focus on the ones in the most current versions of our products. This bug is being closed due to a lack of engagement in the last four years , including no new watchers, votes, or comments; this inactivity suggests a low impact. Please note the comments on this thread are not being monitored. You can read more about our bug fix policy here and how we prioritize bugs. To learn more about our recent investments in Bamboo Data Center, please check our public roadmap . Kind regards, Bamboo Data Center

            I have made a small python script that prepends the nearest testsuiteName to the testcase name. Feel free to copy.

            #!/usr/bin/python
            
            import sys
            
            inFilename = sys.argv[1]
            outFilename = "fix_" + inFilename
            print("Processing " + inFilename + ", saving to: " + outFilename)
            
            with open(inFilename) as inFile, open(outFilename, 'w') as outFile:
            	testSuite = ""
            	for line in inFile:
            		parsedLine = line
            		if line.lstrip().startswith("<testsuite"):
            			startIndex = line.index("name=\"") + 6
            			endIndex = line.index("\"", startIndex)
            			testSuite = line[startIndex:endIndex]
            			print(testSuite + ":")
            		if line.lstrip().startswith("<testcase"):
            			tokens = line.partition("name=\"")
            			parsedLine = tokens[0] + tokens [1] + testSuite + " / " + tokens[2]
            			print("\t" + tokens[2][0:tokens[2].index("\"")])
            		outFile.write(parsedLine)
            

            Jesper Jakobsen added a comment - I have made a small python script that prepends the nearest testsuiteName to the testcase name. Feel free to copy. #!/usr/bin/python import sys inFilename = sys.argv[1] outFilename = "fix_" + inFilename print("Processing " + inFilename + ", saving to: " + outFilename) with open(inFilename) as inFile, open(outFilename, 'w') as outFile: testSuite = "" for line in inFile: parsedLine = line if line.lstrip().startswith("<testsuite"): startIndex = line.index("name=\"") + 6 endIndex = line.index("\"", startIndex) testSuite = line[startIndex:endIndex] print(testSuite + ":") if line.lstrip().startswith("<testcase"): tokens = line.partition("name=\"") parsedLine = tokens[0] + tokens [1] + testSuite + " / " + tokens[2] print("\t" + tokens[2][0:tokens[2].index("\"")]) outFile.write(parsedLine)

            In case it helps anyone, we have created a shell script that creates an individual copy of the test suite for each iteration, modifying the namespaces so that the test class names are unique and thus no longer seen as duplicate by Bamboo. Not an ideal workaround of course, but it solved the problem for us.

            Stefan Bird added a comment - In case it helps anyone, we have created a shell script that creates an individual copy of the test suite for each iteration, modifying the namespaces so that the test class names are unique and thus no longer seen as duplicate by Bamboo. Not an ideal workaround of course, but it solved the problem for us.

            We have the same issue, except we're using PHPUnit and invoking it multiple times (as separate tasks within the same job) with different environment variables (controlling which database our code connects to). The total number of tests shown by Bamboo is equal to a single run, not the total number of tests run, and Bamboo only reports on the status of the first run of tests.

            Stefan Bird added a comment - We have the same issue, except we're using PHPUnit and invoking it multiple times (as separate tasks within the same job) with different environment variables (controlling which database our code connects to). The total number of tests shown by Bamboo is equal to a single run, not the total number of tests run, and Bamboo only reports on the status of the first run of tests.

            The same problem exists when using a dataProvider that will loop through the same testcase multiple times with different data. The XML shows the test count correctly, while the bamboo report is much smaller.

            Daniel Deffner added a comment - The same problem exists when using a dataProvider that will loop through the same testcase multiple times with different data. The XML shows the test count correctly, while the bamboo report is much smaller.

            The same problem exists when duplicate test names exist within the same testsuite, but different testcase files.

            It's also a problem that there is no indication of the discrepancy. The XML output gives a total number of tests, and Bamboo reports a smaller number. It took us a little while to spot these missing tests. If there's a difference in what Bamboo shows for a total than what's in the XML, there should be some visual indication to users.

            Robert Currie added a comment - The same problem exists when duplicate test names exist within the same testsuite, but different testcase files. It's also a problem that there is no indication of the discrepancy. The XML output gives a total number of tests, and Bamboo reports a smaller number. It took us a little while to spot these missing tests. If there's a difference in what Bamboo shows for a total than what's in the XML, there should be some visual indication to users.

            Any updates on this issue? It's still a bug in my opinion.

            Kelly Schoenhofen added a comment - Any updates on this issue? It's still a bug in my opinion.

              Unassigned Unassigned
              smaiyaki Sultan Maiyaki (Inactive)
              Affected customers:
              24 This affects my team
              Watchers:
              21 Start watching this issue

                Created:
                Updated:
                Resolved: