Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 35 additions & 29 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@
<maven.deploy.skip>false</maven.deploy.skip>

<!-- Library Dependencies Versions -->
<coverage-model.version>0.66.0</coverage-model.version>
<coverage-model.version>0.67.0</coverage-model.version>

<!-- Test Library Dependencies Versions -->
<xmlunit.version>2.11.0</xmlunit.version>
<testcontainers.version>1.21.4</testcontainers.version>
</properties>

<dependencies>
<!-- Library Dependencies -->
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>coverage-model</artifactId>
Expand Down Expand Up @@ -87,6 +88,7 @@
<artifactId>jsoup</artifactId>
</dependency>

<!-- Plugin Dependencies -->
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>ionicons-api</artifactId>
Expand All @@ -96,8 +98,6 @@
<artifactId>token-macro</artifactId>
<optional>true</optional>
</dependency>

<!-- Plugin Dependencies -->
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-multibranch</artifactId>
Expand Down Expand Up @@ -141,6 +141,7 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>7.1320.v684dd26fca_19</version>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
Expand All @@ -149,16 +150,13 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>prism-api</artifactId>
<version>1.30.0-719.v61228fb_a_ec4d</version>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>variant</artifactId>
</dependency>

<!-- Test Library Dependencies -->
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
Expand Down Expand Up @@ -191,6 +189,33 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>

<!-- Test Plugin Dependencies -->
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>7.1320.v684dd26fca_19</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
Expand Down Expand Up @@ -252,7 +277,6 @@
<artifactId>timestamper</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
Expand All @@ -263,24 +287,6 @@
<artifactId>ssh-slaves</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins</groupId>
<artifactId>configuration-as-code</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class FileWithModifiedLines {
}

@Exported(inline = true)
public String getFullyQualifiedFileName() {
String getFullyQualifiedFileName() {
return fullyQualifiedFileName;
}

@Exported(inline = true)
public SortedSet<ModifiedLinesBlock> getModifiedLinesBlocks() {
SortedSet<ModifiedLinesBlock> getModifiedLinesBlocks() {
return modifiedLinesBlocks;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ class ModifiedLinesBlock implements Comparable<ModifiedLinesBlock> {
}

@Exported
public int getStartLine() {
int getStartLine() {
return startLine;
}

@Exported
public int getEndLine() {
int getEndLine() {
return endLine;
}

@Exported
public LineCoverageType getType() {
LineCoverageType getType() {
return type;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ModifiedLinesCoverageApi {
}

@Exported(inline = true, name = "files")
public List<FileWithModifiedLines> getFilesWithModifiedLines() {
List<FileWithModifiedLines> getFilesWithModifiedLines() {
return filesWithModifiedLines;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CoverageSourcePrinter implements Serializable {
modifiedLines = new TreeSet<>(file.getModifiedLines());
}

public String renderLine(final int line, final String sourceCode) {
String renderLine(final int line, final String sourceCode) {
var isPainted = isPainted(line);
return tr()
.withClasses(isPainted ? getColorClass(line) : UNDEFINED, getModifiedClass(line))
Expand Down Expand Up @@ -79,7 +79,7 @@ String getModifiedClass(final int line) {
return isModified(line) ? MODIFIED : StringUtils.EMPTY;
}

public String getColorClass(final int line) {
String getColorClass(final int line) {
if (getCovered(line) == 0) {
return NO_COVERAGE;
}
Expand All @@ -91,7 +91,7 @@ else if (getMissed(line) == 0) {
}
}

public String getTooltip(final int line) {
String getTooltip(final int line) {
var covered = getCovered(line);
var missed = getMissed(line);
if (covered + missed > 1) {
Expand All @@ -111,7 +111,7 @@ else if (covered == 1) {
}
}

public String getSummaryColumn(final int line) {
String getSummaryColumn(final int line) {
var covered = getCovered(line);
var missed = getMissed(line);
if (covered + missed > 1) {
Expand All @@ -120,11 +120,11 @@ public String getSummaryColumn(final int line) {
return String.valueOf(covered);
}

public final String getPath() {
final String getPath() {
return path;
}

public boolean isPainted(final int line) {
boolean isPainted(final int line) {
return findIndexOfLine(line) >= 0;
}

Expand All @@ -136,11 +136,11 @@ int findIndexOfLine(final int line) {
return Arrays.binarySearch(linesToPaint, line);
}

public int getCovered(final int line) {
int getCovered(final int line) {
return getCounter(line, coveredPerLine);
}

public int getMissed(final int line) {
int getMissed(final int line) {
return getCounter(line, missedPerLine);
}

Expand All @@ -152,7 +152,7 @@ int getCounter(final int line, final int... counters) {
return 0;
}

public String getColumnHeader() {
String getColumnHeader() {
return StringUtils.EMPTY;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ private List<ContainerTag> asBulletPoints(final List<Mutation> mutations, final
.collect(Collectors.toList());
}

public int getSurvived(final int line) {
int getSurvived(final int line) {
return getCounter(line, survivedPerLine);
}

public int getKilled(final int line) {
int getKilled(final int line) {
return getCounter(line, killedPerLine);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CodeDeltaCalculator {
*
* @return the {@link Delta code delta} as Optional if existent, else an empty Optional
*/
public Optional<Delta> calculateCodeDeltaToReference(final Run<?, ?> referenceBuild, final FilteredLog log) {
Optional<Delta> calculateCodeDeltaToReference(final Run<?, ?> referenceBuild, final FilteredLog log) {
return DeltaCalculatorFactory
.findDeltaCalculator(scm, build, workspace, listener, log)
.calculateDelta(build, referenceBuild, log);
Expand All @@ -93,7 +93,7 @@ public Optional<Delta> calculateCodeDeltaToReference(final Run<?, ?> referenceBu
*
* @return the relevant code changes
*/
public Set<FileChanges> getCoverageRelevantChanges(final Delta delta) {
Set<FileChanges> getCoverageRelevantChanges(final Delta delta) {
return delta.getFileChangesMap().values().stream()
.filter(fileChange -> fileChange.getFileEditType() == FileEditType.MODIFY
|| fileChange.getFileEditType() == FileEditType.ADD
Expand All @@ -116,7 +116,7 @@ public Set<FileChanges> getCoverageRelevantChanges(final Delta delta) {
* @throws IllegalStateException
* when creating the mapping failed due to ambiguous paths
*/
public Map<String, FileChanges> mapScmChangesToReportPaths(
Map<String, FileChanges> mapScmChangesToReportPaths(
final Set<FileChanges> changes, final Node root, final FilteredLog log) throws IllegalStateException {
Set<String> reportPaths = new HashSet<>(root.getFiles());
Set<String> scmPaths = changes.stream().map(FileChanges::getFileName).collect(Collectors.toSet());
Expand Down Expand Up @@ -150,7 +150,7 @@ public Map<String, FileChanges> mapScmChangesToReportPaths(
* @throws IllegalStateException
* if the SCM path mapping is ambiguous
*/
public Map<String, String> createOldPathMapping(final Node root, final Node referenceRoot,
Map<String, String> createOldPathMapping(final Node root, final Node referenceRoot,
final Map<String, FileChanges> changes, final FilteredLog log)
throws IllegalStateException {
Set<String> oldReportPaths = new HashSet<>(referenceRoot.getFiles());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ private static CoverageAppearanceConfiguration getConfiguration(final JenkinsFac
/**
* Descriptor of the column.
*/
@Extension(optional = true)
@Symbol("coverageTotalsColumn")
@Extension @Symbol("coverageTotalsColumn")
public static class CoverageMetricColumnDescriptor extends ListViewColumnDescriptor {
private final JenkinsFacade jenkins;

Expand Down
Loading
Loading