Skip to content

Commit

Permalink
#52 Return status of reconciliation runs off the API
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Dec 13, 2021
1 parent 132999d commit b5a0153
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/kotlin/recce/server/api/RunApiModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ package recce.server.api
import com.fasterxml.jackson.annotation.JsonProperty
import io.micronaut.core.annotation.Introspected
import io.swagger.v3.oas.annotations.media.Schema
import recce.server.recrun.DatasetMeta
import recce.server.recrun.MatchStatus
import recce.server.recrun.RecRun
import recce.server.recrun.RecordMatchStatus
import recce.server.recrun.*
import java.time.Duration
import java.time.Instant

Expand All @@ -25,9 +22,12 @@ data class RunApiModel(
@field:Schema(description = "Time when the run started")
val createdTime: Instant,

@field:Schema(description = "Time when the run completeed")
@field:Schema(description = "Time when the run completed")
val completedTime: Instant?,

@field:Schema(description = "Status of this run")
val status: RunStatus,

@field:Schema(description = "Summary results from the run")
val summary: RunSummary?
) {
Expand All @@ -47,6 +47,7 @@ data class RunApiModel(
datasetId = run.datasetId,
createdTime = run.createdTime!!,
completedTime = run.completedTime,
status = run.status,
summary = summaryBuilder
.sourceMeta(run.sourceMeta)
.targetMeta(run.targetMeta)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private val testResults = RecRun(
createdTime = LocalDateTime.of(2021, 10, 25, 16, 16, 16).toInstant(ZoneOffset.UTC),
).apply {
completedTime = createdTime?.plusNanos(testCompletedDuration.toNanos())
status = RunStatus.Successful
updatedTime = completedTime?.plusSeconds(10)
sourceMeta = DatasetMeta(listOf(recce.server.recrun.ColMeta("test1", "String")))
targetMeta = DatasetMeta(listOf(recce.server.recrun.ColMeta("test1", "String")))
Expand Down Expand Up @@ -198,6 +199,7 @@ internal class DatasetRecRunControllerApiTest {
body("createdTime", equalTo(DateTimeFormatter.ISO_INSTANT.format(testResults.createdTime)))
body("completedTime", equalTo(DateTimeFormatter.ISO_INSTANT.format(testResults.completedTime)))
body("completedDurationSeconds", closeTo(testCompletedDuration.toSeconds().toDouble(), 0.00001))
body("status", equalTo("Successful"))
body(
"summary",
allOf(
Expand Down

0 comments on commit b5a0153

Please sign in to comment.