feat: start on a blank container — spawn with empty:true and no repo (skip clone, default worker image); Spawn UI enables blank spawn without repo selection
This commit is contained in:
@@ -682,3 +682,20 @@ func TestRenameAndSetModelBodyValidation(t *testing.T) {
|
||||
t.Fatalf("bad model body = %d, want 400", code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAPISpawnBlankContainerNoRepo(t *testing.T) {
|
||||
ts, _ := newSpawnAPIServer(t)
|
||||
|
||||
// no repo and not empty → 400
|
||||
if code, body := apiReq(t, http.MethodPost, ts.URL+"/api/spawn", testToken, `{"repo":""}`); code != http.StatusBadRequest {
|
||||
t.Fatalf("no-repo non-empty spawn = %d %s, want 400", code, body)
|
||||
}
|
||||
// blank container: no repo required
|
||||
code, body := apiReq(t, http.MethodPost, ts.URL+"/api/spawn", testToken, `{"empty":true}`)
|
||||
if code != http.StatusCreated {
|
||||
t.Fatalf("blank spawn = %d %s, want 201", code, body)
|
||||
}
|
||||
if !strings.Contains(body, `"sessionId"`) {
|
||||
t.Fatalf("blank spawn body = %s, want sessionId", body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user