Skip to content

Commit

Permalink
Release 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jowerner committed Apr 22, 2022
2 parents 3a18791 + d0197db commit 2338e6b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 53 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ XLT Plugin for Jenkins

The XLT plugin for Jenkins enables you to run load tests with [XLT](https://www.xceptance.com/xlt/) as part of your Jenkins-based CI/CD processes.

For detailed installation and usage instructions, see the [XLT Jenkins Plugin How-To](https://lab.xceptance.de/releases/xlt/latest/how-to/jenkins-plugin.html) in the XLT documentation area.
For detailed installation and usage instructions, see the [XLT Jenkins Plugin How-To](https://docs.xceptance.com/xlt/load-testing/advanced/080-ci-cd/) in the XLT documentation area.

The latest prebuilt artifacts can be downloaded from [Maven Central](https://search.maven.org/artifact/com.xceptance/xlt-jenkins-plugin).
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.xceptance</groupId>
<artifactId>xlt-jenkins-plugin</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<packaging>hpi</packaging>

<name>XLT Plugin for Jenkins</name>
Expand Down Expand Up @@ -69,14 +69,14 @@
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

Expand Down
78 changes: 29 additions & 49 deletions src/main/java/com/xceptance/xlt/tools/jenkins/XltTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public class XltTask

private transient JSONObject critOutJSON;

private transient FilePath tempXltFolder;

public XltTask(final LoadTestConfiguration cfg)
{
taskConfig = cfg;
Expand Down Expand Up @@ -165,22 +167,26 @@ private FilePath getTestReportDataFile(final Run<?, ?> run)
return getBuildReportFolder(run).child("testreport.xml");
}

private FilePath getXltResultFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
private FilePath getXltResultFolder(final Run<?, ?> run, final Launcher launcher)
throws BuildNodeGoneException, IOException, InterruptedException
{
return getTemporaryXltFolder(run, launcher).child(FOLDER_NAMES.ARTIFACT_RESULT);
}

private FilePath getXltLogFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
private FilePath getXltLogFolder(final Run<?, ?> run, final Launcher launcher)
throws BuildNodeGoneException, IOException, InterruptedException
{
return getTemporaryXltFolder(run, launcher).child("log");
}

private FilePath getXltReportFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
private FilePath getXltReportFolder(final Run<?, ?> run, final Launcher launcher)
throws BuildNodeGoneException, IOException, InterruptedException
{
return getTemporaryXltFolder(run, launcher).child(FOLDER_NAMES.ARTIFACT_REPORT);
}

private FilePath getXltDiffReportFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
private FilePath getXltDiffReportFolder(final Run<?, ?> run, final Launcher launcher)
throws BuildNodeGoneException, IOException, InterruptedException
{
return getTemporaryXltFolder(run, launcher).child(FOLDER_NAMES.ARTIFACT_DIFFREPORT);
}
Expand Down Expand Up @@ -285,27 +291,27 @@ private static FilePath getTemporaryXltBaseFolder(final Run<?, ?> run, final Lau
return new FilePath(base, "tmp-xlt");
}

private FilePath getTemporaryXltProjectFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
{
return new FilePath(getTemporaryXltBaseFolder(run, launcher), run.getParent().getName());
}

private FilePath getTemporaryXltBuildFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
private FilePath getTemporaryXltFolder(final Run<?, ?> run, final Launcher launcher)
throws BuildNodeGoneException, IOException, InterruptedException
{
return new FilePath(getTemporaryXltProjectFolder(run, launcher), "" + run.getNumber());
}
if (tempXltFolder == null)
{
// ensure the base folder exists before we attempt to create a temp dir in it
final FilePath tempXltBaseFolder = getTemporaryXltBaseFolder(run, launcher);
tempXltBaseFolder.mkdirs();

private FilePath getTemporaryXltFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
{
return new FilePath(new FilePath(getTemporaryXltBuildFolder(run, launcher), taskConfig.getStepId()), "xlt");
tempXltFolder = tempXltBaseFolder.createTempDir(run.getParent().getName(), null);
}
return tempXltFolder;
}

private FilePath getXltTemplateFilePath()
{
return Helper.resolvePath(taskConfig.getXltTemplateDir());
}

private FilePath getXltBinFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
private FilePath getXltBinFolder(final Run<?, ?> run, final Launcher launcher)
throws BuildNodeGoneException, IOException, InterruptedException
{
return new FilePath(getTemporaryXltFolder(run, launcher), "bin");
}
Expand All @@ -315,7 +321,8 @@ private FilePath getXltBinFolderOnMaster()
return new FilePath(getXltTemplateFilePath(), "bin");
}

private FilePath getXltConfigFolder(final Run<?, ?> run, final Launcher launcher) throws BuildNodeGoneException
private FilePath getXltConfigFolder(final Run<?, ?> run, final Launcher launcher)
throws BuildNodeGoneException, IOException, InterruptedException
{
return new FilePath(getTemporaryXltFolder(run, launcher), "config");
}
Expand Down Expand Up @@ -513,7 +520,8 @@ protected void init()
updateConfig();
}

private void performPostTestSteps(final Run<?, ?> run, final Launcher launcher, final TaskListener listener, boolean resultsSaved, boolean reportsSaved)
private void performPostTestSteps(final Run<?, ?> run, final Launcher launcher, final TaskListener listener, boolean resultsSaved,
boolean reportsSaved)
{
// terminate Amazon's EC2 instances
if (isEC2UsageEnabled())
Expand Down Expand Up @@ -576,17 +584,10 @@ private void performPostTestSteps(final Run<?, ?> run, final Launcher launcher,
}

listener.getLogger().println("\n\n-----------------------------------------------------------------\nCleanup ...\n");
// delete any temporary directory with local XLT
// delete temporary directory with local XLT
try
{
FilePath tempProjectFolder = getTemporaryXltProjectFolder(run, launcher);
tempProjectFolder.deleteRecursive();

FilePath tempFolder = getTemporaryXltBaseFolder(run, launcher);
if (tempFolder.exists() && (tempFolder.list() == null || tempFolder.list().isEmpty()))
{
tempFolder.delete();
}
getTemporaryXltFolder(run, launcher).deleteRecursive();
}
catch (Exception e)
{
Expand Down Expand Up @@ -859,17 +860,6 @@ private FilePath getMCPropertiesFile(final FilePath workspace)
return null;
}

private void initialCleanUp(final Run<?, ?> run, final Launcher launcher, final TaskListener listener)
throws IOException, InterruptedException, BuildNodeGoneException
{
listener.getLogger()
.println("-----------------------------------------------------------------\nCleaning up project directory ...\n");

getTemporaryXltProjectFolder(run, launcher).deleteRecursive();

listener.getLogger().println("\nFinished");
}

private void copyXlt(final Run<?, ?> run, final Launcher launcher, final TaskListener listener) throws Exception
{
listener.getLogger().println("-----------------------------------------------------------------\nCopying XLT ...\n");
Expand Down Expand Up @@ -897,7 +887,7 @@ else if (!new FilePath(new FilePath(srcDir, "bin"), "mastercontroller.sh").exist
throw new Exception("No \"mastercontroller\" script found for path: " + new FilePath(srcDir, "bin").getRemote());
}

// the target directory in the project folder
// the target directory
FilePath destDir = getTemporaryXltFolder(run, launcher);
listener.getLogger().println("Target directory: " + destDir.getRemote());

Expand Down Expand Up @@ -1498,16 +1488,6 @@ public LoadTestResult perform(final Run<?, ?> run, final FilePath workspace, fin

init();

try
{
initialCleanUp(run, launcher, listener);
}
catch (Exception e)
{
listener.getLogger().println("Cleanup failed: " + e.getMessage());
LOGGER.error("Cleanup failed: ", e);
}

boolean reportsSaved = false, resultsSaved = false;
try
{
Expand Down

0 comments on commit 2338e6b

Please sign in to comment.