Skip to content

Commit f1535a8

Browse files
authored
Support allow empty junit results (#41)
1 parent c24e3a2 commit f1535a8

File tree

3 files changed

+10
-6
lines changed
  • dsl/src/main/kotlin/com/code42/jenkins/pipelinekt/dsl/step/declarative
  • internal/src/main/kotlin/com/code42/jenkins/pipelinekt/internal/step/declarative

3 files changed

+10
-6
lines changed

dsl/src/main/kotlin/com/code42/jenkins/pipelinekt/dsl/step/declarative/JUnitDsl.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ fun DslContext<Step>.junit(testResults: String) =
1010
junit(testResults = testResults.strDouble(), false)
1111

1212
fun DslContext<Step>.junit(testResults: String, allowEmptyResults: Boolean) =
13-
junit(testResults = testResults.strDouble())
13+
junit(testResults = testResults.strDouble(), allowEmptyResults)
1414

1515
fun DslContext<Step>.junit(testResults: Var.Literal.Str) =
16-
add(JUnit(testResults = testResults. false))
16+
add(JUnit(testResults = testResults, false))
1717
fun DslContext<Step>.junit(testResults: Var.Literal.Str, allowEmptyResults: Boolean) =
18-
add(JUnit(testResults = testResults. allowEmptyResults=allowEmptyResults))
18+
add(JUnit(testResults = testResults, allowEmptyResults))

internal/src/main/kotlin/com/code42/jenkins/pipelinekt/internal/step/declarative/JUnit.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ import com.code42.jenkins.pipelinekt.core.step.SingletonStep
55
import com.code42.jenkins.pipelinekt.core.vars.Var
66
import com.code42.jenkins.pipelinekt.core.writer.GroovyWriter
77

8-
data class JUnit(val testResults: Var.Literal.Str, val allowEmptyResults: Boolean = false) : DeclarativeStep, SingletonStep {
8+
data class JUnit(
9+
val testResults: Var.Literal.Str,
10+
val allowEmptyResults: Boolean = false
11+
) : DeclarativeStep, SingletonStep {
912
override fun toGroovy(writer: GroovyWriter) {
10-
writer.writeln("junit ${testResults.toGroovy()}, allowEmptyResults: $allowEmptyResults")
13+
writer.writeln("junit ${testResults.toGroovy()}," +
14+
" allowEmptyResults: $allowEmptyResults")
1115
}
1216
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.20.0
1+
0.20.1

0 commit comments

Comments
 (0)