Skip to content

Commit

Permalink
fix: add stopped status for maestro flows
Browse files Browse the repository at this point in the history
  • Loading branch information
amanjeetsingh150 committed Sep 27, 2024
1 parent 363071c commit ab60a78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion maestro-cli/src/main/java/maestro/cli/api/ApiClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.github.michaelbull.result.map
import maestro.cli.CliError
import maestro.cli.analytics.Analytics
import maestro.cli.analytics.AnalyticsReport
import maestro.cli.model.FlowStatus
import maestro.cli.runner.resultview.AnsiResultView
import maestro.cli.util.CiUtils
import maestro.cli.util.EnvUtils
Expand Down Expand Up @@ -518,7 +519,7 @@ data class UploadStatus(

data class FlowResult(
val name: String,
val status: Status,
val status: FlowStatus,
val errors: List<String>,
val cancellationReason: CancellationReason? = null
)
Expand Down
1 change: 1 addition & 0 deletions maestro-cli/src/main/java/maestro/cli/model/FlowStatus.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enum class FlowStatus {
SUCCESS,
ERROR,
CANCELED,
STOPPED,
WARNING;

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ object TestSuiteStatusView {
FlowStatus.SUCCESS,
FlowStatus.WARNING -> Ansi.Color.GREEN
FlowStatus.ERROR -> Ansi.Color.RED
FlowStatus.STOPPED -> Ansi.Color.RED
else -> Ansi.Color.DEFAULT
}
val title = when (status) {
Expand All @@ -96,6 +97,7 @@ object TestSuiteStatusView {
FlowStatus.ERROR -> "Failed"
FlowStatus.PENDING -> "Pending"
FlowStatus.RUNNING -> "Running"
FlowStatus.STOPPED -> "Stopped"
FlowStatus.CANCELED -> when (cancellationReason) {
UploadStatus.CancellationReason.TIMEOUT -> "Timeout"
UploadStatus.CancellationReason.OVERLAPPING_BENCHMARK -> "Skipped"
Expand Down Expand Up @@ -174,7 +176,7 @@ object TestSuiteStatusView {
duration: Duration? = null
) = FlowResult(
name = name,
status = FlowStatus.from(status, ),
status = status,
error = errors.firstOrNull(),
cancellationReason = cancellationReason,
duration = duration
Expand Down

0 comments on commit ab60a78

Please sign in to comment.