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

testscript: Missing $GOOS and $GOARCH #270

Open
jmgilman opened this issue Sep 6, 2024 · 0 comments
Open

testscript: Missing $GOOS and $GOARCH #270

jmgilman opened this issue Sep 6, 2024 · 0 comments

Comments

@jmgilman
Copy link

jmgilman commented Sep 6, 2024

go.mod:

require (
    github.com/rogpeppe/go-internal v1.12.1-0.20240709150035-ccf4b4329d21
)

Script:

exec forge run ./dir1+test
cmpenv stdout golden.txt

-- golden.txt --
earthly
./dir1+test
Image ./dir1+test output as test

{"$GOOS/$GOARCH":{"artifacts":{},"images":{"./dir1+test":"test"}}}

The above test returns empty values for $GOOS and $GOARCH. The documentation seems to suggest these values should be set:

[!] cmpenv file1 file2 Like cmp, but environment variables in file2 are substituted before the comparison. For example, $GOOS is replaced by the target GOOS.

Yet, running with -testwork doesn't show these variables being set:

            PATH=...
            GOTRACEBACK=system
            HOME=/no-home
            TMPDIR=$WORK/.tmp
            devnull=/dev/null
            /=/
            :=:
            $=$
            exe=

What am I missing?

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

No branches or pull requests

1 participant