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

Go version inconsistency fails local unit tests #3174

Open
Kouteki opened this issue Nov 21, 2024 · 2 comments
Open

Go version inconsistency fails local unit tests #3174

Kouteki opened this issue Nov 21, 2024 · 2 comments
Assignees
Labels
🐞 bug Something isn't working help wanted Want to contribute? We recommend these issues.

Comments

@Kouteki
Copy link
Contributor

Kouteki commented Nov 21, 2024

Current state

Master repo uses go1.22 to transpile and check. Local tests run go build through go/exec, using the Go version on the machine. This can cause tests to fail due to version differences.

Desired state

Tests just work.

Misc

  • Maybe within GNOROOT we can make this use the go toolchain on the repo. so... go run cmd/go build?
  • Perhaps something like this is the way to go to keep the backward compatibility, func isValidError(output string) bool {return strings.Contains(output, "declared and not used")} but it won’t be clean, so hopefully there won’t be much mismatch that we need to handle
  • Maybe ensuring we use a consistent version (the one in go.mod) when testing is the best approach here, although the need of manually maintaining version changes is still required.
@zivkovicmilos
Copy link
Member

The test in question is:
Test_Scripts/gno_transpile/gobuild_flag_build_error

@zivkovicmilos zivkovicmilos added the help wanted Want to contribute? We recommend these issues. label Nov 21, 2024
@ltzmaxwell
Copy link
Contributor

Additional information:

=== PAUSE Test_Scripts/gno_transpile/gobuild_flag_build_error
=== CONT  Test_Scripts/gno_transpile/gobuild_flag_build_error
    testscript.go:558: WORK=$WORK
        PATH=...
        GOTRACEBACK=system
        HOME=/var/folders/dx/v25kly5d1ynd2y4ccs6cy77r0000gn/T/gno2113607741
        TMPDIR=$WORK/.tmp
        devnull=/dev/null
        /=/
        :=:
        $=$
        exe=
        GNOROOT=/Users/zmilos/Work/gno
        GO111MODULE=off
        
        # Run gno transpile with -gobuild flag (1.813s)
        > ! gno transpile -gobuild .
        [stderr]
        main.gno:4:6: declared and not used: x
        main.gno:5:6: declared and not used: y
        2 transpile error(s)
        
        gno command error: exit status 1
        > ! stdout .+
        > stderr '^main.gno:4:6: x declared and not used$'
        FAIL: /Users/zmilos/Work/gno/gnovm/cmd/gno/testdata/gno_transpile/gobuild_flag_build_error.txtar:6: no match for `^main.gno:4:6: x declared and not used$` found in stderr
        
--- FAIL: Test_Scripts/gno_transpile/gobuild_flag_build_error (1.83s)

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working help wanted Want to contribute? We recommend these issues.
Projects
Status: In Progress
Development

No branches or pull requests

5 participants
@ltzmaxwell @notJoon @Kouteki @zivkovicmilos and others