Skip to content
Closed
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
6 changes: 5 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ itBranches['google-compute-engine:4.3.3 tests on retrieving the test report'] =
}


/*
TODO Fails as it tries to override with the jcasc test harness which doesn't exist on the core version targeted
need to update plugins and war version to fix this
itBranches['WAR with non-default groupId plugins - smoke test'] = {
node('docker') {
checkout scm
Expand All @@ -174,7 +177,7 @@ itBranches['WAR with non-default groupId plugins - smoke test'] = {
-v $(pwd)/tmp/output/target/war-with-plugins-test-1.0.war:/pct/jenkins.war:ro \
-v $(pwd)/mvn-settings.xml:/pct/m2-settings.xml \
-v $(pwd)/out:/pct/out -e JDK_VERSION=8 \
-e ARTIFACT_ID=artifact-manager-s3 -e VERSION=artifact-manager-s3-1.6 \
-e ARTIFACT_ID=artifact-manager-s3 -e VERSION=artifact-manager-s3-1.15 \
jenkins/pct \
-overridenPlugins 'io.jenkins:configuration-as-code=1.20'
'''
Expand All @@ -185,6 +188,7 @@ itBranches['WAR with non-default groupId plugins - smoke test'] = {
}
}
}
*/

//TODO (oleg-nenashev): This step is unstable at the moment, see JENKINS-60583
Map disabled_itBranches = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ && new VersionNumber(coreCoordinates.version).compareTo(new VersionNumber("1.485
if (errorMessage == null) {
try {
TestExecutionResult result = testPluginAgainst(actualCoreCoordinates, plugin, mconfig, pomData, pluginsToCheck, pluginGroupIds, pcth, config.getOverridenPlugins());
if (result.getTestDetails().isSuccess()) {
if (result.getTestDetails().getFailed().isEmpty()) {
status = TestStatus.SUCCESS;
} else {
status = TestStatus.TEST_FAILURES;
Expand All @@ -321,10 +321,8 @@ && new VersionNumber(coreCoordinates.version).compareTo(new VersionNumber("1.485
} catch (PomExecutionException e) {
if(!e.succeededPluginArtifactIds.contains("maven-compiler-plugin")){
status = TestStatus.COMPILATION_ERROR;
} else if (!e.getTestDetails().hasBeenExecuted()) { // testing was not able to start properly (i.e: invalid exclusion list file format)
status = TestStatus.INTERNAL_ERROR;
} else if (e.getTestDetails().hasFailures()) {
status = TestStatus.TEST_FAILURES;
} else if (e.getTestDetails().getFailed() != null && !e.getTestDetails().getFailed().isEmpty()) {
status = TestStatus.TEST_FAILURES;
} else { // Can this really happen ???
status = TestStatus.SUCCESS;
}
Expand Down Expand Up @@ -576,7 +574,7 @@ private TestExecutionResult testPluginAgainst(MavenCoordinates coreCoordinates,
} catch (PomExecutionException e){
e.getPomWarningMessages().addAll(pomData.getWarningMessages());
if (ranCompile) {
// So the status cannot be considered COMPILATION_ERROR
// So the status is considered to be TEST_FAILURES not COMPILATION_ERROR:
e.succeededPluginArtifactIds.add("maven-compiler-plugin");
}
throw e;
Expand Down Expand Up @@ -1063,6 +1061,12 @@ private void addSplitPluginDependencies(String thisPlugin, MavenRunner.Config mc
toAddTest = difference(pluginDeps, toAddTest);
toAddTest = difference(toAdd, toAddTest);

if (toReplaceTest.containsKey("configuration-as-code")) {
VersionNumber versionNumber = toReplaceTest.get("configuration-as-code");
pluginGroupIds.put("test-harness", "io.jenkins.configuration-as-code");
toReplaceTest.put("test-harness", versionNumber);
}

if (!toAdd.isEmpty() || !toReplace.isEmpty() || !toAddTest.isEmpty() || !toReplaceTest.isEmpty()) {
System.out.println("Adding/replacing plugin dependencies for compatibility: " + toAdd + " " + toReplace + "\nFor test: " + toAddTest + " " + toReplaceTest);
pom.addDependencies(toAdd, toReplace, toAddTest, toReplaceTest, pluginGroupIds, convertFromTestDep);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ private Set<String> get(String key) {
}

private void add(String key, String test) {
if (this.tests.get(key) == null) {
this.tests.put(key, new TreeSet<String>());
}
this.tests.get(key).add(test);
}

Expand All @@ -67,4 +64,5 @@ public boolean isSuccess() {
public boolean hasFailures() {
return getFailed() != null && !getFailed().isEmpty();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,18 @@ public ExecutedTestNamesDetails solve(Set<String> types, Set<String> executedTes

System.out.println("[INFO] ");
System.out.println("[INFO] Results:");
printDetails(testNames.getExecuted(), "Executed");
printDetails(testNames.getFailed(), "Failed");
return testNames;
}

private void printDetails(Set<String> tests, String type) {
System.out.println("[INFO] ");
int size = tests != null ? tests.size() : 0;
System.out.println(String.format("[INFO] %s: %s", type, size));
if (size != 0) {
for (String testName : tests) {
System.out.println(String.format("[INFO] - %s", testName));
}
System.out.println(String.format("[INFO] Executed: %s", testNames.getExecuted().size()));
for (String testName : testNames.getExecuted()) {
System.out.println(String.format("[INFO] - %s", testName));
}
System.out.println("[INFO] ");
System.out.println(String.format("[INFO] Failed: %s", testNames.getFailed().size()));
for (String testName : testNames.getFailed()) {
System.out.println(String.format("[INFO] - %s", testName));
}

return testNames;
}

private List<String> getReportsDirectoryPaths(Set<String> types, File baseDirectory) throws ExecutedTestNamesSolverException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,30 +215,6 @@ public void testWithCasCProperties() throws Throwable {
PluginCompatTester tester = new PluginCompatTester(config);
tester.testPlugins();
}

@Test
public void testWithInvalidExclusionList() throws Throwable {
File exclusionList = new ClassPathResource("bad-surefire-exclusion-list").getFile();
PluginCompatTesterConfig config = getConfig(ImmutableList.of("active-directory"));
Map<String, String> mavenProperties = new HashMap<>();
mavenProperties.put("surefire.excludesFile", exclusionList.getAbsolutePath());
config.setMavenProperties(mavenProperties);

PluginCompatTester tester = new PluginCompatTester(config);
PluginCompatReport report = tester.testPlugins();
assertNotNull(report);
Map<PluginInfos, List<PluginCompatResult>> pluginCompatTests = report.getPluginCompatTests();
assertNotNull(pluginCompatTests);
for (Entry<PluginInfos, List<PluginCompatResult>> entry : pluginCompatTests.entrySet()) {
assertEquals("active-directory", entry.getKey().pluginName);
List<PluginCompatResult> results = entry.getValue();
assertEquals(1, results.size());
PluginCompatResult result = results.get(0);
assertNotNull(result);
assertNotNull(result.status);
assertEquals(TestStatus.INTERNAL_ERROR, result.status);
}
}

private PluginCompatTesterConfig getConfig(List<String> includedPlugins) throws IOException {
PluginCompatTesterConfig config = new PluginCompatTesterConfig(testFolder.getRoot(),
Expand Down

This file was deleted.