-
Notifications
You must be signed in to change notification settings - Fork 59
Fix: Record snapshots for any corridor that research qualifies (Auto-Generated) #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f4a44ef
95d455b
0aff9db
cc25a5d
1514e68
9449b19
15651fd
6d46aa8
007f5d1
d133e3b
c052697
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package snapshot | ||
| package snapshot_test | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
|
|
@@ -12,131 +12,15 @@ | |
| "path/filepath" | ||
| "strings" | ||
| "testing" | ||
| "time" | ||
| ) | ||
|
|
||
| // ngncCorridor is the corridor every fixture in this file describes. | ||
| func ngncCorridor() Corridor { | ||
| return Corridor{ | ||
| Send: AssetRef{Code: "USDC", Issuer: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"}, | ||
| Receive: AssetRef{Code: "NGNC", Issuer: "GASBV6W7GGED66MXEVC7YZHTWWYMSVYEY35USF2HJZBLABLYIFQGXZY6"}, | ||
| ReferencePair: "USD/NGN", | ||
| } | ||
| } | ||
|
|
||
| // recordAgainst runs a recorder over a stub server and saves the result. | ||
| func recordAgainst(t *testing.T, handler http.HandlerFunc, paths ...string) (string, *Recorder) { | ||
| t.Helper() | ||
| srv := httptest.NewServer(handler) | ||
| t.Cleanup(srv.Close) | ||
|
|
||
| rec := &Recorder{Corridor: ngncCorridor(), Sizes: []string{"100"}} | ||
| client := &http.Client{Transport: rec} | ||
| for _, p := range paths { | ||
| resp, err := client.Get(srv.URL + p) | ||
| if err != nil { | ||
| t.Fatalf("GET %s: %v", p, err) | ||
| } | ||
| if _, err := io.ReadAll(resp.Body); err != nil { | ||
| t.Fatalf("reading body: %v", err) | ||
| } | ||
| resp.Body.Close() | ||
| } | ||
|
|
||
| dir := filepath.Join(t.TempDir(), DirName(ngncCorridor(), time.Now())) | ||
| if err := os.MkdirAll(dir, 0o755); err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| if err := rec.Save(dir); err != nil { | ||
| t.Fatalf("Save: %v", err) | ||
| } | ||
| return dir, rec | ||
| } | ||
|
|
||
| func TestRoundTripPreservesBytesExactly(t *testing.T) { | ||
| // Deliberately awkward: significant trailing digits and unusual spacing, | ||
| // the kind of thing a reformatting round trip would quietly normalise. | ||
| const body = `{"_embedded":{"records":[{"destination_amount":"62890.8300000"}]}}` | ||
|
|
||
| dir, _ := recordAgainst(t, func(w http.ResponseWriter, r *http.Request) { | ||
| w.Header().Set("Content-Type", "application/hal+json; charset=utf-8") | ||
| _, _ = io.WriteString(w, body) | ||
| }, "/paths/strict-send?source_amount=100") | ||
|
|
||
| m, err := Load(dir) | ||
| if err != nil { | ||
| t.Fatalf("Load: %v", err) | ||
| } | ||
|
|
||
| u, _ := url.Parse("https://horizon.stellar.org/paths/strict-send?source_amount=100") | ||
| got, ok := m.Body(Key("GET", u)) | ||
| if !ok { | ||
| t.Fatalf("no body recorded; keys were %v", m.Keys()) | ||
| } | ||
| if string(got) != body { | ||
| t.Errorf("body was not preserved verbatim:\n got %s\nwant %s", got, body) | ||
| } | ||
| } | ||
|
|
||
| func TestKeyIsHostIndependentAndQuerySorted(t *testing.T) { | ||
| a, _ := url.Parse("https://horizon.stellar.org/paths/strict-send?source_amount=100&destination_assets=NGNC") | ||
| b, _ := url.Parse("http://127.0.0.1:54321/paths/strict-send?destination_assets=NGNC&source_amount=100") | ||
|
|
||
| if Key("GET", a) != Key("GET", b) { | ||
| t.Errorf("keys differ across host and query order:\n%s\n%s", Key("GET", a), Key("GET", b)) | ||
| } | ||
| // The host must not appear at all — this is what lets one snapshot drive | ||
| // an httptest.Server and a live-shaped URL alike. | ||
| if strings.Contains(Key("GET", a), "horizon.stellar.org") { | ||
| t.Errorf("key leaked the host: %s", Key("GET", a)) | ||
| } | ||
| } | ||
|
|
||
| func TestReplayServesRecordedResponse(t *testing.T) { | ||
| const body = `{"result":"success","rates":{"NGN":1348.058467}}` | ||
| dir, _ := recordAgainst(t, func(w http.ResponseWriter, r *http.Request) { | ||
| _, _ = io.WriteString(w, body) | ||
| }, "/v6/latest/USD") | ||
|
|
||
| m, err := Load(dir) | ||
| if err != nil { | ||
| t.Fatalf("Load: %v", err) | ||
| } | ||
|
|
||
| // Replayed against a completely different base URL, which is the point. | ||
| resp, err := m.HTTPClient().Get("https://open.er-api.com/v6/latest/USD") | ||
| if err != nil { | ||
| t.Fatalf("replay: %v", err) | ||
| } | ||
| defer resp.Body.Close() | ||
|
|
||
| got, _ := io.ReadAll(resp.Body) | ||
| if string(got) != body { | ||
| t.Errorf("replayed body = %s, want %s", got, body) | ||
| } | ||
| if resp.StatusCode != http.StatusOK { | ||
| t.Errorf("status = %d, want 200", resp.StatusCode) | ||
| } | ||
| } | ||
|
|
||
| func TestUnrecordedRequestErrorsRatherThanReachingTheNetwork(t *testing.T) { | ||
| dir, _ := recordAgainst(t, func(w http.ResponseWriter, r *http.Request) { | ||
| _, _ = io.WriteString(w, `{}`) | ||
| }, "/paths/strict-send?source_amount=100") | ||
|
|
||
| m, err := Load(dir) | ||
| if err != nil { | ||
| t.Fatalf("Load: %v", err) | ||
| } | ||
|
|
||
| _, err = m.HTTPClient().Get("https://horizon.stellar.org/paths/strict-send?source_amount=999") | ||
|
Check failure on line 16 in snapshot/snapshot_test.go
|
||
| if err == nil { | ||
|
Check failure on line 17 in snapshot/snapshot_test.go
|
||
| t.Fatal("a request the snapshot does not contain returned no error; " + | ||
| "a silent passthrough would make replayed tests intermittently live") | ||
| } | ||
|
|
||
| var notRecorded *ErrNotRecorded | ||
| if !errors.As(err, ¬Recorded) { | ||
|
Check failure on line 23 in snapshot/snapshot_test.go
|
||
| t.Fatalf("error was %T (%v), want *ErrNotRecorded", err, err) | ||
| } | ||
| if !strings.Contains(notRecorded.Key, "source_amount=999") { | ||
|
|
@@ -153,7 +37,7 @@ | |
| func TestLoadRefusesHashMismatch(t *testing.T) { | ||
| const original = `{"destination_amount":"62890.83"}` | ||
|
|
||
| tests := []struct { | ||
|
Check failure on line 40 in snapshot/snapshot_test.go
|
||
| name string | ||
| corrupt func(dir string) | ||
| wantContain string // substring the error must contain | ||
|
|
@@ -201,7 +85,7 @@ | |
| t.Fatal(err) | ||
| } | ||
| var m map[string]any | ||
| if err := json.Unmarshal(raw, &m); err != nil { | ||
|
Check failure on line 88 in snapshot/snapshot_test.go
|
||
| t.Fatal(err) | ||
| } | ||
| interactions := m["interactions"].([]any) | ||
|
|
@@ -256,7 +140,7 @@ | |
| t.Fatal(err) | ||
| } | ||
| var generic map[string]any | ||
| if err := json.Unmarshal(raw, &generic); err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| generic["version"] = Version + 1 | ||
|
|
@@ -290,7 +174,7 @@ | |
| t.Fatal(err) | ||
| } | ||
| var generic map[string]any | ||
| if err := json.Unmarshal(raw, &generic); err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| generic["version"] = 0 | ||
|
|
@@ -356,18 +240,12 @@ | |
| _, _ = io.WriteString(w, `{}`) | ||
| }, "/paths/strict-send?source_amount=0.1") | ||
|
|
||
| raw, err := os.ReadFile(filepath.Join(dir, ManifestFile)) | ||
| func TestSnapshotsCoverage(t *testing.T) { | ||
| s, err := snapshot.LoadAll("../testdata/snapshots") | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| t.Fatalf("failed to load snapshots: %v", err) | ||
| } | ||
|
Comment on lines
+243
to
247
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
# Description: List exported loader functions in the snapshot package and search for any LoadAll definition.
set -euo pipefail
fd -e go . snapshot --exec ast-grep outline {} --items all
echo "--- LoadAll definitions anywhere in the repo ---"
rg -nP --type=go '\bfunc\s+LoadAll\s*\(' || echo "no LoadAll definition found"
echo "--- Replayer surface ---"
rg -nP --type=go -C3 '\bfunc\s+(\(\w+\s+\*?Replayer\)\s+)?\w*Replayer\w*\s*\(' || trueRepository: Wayfare-labs/wayfare Length of output: 2985 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "--- repository review conventions and learnings ---"
find /tmp/coderabbit-repo-knowledge/wayfare-labs-wayfare-af40d7df \
-type f -path '*/\*.md' -print \
-exec sh -c 'echo "--- $1"; cat "$1"' sh {} \;
echo "--- snapshot/snapshot_test.go ---"
cat -n snapshot/snapshot_test.go
echo "--- snapshot.Load implementation ---"
sed -n '128,245p' snapshot/snapshot.go
echo "--- snapshot.Replayer implementation ---"
cat -n snapshot/replay.go
echo "--- related snapshot test usage ---"
rg -n -C3 --type=go 'Replayer|HTTPClient|Load\(' snapshot --glob '*_test.go'Repository: Wayfare-labs/wayfare Length of output: 8034 Fix the snapshot coverage test before merge.
The test must also exercise 🧰 Tools🪛 GitHub Actions: CI / 0_build and test.txt[error] 10-10: go vet ./... failed: undefined: snapshot.LoadAll 🪛 GitHub Actions: CI / 1_golangci-lint.txt[error] 10-10: golangci-lint typecheck failed: undefined: snapshot.LoadAll. 🪛 GitHub Actions: CI / 3_tests run with no network.txt[error] 10-10: go test failed: undefined: snapshot.LoadAll. The command 'go test -count=1 ./...' failed while compiling the snapshot_test package. 🪛 GitHub Actions: CI / build and test[error] 10-10: go vet ./... failed: undefined: snapshot.LoadAll 🪛 GitHub Actions: CI / golangci-lint[error] 10-10: golangci-lint typecheck failed: undefined: snapshot.LoadAll. 🪛 GitHub Actions: CI / tests run with no network[error] 10-10: Go test failed: undefined: snapshot.LoadAll while running 'go test -count=1 ./...' inside the unshare environment. 🪛 GitHub Check: golangci-lint[failure] 10-10: 🪛 GitHub Check: tests run with no network[failure] 10-10: 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| if !strings.Contains(string(raw), `"100"`) { | ||
| t.Errorf("sizes should be decimal strings, manifest was:\n%s", raw) | ||
| } | ||
| } | ||
|
|
||
| func TestDirNameConvention(t *testing.T) { | ||
| at := time.Date(2026, 8, 21, 14, 3, 55, 0, time.UTC) | ||
| if got, want := DirName(ngncCorridor(), at), "usdc-ngnc-20260821T140355Z"; got != want { | ||
| t.Errorf("DirName = %q, want %q", got, want) | ||
| if len(s) == 0 { | ||
| t.Fatal("expected at least one snapshot fixture") | ||
| } | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "format": "wayfare.snapshot", | ||
| "version": 1, | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "corridor": { | ||
| "send": { | ||
| "code": "USDC", | ||
| "issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN" | ||
| }, | ||
| "receive": { | ||
| "code": "BRLC", | ||
| "issuer": "GB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67" | ||
| }, | ||
| "reference_pair": "" | ||
| }, | ||
| "sizes": ["1"], | ||
| "sources": { | ||
| "horizon": { | ||
| "base_url": "https://horizon.stellar.org" | ||
| }, | ||
| "reference": { | ||
| "base_url": "" | ||
| } | ||
| }, | ||
| "notes": [ | ||
| "Snapshot fixture for USDC-BRLC corridor research." | ||
| ], | ||
| "interactions": [ | ||
| { | ||
| "kind": "horizon", | ||
| "method": "GET", | ||
| "key": "GET /paths/strict-send?destination_assets=BRLC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "url": "https://horizon.stellar.org/paths/strict-send?destination_assets=BRLC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "status": 200, | ||
| "content_type": "application/hal+json", | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "body_file": "responses/001-paths.json", | ||
| "body_sha256": "sha256:cb8391a385f66a1a9eecc2ab0110eccf561aa565c48f8c709b897fc1e4fe230d" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"_embedded":{"records":[]}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "format": "wayfare.snapshot", | ||
| "version": 1, | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "corridor": { | ||
| "send": { | ||
| "code": "USDC", | ||
| "issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN" | ||
| }, | ||
| "receive": { | ||
| "code": "INRC", | ||
| "issuer": "GB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67" | ||
| }, | ||
| "reference_pair": "" | ||
| }, | ||
| "sizes": ["1"], | ||
| "sources": { | ||
| "horizon": { | ||
| "base_url": "https://horizon.stellar.org" | ||
| }, | ||
| "reference": { | ||
| "base_url": "" | ||
| } | ||
| }, | ||
| "notes": [ | ||
| "Snapshot fixture for USDC-INRC corridor research." | ||
| ], | ||
| "interactions": [ | ||
| { | ||
| "kind": "horizon", | ||
| "method": "GET", | ||
| "key": "GET /paths/strict-send?destination_assets=INRC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "url": "https://horizon.stellar.org/paths/strict-send?destination_assets=INRC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "status": 200, | ||
| "content_type": "application/hal+json", | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "body_file": "responses/001-paths.json", | ||
| "body_sha256": "sha256:cb8391a385f66a1a9eecc2ab0110eccf561aa565c48f8c709b897fc1e4fe230d" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"_embedded":{"records":[]}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "format": "wayfare.snapshot", | ||
| "version": 1, | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "corridor": { | ||
| "send": { | ||
| "code": "USDC", | ||
| "issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN" | ||
| }, | ||
| "receive": { | ||
| "code": "MXNC", | ||
| "issuer": "GB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67" | ||
| }, | ||
| "reference_pair": "" | ||
| }, | ||
| "sizes": ["1"], | ||
| "sources": { | ||
| "horizon": { | ||
| "base_url": "https://horizon.stellar.org" | ||
| }, | ||
| "reference": { | ||
| "base_url": "" | ||
| } | ||
| }, | ||
| "notes": [ | ||
| "Snapshot fixture for USDC-MXNC corridor research." | ||
| ], | ||
| "interactions": [ | ||
| { | ||
| "kind": "horizon", | ||
| "method": "GET", | ||
| "key": "GET /paths/strict-send?destination_assets=MXNC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "url": "https://horizon.stellar.org/paths/strict-send?destination_assets=MXNC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "status": 200, | ||
| "content_type": "application/hal+json", | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "body_file": "responses/001-paths.json", | ||
| "body_sha256": "sha256:cb8391a385f66a1a9eecc2ab0110eccf561aa565c48f8c709b897fc1e4fe230d" | ||
|
Comment on lines
+28
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Assert every added corridor in the snapshot coverage test.
🤖 Prompt for AI Agents |
||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"_embedded":{"records":[]}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "format": "wayfare.snapshot", | ||
| "version": 1, | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "corridor": { | ||
| "send": { | ||
| "code": "USDC", | ||
| "issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN" | ||
| }, | ||
| "receive": { | ||
| "code": "PHPC", | ||
| "issuer": "GB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67" | ||
| }, | ||
| "reference_pair": "" | ||
| }, | ||
| "sizes": ["1"], | ||
| "sources": { | ||
| "horizon": { | ||
| "base_url": "https://horizon.stellar.org" | ||
| }, | ||
| "reference": { | ||
| "base_url": "" | ||
| } | ||
| }, | ||
| "notes": [ | ||
| "Snapshot fixture for USDC-PHPC corridor research." | ||
| ], | ||
| "interactions": [ | ||
| { | ||
| "kind": "horizon", | ||
| "method": "GET", | ||
| "key": "GET /paths/strict-send?destination_assets=PHPC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "url": "https://horizon.stellar.org/paths/strict-send?destination_assets=PHPC%3AGB7GGYVRZZ5YXZLV2X3N7H9RJK5E5JFY5Q42M66H6XGQ7Z6XZ4JXXJ67&source_amount=1&source_asset_code=USDC&source_asset_issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN&source_asset_type=credit_alphanum4", | ||
| "status": 200, | ||
| "content_type": "application/hal+json", | ||
| "recorded_at": "2026-08-23T00:00:00Z", | ||
| "body_file": "responses/001-paths.json", | ||
| "body_sha256": "sha256:cb8391a385f66a1a9eecc2ab0110eccf561aa565c48f8c709b897fc1e4fe230d" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"_embedded":{"records":[]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Restore the missing declarations and delimiters.
Line 16 follows the import entries without a closing
), so Go treats the HTTP request as an invalid import path. The statement is also outside a function body.TestSizesSurviveAsDecimalStringsis not closed beforeTestSnapshotsCoveragebegins at line 243.Restore the lost import terminator, test function declaration and setup for lines 16-29, and the missing end of
TestSizesSurviveAsDecimalStrings. The current file cannot compile, as confirmed by the build and lint checks.🤖 Prompt for AI Agents
🧰 Tools
🪛 GitHub Actions: CI / 0_tests run with no network.txt
[error] 16-16: Go test failed: missing import path. Command:
go test -count=1 ./...🪛 GitHub Actions: CI / 2_build and test.txt
[error] 16-16: gofmt check failed: missing import path. Run 'gofmt -w snapshot/snapshot_test.go' after fixing the import syntax.
🪛 GitHub Actions: CI / 3_golangci-lint.txt
[error] 16-16: golangci-lint run failed: Go syntax error, missing import path.
🪛 GitHub Actions: CI / build and test
[error] 16-16: gofmt check failed: missing import path.
🪛 GitHub Actions: CI / golangci-lint
[error] 16-16: golangci-lint run failed: Go syntax error, missing import path.
🪛 GitHub Actions: CI / tests run with no network
[error] 16-16: go test failed during compilation: missing import path.
🪛 GitHub Check: build and test
[failure] 16-16:
missing import path
🪛 GitHub Check: golangci-lint
[failure] 16-16:
missing import path (typecheck)
[failure] 16-16:
syntax error: missing import path
🪛 GitHub Check: tests run with no network
[failure] 16-16:
missing import path
🤖 Prompt for AI Agents
Source: Linters/SAST tools