diff options
| author | Jonathan Amsterdam <jba@google.com> | 2024-11-13 13:06:04 -0500 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2024-11-19 17:35:05 +0000 |
| commit | 004ff0d96bc337870e1364f91d0dfe74a2d9cbc8 (patch) | |
| tree | 502072f67302a3fc755ca933d34c633d9561e543 /cmd | |
| parent | 0b3c55569e89f85ec8305472e70aef4ae8811ca6 (diff) | |
| download | go-x-website-004ff0d96bc337870e1364f91d0dfe74a2d9cbc8.tar.xz | |
cmd/screentest: rename outputURL to outputDirURL
Change-Id: I39b56db83ef60b899a3499acd2dce88269409089
Reviewed-on: https://go-review.googlesource.com/c/website/+/627596
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/screentest/main.go | 4 | ||||
| -rw-r--r-- | cmd/screentest/screentest.go | 10 | ||||
| -rw-r--r-- | cmd/screentest/screentest_test.go | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/cmd/screentest/main.go b/cmd/screentest/main.go index 8c145be2..551fda2f 100644 --- a/cmd/screentest/main.go +++ b/cmd/screentest/main.go @@ -151,7 +151,7 @@ func init() { flag.StringVar(&flags.vars, "v", "", "variables provided to script templates as comma separated KEY:VALUE pairs") flag.IntVar(&flags.maxConcurrency, "c", (runtime.NumCPU()+1)/2, "number of test cases to run concurrently") flag.StringVar(&flags.debuggerURL, "d", "", "chrome debugger URL") - flag.StringVar(&flags.outputURL, "o", "", "path for output: file path or URL with 'file' or 'gs' scheme") + flag.StringVar(&flags.outputDirURL, "o", "", "path for output: file path or URL with 'file' or 'gs' scheme") flag.StringVar(&flags.headers, "headers", "", "HTTP headers: comma-separated list of name:value") flag.StringVar(&flags.run, "run", "", "regexp to match test") } @@ -164,7 +164,7 @@ type options struct { maxConcurrency int debuggerURL string run string - outputURL string + outputDirURL string headers string } diff --git a/cmd/screentest/screentest.go b/cmd/screentest/screentest.go index a1907499..08e702a6 100644 --- a/cmd/screentest/screentest.go +++ b/cmd/screentest/screentest.go @@ -177,20 +177,20 @@ func commonValues(ctx context.Context, testURL, wantURL string, opts options) (c return common{}, err } - outPath := opts.outputURL - if outPath == "" { + outDirPath := opts.outputDirURL + if outDirPath == "" { cache, err := os.UserCacheDir() if err != nil { return common{}, fmt.Errorf("os.UserCacheDir(): %w", err) } - outPath = path.Join(filepath.ToSlash(cache), "screentest") + outDirPath = path.Join(filepath.ToSlash(cache), "screentest") } - c.failImageWriter, err = newImageReadWriter(ctx, outPath) + c.failImageWriter, err = newImageReadWriter(ctx, outDirPath) if err != nil { return common{}, err } if c.failImageWriter == nil { - return common{}, fmt.Errorf("cannot write images to %q", outPath) + return common{}, fmt.Errorf("cannot write images to %q", outDirPath) } hs, err := splitList(opts.headers) diff --git a/cmd/screentest/screentest_test.go b/cmd/screentest/screentest_test.go index 58cf3924..709a680f 100644 --- a/cmd/screentest/screentest_test.go +++ b/cmd/screentest/screentest_test.go @@ -163,8 +163,8 @@ func TestReadTests(t *testing.T) { filename: "testdata/readtests2.txt", }, opts: options{ - headers: "Authorization:Bearer token", - outputURL: "gs://bucket/prefix", + headers: "Authorization:Bearer token", + outputDirURL: "gs://bucket/prefix", }, want: []*testcase{ { |
