Fix EntityXmlAssertTest test-count inflation and its masked servicetests dependency - #1627
Merged
ashishvijaywargiya merged 1 commit intoAug 11, 2026
Conversation
…sts dependency EntityXmlAssertTest.countTestCases() returned the number of entity records in the referenced XML file instead of 1, inflating the 'tests' total in JUnit XML/HTML reports (e.g. scrumtests reported 478 tests but only ever ran 41). Now returns 1, matching ServiceTest and SimpleMethodTest. That method's implementation called EntitySaxReader.parse(), which performs real inserts via delegator.storeAll() - not just a count. Since JUnit 3's TestResult.startTest() calls countTestCases() right before every test runs, this was a load side effect masking a missing action="load" on servicetests.xml's load-data-service-permission-tests case (it defaulted to action="assert" and only ever passed because countTestCases() accidentally loaded its own fixture data first). Added the missing action="load" so the load is explicit. Verified with a fresh cleanAll loadAll + test + testIntegration run: 650 tests, 0 failures, 0 errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
EntityXmlAssertTest.countTestCases()returned the number of<entity>records in the referenced XML file instead of1. JUnit 3'sTestResult.startTest()adds this into the suite's run count on every test start, so theteststotal reported in the JUnit XML/HTML report ends up inflated by the size of the referenced data file rather than reflecting the number of test cases actually run - e.g.scrumtestsreportedtests="478"while only 41<testcase>elements were ever written.Fix
countTestCases()now returns1, matchingServiceTestandSimpleMethodTest.That method's old implementation called
EntitySaxReader.parse(), which performs real inserts viadelegator.storeAll()- it wasn't just counting. SinceTestResult.startTest()callscountTestCases()right before every test runs, this had become a load side effect that was masking a missingaction="load"onservicetests.xml'sload-data-service-permission-testscase: that case had noactionattribute, so it silently defaulted toaction="assert", and only ever passed becausecountTestCases()had accidentally already loaded its own fixture data first. Added the explicitaction="load"so the load no longer depends on that side effect.Checked the rest of the codebase for other
<entity-xml>elements missingaction=; this was the only one.Verification
Fresh
cleanAll loadAll+test+testIntegrationrun: 650 integration tests / 0 failures / 0 errors, 599 unit tests / 0 failures.