Skip to content
Permalink
Browse files
[JENKINS-31999] bumped Jenkins baseline version to 1.580.1
- adapted Callable/FileCallable to according MasterToSlave(File)Callable
- fixed NPE when configuring tool installations
- bumped TEST-GUIDE compatible version
  • Loading branch information
cpoenisch committed May 18, 2016
1 parent 5009823 commit 68e246d40f408a8c594662203c5e9d8fa68abf8d
Showing 23 changed files with 113 additions and 87 deletions.
77 pom.xml
@@ -79,11 +79,12 @@

<properties>
<!-- Jenkins base -->
<jenkins.version>1.565.3</jenkins.version>
<jenkins-test-harness.version>1.565.3</jenkins-test-harness.version>
<jenkins.version>1.580.1</jenkins.version>
<jenkins-test-harness.version>1.580.1</jenkins-test-harness.version>

<!-- Jenkins plugins -->
<matrix-project.version>1.4</matrix-project.version>
<junit.version>1.3</junit.version>
<job-dsl.version>1.37</job-dsl.version>

<!-- Static code analysis -->
@@ -152,6 +153,12 @@
<artifactId>matrix-project</artifactId>
<version>${matrix-project.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>job-dsl</artifactId>
@@ -262,37 +269,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.3,)
</versionRange>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@@ -314,6 +290,29 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.3,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
@@ -325,15 +324,9 @@
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<versionRange>
[2.10.1,)
</versionRange>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<versionRange>[2.10.1,)</versionRange>
<goals>
<goal>javadoc</goal>
</goals>
@@ -58,7 +58,7 @@ public class ETPlugin extends Plugin {
/**
* Defines the TEST-GUIDE version that the provided ATX configuration is based on.
*/
public static final ToolVersion ATX_VERSION = new ToolVersion(1, 29, 0, 0);
public static final ToolVersion ATX_VERSION = new ToolVersion(1, 30, 0, 0);

/**
* Helper class to easily compare tool versions defined by major, minor, micro and qualifier version. Mainly used to
@@ -41,6 +41,7 @@
import hudson.model.AbstractItem;
import hudson.model.AbstractProject;
import hudson.model.Computer;
import hudson.model.Node;
import hudson.model.Run;
import hudson.tasks.BuildStepMonitor;
import hudson.tasks.Recorder;
@@ -230,8 +231,12 @@ protected boolean canContinue(final Result result) {
protected AbstractToolInstallation configureToolInstallation(final String toolName,
final BuildListener listener, final EnvVars envVars) throws IOException, InterruptedException {
AbstractToolInstallation installation = getToolInstallation(toolName, envVars);

if (installation != null) {
installation = installation.forNode(Computer.currentComputer().getNode(), listener);
final Node node = Computer.currentComputer().getNode();
if (node != null) {
installation = installation.forNode(node, listener);
}
installation = installation.forEnvironment(envVars);
}
return installation;
@@ -58,6 +58,7 @@

import javax.annotation.CheckForNull;

import jenkins.security.MasterToSlaveCallable;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

@@ -241,7 +242,7 @@ public boolean perform(final AbstractBuild<?, ?> build, final Launcher launcher,
*/
private boolean publishReports(final ATXInstallation installation, final AbstractBuild<?, ?> build,
final Launcher launcher, final BuildListener listener)
throws IOException, InterruptedException {
throws IOException, InterruptedException {
final TTConsoleLogger logger = new TTConsoleLogger(listener);
final boolean isUploadEnabled = isUploadEnabled(installation);
final boolean isServerReachable = isServerReachable(installation, launcher, build.getEnvironment(listener));
@@ -301,7 +302,7 @@ private boolean isServerReachable(final ATXInstallation installation, final Laun
/**
* {@link Callable} providing remote access to test the TEST-GUIDE server availability.
*/
private static final class TestConnectionCallable implements Callable<Boolean, IOException> {
private static final class TestConnectionCallable extends MasterToSlaveCallable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

@@ -39,6 +39,7 @@
import java.util.List;
import java.util.Map;

import jenkins.security.MasterToSlaveCallable;
import de.tracetronic.jenkins.plugins.ecutest.report.atx.installation.ATXBooleanSetting;
import de.tracetronic.jenkins.plugins.ecutest.report.atx.installation.ATXConfig;
import de.tracetronic.jenkins.plugins.ecutest.report.atx.installation.ATXCustomBooleanSetting;
@@ -62,7 +63,7 @@ public abstract class AbstractATXReportHandler {
/**
* Common {@link Callable} enabling generating and uploading ATX reports remotely.
*/
protected abstract static class AbstractReportCallable implements Callable<Boolean, IOException> {
protected abstract static class AbstractReportCallable extends MasterToSlaveCallable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

@@ -40,6 +40,7 @@
import java.util.List;
import java.util.Map;

import jenkins.security.MasterToSlaveCallable;
import de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger;
import de.tracetronic.jenkins.plugins.ecutest.wrapper.com.ETComClient;
import de.tracetronic.jenkins.plugins.ecutest.wrapper.com.ETComException;
@@ -95,7 +96,7 @@ public boolean generate(final List<FilePath> reportFiles, final Launcher launche
/**
* {@link Callable} enabling generation of reports with specific generator remotely.
*/
private static final class GenerateReportCallable implements Callable<Boolean, IOException> {
private static final class GenerateReportCallable extends MasterToSlaveCallable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

@@ -42,6 +42,7 @@
import hudson.model.Result;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Job;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Publisher;
import hudson.tasks.junit.TestResult;
@@ -184,7 +185,7 @@ public AbstractToolInstallation getToolInstallation(final EnvVars envVars) {
public Action getProjectAction(final AbstractProject<?, ?> project) {
final TestResultProjectAction action = project.getAction(TestResultProjectAction.class);
if (action == null) {
return new TestResultProjectAction(project);
return new TestResultProjectAction((Job<?, ?>) project);
} else {
return action;
}
@@ -39,6 +39,7 @@
import java.io.IOException;
import java.util.List;

import jenkins.security.MasterToSlaveCallable;
import de.tracetronic.jenkins.plugins.ecutest.env.ToolEnvInvisibleAction;
import de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger;
import de.tracetronic.jenkins.plugins.ecutest.tool.StartETBuilder;
@@ -180,7 +181,7 @@ private String getSettingsDir(final AbstractBuild<?, ?> build) {
/**
* {@link Callable} enabling generation of UNIT reports remotely.
*/
private static final class GenerateUnitReportCallable implements Callable<Boolean, IOException> {
private static final class GenerateUnitReportCallable extends MasterToSlaveCallable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 TraceTronic GmbH
* Copyright (c) 2015-2016 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@@ -47,6 +47,7 @@
import java.util.Collections;
import java.util.List;

import jenkins.MasterToSlaveFileCallable;
import de.tracetronic.jenkins.plugins.ecutest.env.TestEnvInvisibleAction;
import de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger;

@@ -126,7 +127,7 @@ private List<FilePath> getReportFiles(final String junitDir, final AbstractBuild
/**
* {@link FileCallable} enabling remote file access to parse the JUnit report.
*/
private static final class ParseTestResultCallable implements FileCallable<TestResult> {
private static final class ParseTestResultCallable extends MasterToSlaveFileCallable<TestResult> {

private static final long serialVersionUID = 1L;

@@ -144,7 +145,7 @@ private static final class ParseTestResultCallable implements FileCallable<TestR

@Override
public TestResult invoke(final File file, final VirtualChannel channel) throws IOException,
InterruptedException {
InterruptedException {
testResult.parse(file);
return testResult;
}
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015 TraceTronic GmbH
* Copyright (c) 2015-2016 TraceTronic GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@@ -102,7 +102,7 @@ public List<ETLogAnnotation> parse() {
}
}
}
} catch (final IOException e) {
} catch (final IOException | InterruptedException e) {
LOGGER.log(Level.SEVERE,
String.format("Failed parsing log file %s: %s", logFile.getRemote(), e.getMessage()));
}
@@ -129,7 +129,7 @@ public int parseLogCount(final Severity severity) {
}
}
}
} catch (final IOException e) {
} catch (final IOException | InterruptedException e) {
LOGGER.log(Level.SEVERE,
String.format("Failed parsing log file %s: %s", logFile.getRemote(), e.getMessage()));
}
@@ -50,6 +50,8 @@
import java.util.Collections;
import java.util.List;

import jenkins.MasterToSlaveFileCallable;

import org.kohsuke.stapler.DataBoundConstructor;

import de.tracetronic.jenkins.plugins.ecutest.env.TestEnvInvisibleAction;
@@ -398,7 +400,7 @@ private int traverseReports(final List<ETLogReport> logReports, final FilePath a
*/
private int traverseSubReports(final ETLogReport logReport, final FilePath testReportDir,
final FilePath subTestReportDir, int id)
throws IOException, InterruptedException {
throws IOException, InterruptedException {
for (final FilePath subDir : subTestReportDir.listDirectories()) {
FilePath logFile = subDir.child(ERROR_LOG_NAME);
if (logFile.exists()) {
@@ -565,7 +567,7 @@ private List<FilePath> getTestSpecificLogFiles(final AbstractBuild<?, ?> build,
/**
* {@link FileCallable} providing remote file access to list included files.
*/
private static final class ListFilesCallable implements FilePath.FileCallable<List<String>> {
private static final class ListFilesCallable extends MasterToSlaveFileCallable<List<String>> {

private static final long serialVersionUID = 1;

@@ -587,7 +589,7 @@ private static final class ListFilesCallable implements FilePath.FileCallable<Li

@Override
public List<String> invoke(final File baseDir, final VirtualChannel channel) throws IOException,
InterruptedException {
InterruptedException {
final List<String> files = new ArrayList<String>();
for (final String includedFile : Util.createFileSet(baseDir, includes, excludes)
.getDirectoryScanner().getIncludedFiles()) {
@@ -41,6 +41,8 @@
import java.io.IOException;
import java.util.List;

import jenkins.security.MasterToSlaveCallable;

import org.apache.commons.lang.StringUtils;

import de.tracetronic.jenkins.plugins.ecutest.env.TestEnvInvisibleAction;
@@ -281,7 +283,7 @@ protected abstract boolean runTest(String testFile, TestConfig testConfig, Execu
* if the current thread is interrupted while waiting for the completion
*/
private boolean checkETInstance(final Launcher launcher, final boolean kill) throws IOException,
InterruptedException {
InterruptedException {
final List<String> foundProcesses = ETClient.checkProcesses(launcher, kill);
return !foundProcesses.isEmpty();
}
@@ -301,7 +303,7 @@ private boolean checkETInstance(final Launcher launcher, final boolean kill) thr
* if the current thread is interrupted while waiting for the completion
*/
private boolean closeETInstance(final Launcher launcher, final BuildListener listener) throws IOException,
InterruptedException {
InterruptedException {
final List<String> foundProcesses = ETClient.checkProcesses(launcher, false);
if (foundProcesses.isEmpty()) {
return false;
@@ -323,7 +325,7 @@ private boolean closeETInstance(final Launcher launcher, final BuildListener lis
* if the current thread is interrupted while waiting for the completion
*/
private boolean checkTSInstance(final Launcher launcher, final boolean kill) throws IOException,
InterruptedException {
InterruptedException {
final List<String> foundProcesses = TSClient.checkProcesses(launcher, kill);
return !foundProcesses.isEmpty();
}
@@ -459,7 +461,7 @@ protected String getPackagesDir(final Launcher launcher, final BuildListener lis
/**
* {@link Callable} providing remote access to get a ECU-TEST workspace setting value via COM.
*/
private static final class GetSettingCallable implements Callable<String, IOException> {
private static final class GetSettingCallable extends MasterToSlaveCallable<String, IOException> {

private static final long serialVersionUID = 1L;

@@ -41,6 +41,8 @@
import java.util.Map;
import java.util.Map.Entry;

import jenkins.security.MasterToSlaveCallable;

import org.apache.commons.lang.StringUtils;

import de.tracetronic.jenkins.plugins.ecutest.log.TTConsoleLogger;
@@ -173,7 +175,7 @@ public void setTestResult(final String testResult) {
/**
* {@link Callable} providing remote access to load configurations via COM.
*/
protected static final class LoadConfigCallable implements Callable<Boolean, IOException> {
protected static final class LoadConfigCallable extends MasterToSlaveCallable<Boolean, IOException> {

private static final long serialVersionUID = 1L;

0 comments on commit 68e246d

Please sign in to comment.