aboutsummaryrefslogtreecommitdiffstats
path: root/syz-ci/manager_test.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-03-28 11:39:23 +0100
committerTaras Madan <tarasmadan@google.com>2025-03-28 15:20:59 +0000
commit07ea4fca959f0151610c4eecc290d733afaedbfc (patch)
tree5c6da3aa450197fc893bc6cdb515e0b0e2f01dab /syz-ci/manager_test.go
parent9a1a9e31e8173e9a1cd291188d1e60ad2b0ec49c (diff)
syz-ci/manager: upload programs coverage to the same file
Diffstat (limited to 'syz-ci/manager_test.go')
-rw-r--r--syz-ci/manager_test.go28
1 files changed, 16 insertions, 12 deletions
diff --git a/syz-ci/manager_test.go b/syz-ci/manager_test.go
index 42282711d..9fd980ed2 100644
--- a/syz-ci/manager_test.go
+++ b/syz-ci/manager_test.go
@@ -13,7 +13,6 @@ import (
"net/http/httptest"
"strings"
"testing"
- "time"
"github.com/google/syzkaller/dashboard/dashapi"
"github.com/google/syzkaller/pkg/cover"
@@ -122,8 +121,8 @@ func TestUploadCoverJSONLToGCS(t *testing.T) {
tests := []struct {
name string
- inputJSONL string
- inputTime time.Time
+ inputJSONL string
+ inputNameSuffix string
inputCompress bool
inputPublish bool
@@ -137,33 +136,37 @@ func TestUploadCoverJSONLToGCS(t *testing.T) {
{
name: "upload single object",
inputJSONL: "{}",
- inputTime: time.Time{},
- wantGCSFileName: "test-bucket/test-namespace/mgr-name-0001-01-01-0-0.jsonl",
+ wantGCSFileName: "test-bucket/test-namespace/mgr-name.jsonl",
wantGCSFileContent: "{}\n",
},
{
name: "upload single object, compress",
inputJSONL: "{}",
- inputTime: time.Time{},
inputCompress: true,
- wantGCSFileName: "test-bucket/test-namespace/mgr-name-0001-01-01-0-0.jsonl",
+ wantGCSFileName: "test-bucket/test-namespace/mgr-name.jsonl",
wantGCSFileContent: "{}\n",
wantCompressed: true,
},
{
name: "upload single object, publish",
inputJSONL: "{}",
- inputTime: time.Time{},
inputPublish: true,
- wantGCSFileName: "test-bucket/test-namespace/mgr-name-0001-01-01-0-0.jsonl",
+ wantGCSFileName: "test-bucket/test-namespace/mgr-name.jsonl",
wantGCSFileContent: "{}\n",
wantPublish: true,
},
{
+ name: "upload single object, unique name",
+ inputJSONL: "{}",
+ inputNameSuffix: "-suffix",
+ wantGCSFileName: "test-bucket/test-namespace/mgr-name-suffix.jsonl",
+ wantGCSFileContent: "{}\n",
+ },
+
+ {
name: "upload single object, error",
inputJSONL: "{",
- inputTime: time.Time{},
- wantGCSFileName: "test-bucket/test-namespace/mgr-name-0001-01-01-0-0.jsonl",
+ wantGCSFileName: "test-bucket/test-namespace/mgr-name.jsonl",
wantError: "callback: cover.ProgramCoverage: unexpected EOF",
},
}
@@ -200,7 +203,8 @@ func TestUploadCoverJSONLToGCS(t *testing.T) {
err := mgr.uploadCoverJSONLToGCS(gcsMock,
"/teststream&jsonl=1",
"gs://test-bucket",
- time.Time{}, test.inputPublish, test.inputCompress, func(w io.Writer, dec *json.Decoder) error {
+ test.inputNameSuffix,
+ test.inputPublish, test.inputCompress, func(w io.Writer, dec *json.Decoder) error {
var v any
if err := dec.Decode(&v); err != nil {
return fmt.Errorf("cover.ProgramCoverage: %w", err)