Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #100 from michbeck100/JENKINS-49823
Browse files Browse the repository at this point in the history
JENKINS-49823 - Ignore non existing class directory
  • Loading branch information
centic9 authored Sep 19, 2018
2 parents 3b9c176 + 72041e5 commit 3b8a81f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ private void loadExecutionData() throws IOException {
private IBundleCoverage analyzeStructure() throws IOException {

File classDirectory = new File(classDir.getRemote());
if (!classDirectory.exists()) {
return null;
}
final CoverageBuilder coverageBuilder = new CoverageBuilder();
final Analyzer analyzer = new Analyzer(executionDataStore,
coverageBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ public void testLoadBundleCoverageWithIncludes() throws IOException {
assertNotNull(coverage);
assertEquals(0, coverage.getClassCounter().getCoveredCount());
}


@Test
public void testLoadBundleCoverageClassDirectoryNotExists() throws IOException {
ExecutionFileLoader loader = new ExecutionFileLoader();
loader.setClassDir(new FilePath(new File("NotExisting")));
IBundleCoverage coverage = loader.loadBundleCoverage();
assertNull(coverage);
}

@Test
public void testLoadBundleWithExecFile() throws IOException {
ExecutionFileLoader loader = new ExecutionFileLoader();
Expand Down

0 comments on commit 3b8a81f

Please sign in to comment.