Skip to content

Commit

Permalink
Fix opt-in for Maven Failsafe plugin (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Feb 24, 2023
1 parent d9d5930 commit 2f6e034
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.jenkins.tools.test.hook;

import java.util.Map;
import java.util.Set;
import org.jenkins.tools.test.model.PomData;

/**
* Custom execution hook for plugins whose parent is {@code org.jvnet.hudson.plugins:analysis-pom}.
* These plugins use Maven Failsafe Plugin in their test suites.
*/
public class AnalysisPomExecutionHook extends PluginWithFailsafeIntegrationTestsHook {

private static final Set<String> ARTIFACT_IDS =
Set.of(
"analysis-model-api",
"bootstrap5-api",
"checks-api",
"echarts-api",
"font-awesome-api",
"forensics-api",
"jquery3-api",
"plugin-util-api",
"popper2-api");

@Override
public boolean check(Map<String, Object> info) {
PomData data = (PomData) info.get("pomData");
return "io.jenkins.plugins".equals(data.groupId)
&& ARTIFACT_IDS.contains(data.artifactId)
&& "hpi".equals(data.getPackaging());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* Workaround for those plugins with integration tests since they need execute the
* failsafe:integration-test goal before execution.
*/
public class PluginWithFailsafeIntegrationTestsHook extends PluginWithIntegrationTestsHook {
public abstract class PluginWithFailsafeIntegrationTestsHook
extends PluginWithIntegrationTestsHook {

@Override
public Collection<String> getGoals() {
Expand Down

0 comments on commit 2f6e034

Please sign in to comment.