Skip to content

Commit

Permalink
Fix compile error due to API changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jan 15, 2025
1 parent 96b3de2 commit 12d6dbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.jenkins.plugins.forensics.delta;

import java.io.Serial;
import java.util.Collection;
import java.util.Optional;

Expand Down Expand Up @@ -84,6 +85,7 @@ private DeltaCalculator createDeltaCalculator(final String path, final FilteredL
* A delta calculator for the test.
*/
private static class TestDeltaCalculator extends DeltaCalculator {
@Serial
private static final long serialVersionUID = -2091805649078555383L;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import edu.hm.hafner.util.FilteredLog;

import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import hudson.model.FreeStyleProject;
import hudson.model.Result;
Expand Down Expand Up @@ -95,10 +94,12 @@ void shouldFindNoReferenceBuildBecauseNoBuildHasBeenCompletedYet() {
@Issue("JENKINS-72015")
void shouldSkipFailedBuildsIfResultIsWorseThanRequired(final String requiredResult) {
WorkflowJob reference = createPipeline();
reference.setDefinition(new CpsFlowDefinition(
"node {\n"
+ "brokenCommand()\n"
+ " }\n", true));
reference.setDefinition(createPipelineScript(
"""
node {
brokenCommand()
}
"""));
buildWithResult(reference, Result.FAILURE);

WorkflowJob job = createPipeline();
Expand All @@ -113,7 +114,7 @@ void shouldSkipFailedBuildsIfResultIsWorseThanRequired(final String requiredResu
+ discoverReferenceJob(reference.getName(), String.format("requiredResult: '%s'", requiredResult))
+ " }\n";
}
job.setDefinition(new CpsFlowDefinition(script, true));
job.setDefinition(createPipelineScript(script));

Run<?, ?> current = buildSuccessfully(job);

Expand All @@ -127,18 +128,20 @@ void shouldSkipFailedBuildsIfResultIsWorseThanRequired(final String requiredResu
@Issue("JENKINS-73380")
void shouldOverwriteReferenceBuild() {
WorkflowJob reference = createPipeline();
reference.setDefinition(new CpsFlowDefinition(
"node {\n"
+ "echo 'Hello Job'\n"
+ " }\n", true));
reference.setDefinition(createPipelineScript(
"""
node {
echo 'Hello Job'
}
"""));
Run<?, ?> baseline = buildWithResult(reference, Result.SUCCESS);

var job = createPipeline();
var script = "node {\n"
+ discoverReferenceJob(reference.getName())
+ discoverReferenceJob(reference.getName())
+ " }\n";
job.setDefinition(new CpsFlowDefinition(script, true));
job.setDefinition(createPipelineScript(script));

Run<?, ?> current = buildSuccessfully(job);

Expand Down

0 comments on commit 12d6dbf

Please sign in to comment.