Skip to content

Commit

Permalink
JENKINS-27596: Support the creation of test suites on test result import
Browse files Browse the repository at this point in the history
  • Loading branch information
stolp committed Mar 25, 2015
1 parent 6048cb4 commit b5c4a2e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Expand Up @@ -108,6 +108,9 @@ public class KlarosTestResultPublisher extends Recorder implements Serializable
/** The password used to authenticate with Klaros. */
private String password;

/** The create test suite flag. */
private boolean createTestSuite;

/**
* Instantiates a new Klaros test result publisher.
*
Expand All @@ -123,13 +126,14 @@ public class KlarosTestResultPublisher extends Recorder implements Serializable
*/
@DataBoundConstructor
public KlarosTestResultPublisher(final String config, final String env,
final String sut, final String type, final String pathTestResults,
final String sut, final boolean createTestSuite, final String type, final String pathTestResults,
final ResultSet[] resultSets, final String url, final String username,
final String password) {

this.config = config;
this.env = env;
this.sut = sut;
this.createTestSuite = createTestSuite;
this.pathTestResults = pathTestResults;
this.resultSets = resultSets;
// Migrate old settings
Expand Down Expand Up @@ -273,6 +277,16 @@ public void setSut(final String value) {
sut = StringUtils.trim(value);
}

public boolean isCreateTestSuite() {

return createTestSuite;
}

public void setCreateTestSuite(boolean createTestSuite) {

this.createTestSuite = createTestSuite;
}

/**
* Gets the path test results.
*
Expand Down Expand Up @@ -534,6 +548,9 @@ public List<Integer> invoke(final File baseDir, final VirtualChannel channel)
StringBuffer query = new StringBuffer("config=").append(config)
.append("&env=").append(env).append("&sut=").append(sut)
.append("&type=").append(type);
if (createTestSuite) {
query.append("&createTestSuiteResults=true");
}
if (username != null && !username.equals("")) {
query.append("&username=").append(username).append("&password=")
.append(password);
Expand Down
Expand Up @@ -76,6 +76,10 @@
<f:textbox field="sut" />
</f:entry>

<f:entry title="${%CreateTestSuite}">
<f:checkbox field="createTestSuite" />
</f:entry>

<f:entry title="${%TestResults}" name="resultSets"
description="${%ReportDescription('http://ant.apache.org/manual/Types/fileset.html')}">
<f:repeatable var="resultSet" items="${instance.resultSets}" name="resultSets" minimum="1" noAddButton="false">
Expand Down
Expand Up @@ -25,6 +25,7 @@ KlarosInstallationDescription=At least one installation must be defined in the g
ProjectID=Project ID
TestEnvironmentID=Test Environment ID
SystemUnderTestID=System Under Test (SUT) ID
CreateTestSuite=Create a test suite per result file
TestResultSpec=Path
TestResults=Test Results
UseAuthentication=Use Authentication
Expand Down
Expand Up @@ -25,6 +25,7 @@ KlarosInstallationDescription=Mindestens eine Serverinstallation muss in der glo
ProjectID=Projekt-ID
TestEnvironmentID=Testumgebungs-ID
SystemUnderTestID=SUT-ID
CreateTestSuite=Erzeuge pro Ergebnisdatei eine Testsuites
TestResultSpec=Pfad
TestResults=Testergebnisse
UseAuthentication=Authentifizierung benutzen
Expand Down

0 comments on commit b5c4a2e

Please sign in to comment.