Browse Source
Fix handling of dropped error in test
pull/11760/head
Lars Lehtonen
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
4 deletions
-
main_test.go
|
|
@ -335,12 +335,14 @@ var commonTestScriptsParam = testscript.Params{ |
|
|
|
var info testInfo |
|
|
|
// Read the .ready file's JSON into info.
|
|
|
|
f, err := os.Open(readyFilename) |
|
|
|
if err == nil { |
|
|
|
err = json.NewDecoder(f).Decode(&info) |
|
|
|
f.Close() |
|
|
|
} else { |
|
|
|
if err != nil { |
|
|
|
ts.Fatalf("failed to open .ready file: %v", err) |
|
|
|
} |
|
|
|
err = json.NewDecoder(f).Decode(&info) |
|
|
|
if err != nil { |
|
|
|
ts.Fatalf("error decoding json: %v", err) |
|
|
|
} |
|
|
|
f.Close() |
|
|
|
|
|
|
|
for i, s := range info.BaseURLs { |
|
|
|
ts.Setenv(fmt.Sprintf("HUGOTEST_BASEURL_%d", i), s) |
|
|
|