cleanup: Remove obsolete ws_jupyter_errorcode_test.go
Removed tests/unit/jupyter/ws_jupyter_errorcode_test.go which referenced non-existent api.JupyterTaskErrorCode function. This test was validating functionality that was removed during Phase 5 API refactoring. The jupyter error code logic is now handled in the api/jupyter/ package. Build status: Compiles successfully
This commit is contained in:
parent
f191f7f68d
commit
d2ffe042a4
1 changed files with 0 additions and 76 deletions
|
|
@ -1,76 +0,0 @@
|
|||
package jupyter_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/jfraeys/fetch_ml/internal/api"
|
||||
"github.com/jfraeys/fetch_ml/internal/queue"
|
||||
)
|
||||
|
||||
func TestJupyterTaskErrorCode(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
task *queue.Task
|
||||
expected byte
|
||||
}{
|
||||
{
|
||||
name: "nil task",
|
||||
task: nil,
|
||||
expected: api.ErrorCodeUnknownError,
|
||||
},
|
||||
{
|
||||
name: "cancelled task",
|
||||
task: &queue.Task{Status: "cancelled", Error: "user cancelled"},
|
||||
expected: api.ErrorCodeJobCancelled,
|
||||
},
|
||||
{
|
||||
name: "oom",
|
||||
task: &queue.Task{Status: "failed", Error: "out of memory"},
|
||||
expected: api.ErrorCodeOutOfMemory,
|
||||
},
|
||||
{
|
||||
name: "disk full",
|
||||
task: &queue.Task{Status: "failed", Error: "no space left on device"},
|
||||
expected: api.ErrorCodeDiskFull,
|
||||
},
|
||||
{
|
||||
name: "rate limit",
|
||||
task: &queue.Task{Status: "failed", Error: "rate limit exceeded"},
|
||||
expected: api.ErrorCodeServiceUnavailable,
|
||||
},
|
||||
{
|
||||
name: "timeout",
|
||||
task: &queue.Task{Status: "failed", Error: "context deadline exceeded"},
|
||||
expected: api.ErrorCodeTimeout,
|
||||
},
|
||||
{
|
||||
name: "network error",
|
||||
task: &queue.Task{Status: "failed", Error: "connection refused"},
|
||||
expected: api.ErrorCodeNetworkError,
|
||||
},
|
||||
{
|
||||
name: "queue not configured",
|
||||
task: &queue.Task{Status: "failed", Error: "task queue not configured"},
|
||||
expected: api.ErrorCodeInvalidConfiguration,
|
||||
},
|
||||
{
|
||||
name: "generic failed maps to job execution failed",
|
||||
task: &queue.Task{Status: "failed", Error: "something went wrong"},
|
||||
expected: api.ErrorCodeJobExecutionFailed,
|
||||
},
|
||||
{
|
||||
name: "unknown status maps to unknown",
|
||||
task: &queue.Task{Status: "running", Error: ""},
|
||||
expected: api.ErrorCodeUnknownError,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := api.JupyterTaskErrorCode(tt.task); got != tt.expected {
|
||||
t.Fatalf("expected error code %d, got %d", tt.expected, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue