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

Share VMTEST_GOCOVERDIR with VM instead of GOCOVERDIR #98

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (
"github.com/hugelgupf/vmtest/testtmp"
)

// ShareGOCOVERDIR shares GOCOVERDIR with the guest if it's available in the
// ShareGOCOVERDIR shares VMTEST_GOCOVERDIR with the guest if it's available in the
// environment.
//
// Call guest.GOCOVERDIR to set up the directory in the guest.
func ShareGOCOVERDIR() Opt {
return func(t testing.TB, v *VMOptions) error {
goCov := os.Getenv("GOCOVERDIR")
goCov := os.Getenv("VMTEST_GOCOVERDIR")
if goCov == "" {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions tests/gocover/helloworld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func TestStartVM(t *testing.T) {
t.Setenv("VMTEST_GO_PROFILE", goProfile)
}

goCov := os.Getenv("GOCOVERDIR")
goCov := os.Getenv("VMTEST_GOCOVERDIR")
if goCov == "" {
goCov = testtmp.TempDir(t)
t.Setenv("GOCOVERDIR", goCov)
t.Setenv("VMTEST_GOCOVERDIR", goCov)
}

t.Run("test", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions tests/shellgocoverdir/helloworld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func TestStartVM(t *testing.T) {
"donothing\nsync\necho \"TESTS PASSED MARKER\"\nshutdown",
} {
t.Run(script, func(t *testing.T) {
goCov := os.Getenv("GOCOVERDIR")
goCov := os.Getenv("VMTEST_GOCOVERDIR")
if goCov == "" {
goCov = testtmp.TempDir(t)
t.Setenv("GOCOVERDIR", goCov)
t.Setenv("VMTEST_GOCOVERDIR", goCov)
}

vmtest.RunCmdsInVM(t, script,
Expand Down
Loading