Skip to content

Commit

Permalink
Support allow empty junit results (#40)
Browse files Browse the repository at this point in the history
* Support allow empty archive

* Support allow empty junit results

---------

Co-authored-by: Caleb Reder <rede0060@d.umn.edu>
  • Loading branch information
c42-arthur and reder9 authored Aug 10, 2023
1 parent 73dd6dd commit c24e3a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import com.code42.jenkins.pipelinekt.dsl.DslContext
import com.code42.jenkins.pipelinekt.internal.step.declarative.JUnit

fun DslContext<Step>.junit(testResults: String) =
junit(testResults = testResults.strDouble(), false)

fun DslContext<Step>.junit(testResults: String, allowEmptyResults: Boolean) =
junit(testResults = testResults.strDouble())

fun DslContext<Step>.junit(testResults: Var.Literal.Str) =
add(JUnit(testResults = testResults))
add(JUnit(testResults = testResults. false))
fun DslContext<Step>.junit(testResults: Var.Literal.Str, allowEmptyResults: Boolean) =
add(JUnit(testResults = testResults. allowEmptyResults=allowEmptyResults))
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.code42.jenkins.pipelinekt.core.step.SingletonStep
import com.code42.jenkins.pipelinekt.core.vars.Var
import com.code42.jenkins.pipelinekt.core.writer.GroovyWriter

data class JUnit(val testResults: Var.Literal.Str) : DeclarativeStep, SingletonStep {
data class JUnit(val testResults: Var.Literal.Str, val allowEmptyResults: Boolean = false) : DeclarativeStep, SingletonStep {
override fun toGroovy(writer: GroovyWriter) {
writer.writeln("junit ${testResults.toGroovy()}")
writer.writeln("junit ${testResults.toGroovy()}, allowEmptyResults: $allowEmptyResults")
}
}
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.3
0.20.0

0 comments on commit c24e3a2

Please sign in to comment.