net.nemerosa.ontrack.kdsl.spec.extension.general.TestSummaryValidationExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-kdsl Show documentation
Show all versions of ontrack-kdsl Show documentation
Ontrack module: ontrack-kdsl
package net.nemerosa.ontrack.kdsl.spec.extension.general
import com.apollographql.apollo.api.Input
import net.nemerosa.ontrack.kdsl.connector.graphql.convert
import net.nemerosa.ontrack.kdsl.connector.graphql.schema.ValidateWithTestSummaryMutation
import net.nemerosa.ontrack.kdsl.connector.graphqlConnector
import net.nemerosa.ontrack.kdsl.spec.Build
fun Build.validateWithTestSummary(
validation: String,
description: String = "",
status: String? = null,
testSummary: TestSummary,
) {
graphqlConnector.mutate(
ValidateWithTestSummaryMutation(
id.toInt(),
Input.fromNullable(description),
validation,
Input.fromNullable(status),
testSummary.passed,
testSummary.skipped,
testSummary.failed,
)
) {
it?.validateBuildByIdWithTests()?.fragments()?.payloadUserErrors()?.convert()
}
}
data class TestSummary(
val passed: Int,
val skipped: Int,
val failed: Int,
)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy