aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/taskqueue
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-08 19:30:14 +0900
committernsfisis <nsfisis@gmail.com>2024-08-08 19:30:14 +0900
commit113c83b19acc58fbd46e8acdac67ff1a112d0d8c (patch)
treed8f15d4081132d6cfff3ea3b02f197b2d6bad700 /backend/taskqueue
parent716455fedda82300251c8bcec50c526cf5bccd71 (diff)
downloadiosdc-japan-2025-albatross-113c83b19acc58fbd46e8acdac67ff1a112d0d8c.tar.gz
iosdc-japan-2025-albatross-113c83b19acc58fbd46e8acdac67ff1a112d0d8c.tar.zst
iosdc-japan-2025-albatross-113c83b19acc58fbd46e8acdac67ff1a112d0d8c.zip
fix(backend): fix an issue where stdout and stderr of testcase results are discarded
Diffstat (limited to 'backend/taskqueue')
-rw-r--r--backend/taskqueue/processor.go21
1 files changed, 6 insertions, 15 deletions
diff --git a/backend/taskqueue/processor.go b/backend/taskqueue/processor.go
index ba35a1b..b64b01c 100644
--- a/backend/taskqueue/processor.go
+++ b/backend/taskqueue/processor.go
@@ -42,10 +42,9 @@ func (p *processor) doProcessTaskCreateSubmissionRecord(
}
func (p *processor) doProcessTaskCompileSwiftToWasm(
- ctx context.Context,
+ _ context.Context,
payload *TaskPayloadCompileSwiftToWasm,
) (*TaskResultCompileSwiftToWasm, error) {
- _ = ctx
type swiftcRequestData struct {
MaxDuration int `json:"max_duration_ms"`
Code string `json:"code"`
@@ -80,10 +79,9 @@ func (p *processor) doProcessTaskCompileSwiftToWasm(
}
func (p *processor) doProcessTaskCompileWasmToNativeExecutable(
- ctx context.Context,
+ _ context.Context,
payload *TaskPayloadCompileWasmToNativeExecutable,
) (*TaskResultCompileWasmToNativeExecutable, error) {
- _ = ctx
type wasmcRequestData struct {
MaxDuration int `json:"max_duration_ms"`
Code string `json:"code"`
@@ -118,7 +116,7 @@ func (p *processor) doProcessTaskCompileWasmToNativeExecutable(
}
func (p *processor) doProcessTaskRunTestcase(
- ctx context.Context,
+ _ context.Context,
payload *TaskPayloadRunTestcase,
) (*TaskResultRunTestcase, error) {
type testrunRequestData struct {
@@ -148,17 +146,10 @@ func (p *processor) doProcessTaskRunTestcase(
if err := json.NewDecoder(res.Body).Decode(&resData); err != nil {
return nil, fmt.Errorf("json.Decode failed: %v", err)
}
- if resData.Status != "success" {
- return &TaskResultRunTestcase{
- TaskPayload: payload,
- Status: resData.Status,
- Stdout: resData.Stdout,
- Stderr: resData.Stderr,
- }, nil
- }
-
return &TaskResultRunTestcase{
TaskPayload: payload,
- Status: "success",
+ Status: resData.Status,
+ Stdout: resData.Stdout,
+ Stderr: resData.Stderr,
}, nil
}