Skip to content

Commit

Permalink
Support allow empty junit results (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
c42-arthur authored Aug 10, 2023
1 parent c24e3a2 commit f1535a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ fun DslContext<Step>.junit(testResults: String) =
junit(testResults = testResults.strDouble(), false)

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

fun DslContext<Step>.junit(testResults: Var.Literal.Str) =
add(JUnit(testResults = testResults. false))
add(JUnit(testResults = testResults, false))
fun DslContext<Step>.junit(testResults: Var.Literal.Str, allowEmptyResults: Boolean) =
add(JUnit(testResults = testResults. allowEmptyResults=allowEmptyResults))
add(JUnit(testResults = testResults, allowEmptyResults))
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ 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, val allowEmptyResults: Boolean = false) : 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()}, allowEmptyResults: $allowEmptyResults")
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.20.0
0.20.1

0 comments on commit f1535a8

Please sign in to comment.