Skip to content

Commit f91c001

Browse files
committed
Remove non-sdk code from coverage calculation
Coverage should not include * external embedded code * compiled SDK clients * test code * code copied from other repos (execution engine)
1 parent 2f93d03 commit f91c001

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

build.xml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -360,30 +360,35 @@ $JAVA_HOME/bin/java -cp ${lib.classpath}:${jar.absolute.path} us.kbase.tools.Wor
360360
</fileset>
361361
</batchtest>
362362
</junit>
363-
</jacoco:coverage>
363+
</jacoco:coverage>
364364
<fail message="Test failure detected, check test results." if="test.failed" />
365-
<jacoco:report>
366-
<executiondata>
367-
<file file="${report.dir}/jacoco.exec"/>
368-
</executiondata>
369-
<structure name="SDK">
370-
<classfiles>
371-
<fileset dir="${report.dir}/classes">
372-
<exclude name="**/test/**/**Test.class" />
373-
</fileset>
374-
</classfiles>
375-
<sourcefiles encoding="UTF-8">
376-
<fileset dir="${src}"/>
377-
</sourcefiles>
378-
</structure>
379-
<html destdir="${report.dir}/html"/>
380-
<csv destfile="${report.dir}/coverage-report.csv"/>
381-
<xml destfile="${report.dir}/coverage-report.xml"/>
382-
</jacoco:report>
365+
<jacoco:report>
366+
<executiondata>
367+
<file file="${report.dir}/jacoco.exec"/>
368+
</executiondata>
369+
<structure name="SDK">
370+
<classfiles>
371+
<fileset dir="${report.dir}/classes">
372+
<exclude name="**/test/**"/>
373+
<exclude name="**/fraser/neil/**"/>
374+
<exclude name="**/common/executionengine/**"/>
375+
<exclude name="**/catalog/**"/>
376+
<exclude name="**/narrativemethodstore/**"/>
377+
<exclude name="**/kbasejobservice/**"/>
378+
</fileset>
379+
</classfiles>
380+
<sourcefiles encoding="UTF-8">
381+
<fileset dir="${src}"/>
382+
</sourcefiles>
383+
</structure>
384+
<html destdir="${report.dir}/html"/>
385+
<csv destfile="${report.dir}/coverage-report.csv"/>
386+
<xml destfile="${report.dir}/coverage-report.xml"/>
387+
</jacoco:report>
383388
<delete dir="${report.dir}/classes"/>
384-
<exec executable="bash">
385-
<arg value="./test_scripts/print_test_coverage.sh" />
386-
</exec>
389+
<exec executable="bash">
390+
<arg value="./test_scripts/print_test_coverage.sh" />
391+
</exec>
387392
</target>
388393

389394

src/java/us/kbase/mobu/runner/ModuleRunner.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ public void logNextLine(String line, boolean isError) {
252252
File outputTmpFile = new File(workDir, "output.json");
253253
if (!outputTmpFile.exists())
254254
throw new IllegalStateException("Output JSON file was not found");
255+
// TODO CODE this should use a compiled client FJP
256+
// actually why is FJP used here at all?
255257
FinishJobParams outObj = UObject.getMapper().readValue(outputTmpFile,
256258
FinishJobParams.class);
257259
if (outObj.getError() != null || outObj.getResult() == null) {

src/java/us/kbase/test/sdk/scripts/TypeGeneratorTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,8 @@ public void testDynamicClients() throws Exception {
556556
}
557557

558558
private Server startJobService(File binDir, File tempDir) throws Exception {
559+
// TODO TEST this is older than EE2. Figure out what it's used for and see if changes
560+
// are needed.
559561
Server jettyServer = new Server(findFreePort());
560562
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
561563
context.setContextPath("/");

0 commit comments

Comments
 (0)