Skip to content
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

bug: snapshot tests broken in Go 1.19 #678

Closed
a-h opened this issue Jan 19, 2023 · 2 comments · Fixed by #1020
Closed

bug: snapshot tests broken in Go 1.19 #678

a-h opened this issue Jan 19, 2023 · 2 comments · Fixed by #1020
Assignees

Comments

@a-h
Copy link

a-h commented Jan 19, 2023

Go 1.19 added a new field called OmitHost into the url.URL type - golang/go#46059

The snapshots on disk don't include the OmitHost field, because they were generated with Go 1.18, so if you run the tests on Go >= 1.19, the tests will fail due to the OmitHost field appearing.

If I update the snapshots, then it will fail for everyone using Go < 1.19.

Since the OmitHost field isn't important for this use case, maybe the comparison could be updated to ignore the field.

       --- FAIL: TestE2E/regression/elk_img_empty_label_panic (0.09s)
            e2e_test.go:175: unexpected error: diff (rerun with $TESTDATA_ACCEPT=1 or $TA=1 to accept):
                --- a/testdata/regression/elk_img_empty_label_panic/dagre/board.exp.json
                +++ b/testdata/regression/elk_img_empty_label_panic/dagre/board.got.json
                @@ -29,6 +29,7 @@
                         "Host": "icons.terrastruct.com",
                         "Path": "/infra/019-network.svg",
                         "RawPath": "",
                +        "OmitHost": false,
                         "ForceQuery": false,
                         "RawQuery": "",
                         "Fragment": "",
                @@ -79,6 +80,7 @@
                         "Host": "icons.terrastruct.com",
                         "Path": "/infra/019-network.svg",
                         "RawPath": "",
                +        "OmitHost": false,
                         "ForceQuery": false,
                         "RawQuery": "",
                         "Fragment": "",
@cyborg-ts cyborg-ts added this to D2 Jan 19, 2023
@alixander
Copy link
Collaborator

yeahh there's some discussion here: #577

basically, go 1.19 has a new fmt that breaks a bunch of our ascii art comments, so we haven't been upgrading. being 2 minor versions behind is harder to swallow though so it's a TODO to convert all our ascii art to use block comments to preserve. we'll use this issue to track, thank you.

@alixander
Copy link
Collaborator

task is to fix ascii arts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants