Skip to content

Commit

Permalink
fix: add mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre818181 committed Jan 13, 2025
1 parent cb2f48d commit 65b39e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type Result struct {

ExpectedOutput interface{} `json:"expectedOutput"`
ActualOutput interface{} `json:"actualOutput"`
Mode string `json:"mode"`

ExpectedError string `json:"expectedError"`
ActualError string `json:"actualError"`
Expand Down Expand Up @@ -256,7 +257,8 @@ func cancelJob(timeout int, jobIndex int) {
ActualOutput: nil,
ExpectedError: "",
ActualError: "Execution timeout exceeded",
ExecutionTime: int(time.Since(testConfig[jobIndex].StartedAt).Milliseconds() / 1000),
ExecutionTime: int(time.Since(testConfig[jobIndex].StartedAt).Milliseconds()),
Mode: *testConfig[jobIndex].Mode,
})

sendResultsToGraphQL("FAILED", nil)
Expand Down Expand Up @@ -316,6 +318,7 @@ func (h *Handler) JobDone(c *gin.Context) {
ActualOutput: actualOutput,
ExecutionTime: int(time.Since(lastTest.StartedAt).Seconds()),
Status: "FAILED",
Mode: *lastTest.Mode,
})

sendResultsToGraphQL("FAILED", nil)
Expand All @@ -333,6 +336,7 @@ func (h *Handler) JobDone(c *gin.Context) {
ActualOutput: actualOutput,
ExecutionTime: int(time.Since(lastTest.StartedAt).Seconds()),
Status: "SUCCESS",
Mode: *lastTest.Mode,
})
testConfig[currentTestPtr].Completed = true

Expand Down

0 comments on commit 65b39e3

Please sign in to comment.