2

I'm using go with multiple version as stated in this doc https://go.dev/doc/manage-install

go install golang.org/dl/go1.10.7@latest
go1.10.7 download

And I'm also using ginkgo, which I installed like this: (based on https://onsi.github.io/ginkgo/#installing-ginkgo)

go install github.com/onsi/ginkgo/v2/ginkgo@latest

I can run a ginkgo test suite like this:

ginkgo ./...

However, this uses my main go version. I would like to use ginkgo to test with another version of go. Currently, the best I can do is to run the ginkgo tests with go test

go1.10.7 test ./...

Can I make ginkgo use different version of go to test with?

1 Answer 1

1

Based on their source code, they just use the command ”go”, so your options are:

  1. Temporarily rename go to go.bak and then rename go.10.7 to go (e.g. using mv)
  2. Open up a pull request to allow support for overriding the path to the Go executable (via an environment variable, for example)
  3. Do what you’re doing now

Source: https://github.com/onsi/ginkgo/blob/master/ginkgo/internal/compile.go

Relevant code:

func CompileSuite(suite TestSuite, goFlagsConfig types.GoFlagsConfig) TestSuite {

    ...

    cmd := exec.Command("go", args...)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.