Skip to content
Permalink
Browse files

[JENKINS-28281] include option corresponding to JUnit KeepLongStdio

  • Loading branch information...
nilleb committed May 11, 2015
1 parent a9ba2b8 commit 9d875257ba61a8b143b2c4e1726f2a606cf715ad
@@ -48,17 +48,19 @@
private String resolvedFilePath;
private long buildTime;
private boolean failOnError;
private boolean keepLongStdio;
//private EmmaPublisher emmaPublisher;


public MSTestPublisher(String testResultsFile){
this(testResultsFile, true);
this(testResultsFile, true, false);
}

@DataBoundConstructor
public MSTestPublisher(String testResultsFile, boolean failOnError) {
public MSTestPublisher(String testResultsFile, boolean failOnError, boolean keepLongStdio) {
this.testResultsFile = testResultsFile;
this.failOnError = failOnError;
this.keepLongStdio = keepLongStdio;
}

public String getTestResultsTrxFile() {
@@ -241,7 +243,7 @@ public TestResult invoke(File ws, VirtualChannel channel) throws IOException {
}
}
if (existingTestResults == null) {
return new TestResult(buildTime, ds, false);
return new TestResult(buildTime, ds, keepLongStdio);
} else {
existingTestResults.parse(buildTime, ds);
return existingTestResults;
@@ -284,7 +286,11 @@ public Publisher newInstance(StaplerRequest req, JSONObject formData) throws For
if(req.getParameter("failOnError") == null || !req.getParameter("failOnError").equals("on")) {
failOnError = false;
}
return new MSTestPublisher(req.getParameter("mstest_reports.pattern"), failOnError);
boolean keepLongStdio = false;
if(req.getParameter("failOnError") == null || req.getParameter("failOnError").equals("on")) {
failOnError = true;
}
return new MSTestPublisher(req.getParameter("mstest_reports.pattern"), failOnError, keepLongStdio);
}
}
}
@@ -5,7 +5,10 @@
<f:entry title="${%Test report TRX file}" description="${%description.pattern}">
<f:textbox name="mstest_reports.pattern" value="${instance.testResultsTrxFile}" />
</f:entry>
<f:entry title="${%Fail build if no files are found}" field="failOnError" >
<f:checkbox name="failOnError" />
</f:entry>
<f:entry title="${%Fail build if no files are found}" field="failOnError" >
<f:checkbox name="failOnError" />
</f:entry>
<f:entry field="keepLongStdio" title="">
<f:checkbox name="keepLongStdio" title="${%Retain long standard output/error}"/>
</f:entry>
</j:jelly>

0 comments on commit 9d87525

Please sign in to comment.
You can’t perform that action at this time.