Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Jun 19, 2024
1 parent a858502 commit 83deae2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions catalyst-uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ func run() int {
glog.Error(err)
return 1
}
vFlag := flag.Lookup("v")
fs := flag.NewFlagSet("catalyst-uploader", flag.ExitOnError)

// cmd line args
version := fs.Bool("version", false, "print application version")
describe := fs.Bool("j", false, "Describe supported storage services in JSON format and exit")
verbosity := fs.String("v", "", "Log verbosity. {4|5|6}")
timeout := fs.Duration("t", 30*time.Second, "Upload timeout")
storageBackupURLs := jsonFlag[core.StorageBackupURLs](fs, "storage-backup-urls", `JSON array of {"primary":X,"backup":Y} objects with base storage URLs. If a file fails uploading to one of the primary storages (detected by prefix), it will fallback to the corresponding backup URL after having the prefix replaced`)

Expand Down Expand Up @@ -69,6 +71,13 @@ func run() int {
return 1
}

if *verbosity != "" {
err = vFlag.Value.Set(*verbosity)
if err != nil {
glog.Fatal(err)
}
}

// replace stdout to prevent any lib from writing debug output there
stdout := os.Stdout
os.Stdout, _ = os.Open(os.DevNull)
Expand Down
2 changes: 1 addition & 1 deletion core/uploader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestItWritesSlowInputIncrementally(t *testing.T) {
go func() {
u, err := url.Parse(outputFile.Name())
require.NoError(t, err)
_, err = Upload(slowReader, u, 100*time.Millisecond, time.Second)
_, err = Upload(slowReader, u, 100*time.Millisecond, time.Second, nil)
require.NoError(t, err, "")
}()

Expand Down

0 comments on commit 83deae2

Please sign in to comment.