Resolve base unit tests not executing and not contributing to code coverage
--------------------------------------------------------------------------- Key: OFBIZ-3662 URL: https://issues.apache.org/jira/browse/OFBIZ-3662 Project: OFBiz Issue Type: Bug Components: framework Affects Versions: SVN trunk Reporter: Bob Morley Fix For: SVN trunk When you run the suite of tests from the ofbiz home folder, the base unit tests do not execute and there is some confusion as to if their code coverage metrics are being properly reflected. My investigation has determined that there does not appear to be an issue with the two classpaths and them "stomping on the code coverage metrics". What I found was that because the TestContainer expects all components to be loaded creating a ContainerConfig for each, "base" was not being executed (as it was only manually referenced via Start). The manual reference in Start would set the classpath entries, but would not allow the base component to have any other goodies like entitydef, servicedef, or testdef artifacts. Once you have this component loading like the rest, the second problem was that the basetests.xml file (its testdef) had further problems in it. Two of the junit-test-suites had trailing ".java" in the classname, one had a typo, and the JSONTests was not referenced. My simple solution (requires review) is to add the "base" component into component-load.xml which solves issue #1 and fix-up the problems for #2. I spent quite a bit of time on this; initially I thought I could get away with not instrumenting in Start at all -- this was because the component loader (once it loads base) has all the jars required and can instrument them. The trouble is that the Start's classpath that is generated includes three jars (including ofbiz-base) at the top of the classpath. The instrumenting logic actually does clean replacements of the jars it instruments at the place they are in the classpath (obviously this is smart). Trouble is you end up with a non-instrumented ofbiz-base at the top which kills your metrics. After these changes the unit tests jumped from 216 -> 285 and the overall project coveage is sitting at around 18%. Base specifically has quite good coverage, but the application/specialpurpose are really lacking. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-3662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bob Morley updated OFBIZ-3662: ------------------------------ Attachment: OFBIZ-3662_ResolveBaseUnitTestsAndCoverage.patch > Resolve base unit tests not executing and not contributing to code coverage > --------------------------------------------------------------------------- > > Key: OFBIZ-3662 > URL: https://issues.apache.org/jira/browse/OFBIZ-3662 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Bob Morley > Fix For: SVN trunk > > Attachments: OFBIZ-3662_ResolveBaseUnitTestsAndCoverage.patch > > > When you run the suite of tests from the ofbiz home folder, the base unit tests do not execute and there is some confusion as to if their code coverage metrics are being properly reflected. > My investigation has determined that there does not appear to be an issue with the two classpaths and them "stomping on the code coverage metrics". > What I found was that because the TestContainer expects all components to be loaded creating a ContainerConfig for each, "base" was not being executed (as it was only manually referenced via Start). The manual reference in Start would set the classpath entries, but would not allow the base component to have any other goodies like entitydef, servicedef, or testdef artifacts. > Once you have this component loading like the rest, the second problem was that the basetests.xml file (its testdef) had further problems in it. Two of the junit-test-suites had trailing ".java" in the classname, one had a typo, and the JSONTests was not referenced. > My simple solution (requires review) is to add the "base" component into component-load.xml which solves issue #1 and fix-up the problems for #2. > I spent quite a bit of time on this; initially I thought I could get away with not instrumenting in Start at all -- this was because the component loader (once it loads base) has all the jars required and can instrument them. The trouble is that the Start's classpath that is generated includes three jars (including ofbiz-base) at the top of the classpath. The instrumenting logic actually does clean replacements of the jars it instruments at the place they are in the classpath (obviously this is smart). Trouble is you end up with a non-instrumented ofbiz-base at the top which kills your metrics. > After these changes the unit tests jumped from 216 -> 285 and the overall project coveage is sitting at around 18%. Base specifically has quite good coverage, but the application/specialpurpose are really lacking. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |