refactor!: separate runtime releases from panel source
This commit is contained in:
@@ -201,7 +201,7 @@ func TestBuild(t *testing.T) {
|
||||
}
|
||||
})
|
||||
var logs []string
|
||||
id, err := client.Build(context.Background(), strings.NewReader("caller tar bytes"), "1.2.3", "test:1", func(s string) { logs = append(logs, s) })
|
||||
id, err := client.BuildRelease(context.Background(), strings.NewReader("caller tar bytes"), "1.2.3", "test:1", "release", "repository", "commit", func(s string) { logs = append(logs, s) })
|
||||
if err != nil || id != "sha256:image" || len(logs) != 1 || logs[0] != "step 1\n" {
|
||||
t.Fatalf("id=%q logs=%v err=%v", id, logs, err)
|
||||
}
|
||||
@@ -219,7 +219,7 @@ func TestBuildErrors(t *testing.T) {
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
client := testClient(t, func(w http.ResponseWriter, r *http.Request) { io.WriteString(w, tc.data) })
|
||||
id, err := client.Build(context.Background(), nil, "1", "test", nil)
|
||||
id, err := client.BuildRelease(context.Background(), nil, "1", "test", "release", "repository", "commit", nil)
|
||||
if err == nil || !strings.Contains(err.Error(), tc.want) || id != "" {
|
||||
t.Fatalf("id=%q err=%v", id, err)
|
||||
}
|
||||
@@ -235,7 +235,7 @@ func TestBuildCancellation(t *testing.T) {
|
||||
})
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||
defer cancel()
|
||||
_, err := client.Build(ctx, nil, "1", "test", func(string) { cancel() })
|
||||
_, err := client.BuildRelease(ctx, nil, "1", "test", "release", "repository", "commit", func(string) { cancel() })
|
||||
if !errors.Is(err, context.Canceled) {
|
||||
t.Fatalf("err=%v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user