Code Monkey home page Code Monkey logo

Comments (7)

onsi avatar onsi commented on July 19, 2024

hey there - I've never used xgo (first time I'm hearing about it actually!) ginkgo calls go to compile your tests and so xgo exec ginkgo ./... will end up just calling go under the hood.

But ginkgo does allow you to pass in a precompiled binary as a test suite. So you could try:

cd ./path/to/package
xgo test -c 
ginkgo package.test

to see if that works. If it does we'll need to teach the Ginkgo cli how to choose which go to use:
https://github.com/onsi/ginkgo/blob/master/ginkgo/internal/compile.go#L44

I could imagine a hidden GINKGO_GOBINARY="xgo" environment variable that reconfigures that line.

from ginkgo.

Envek avatar Envek commented on July 19, 2024

But ginkgo does allow you to pass in a precompiled binary as a test suite.

Nope, that doesn't work either.

from ginkgo.

onsi avatar onsi commented on July 19, 2024

odd. what happens if you go to your path_suite and run xgo test (don't even use ginkgo - jus use the usual test runner. you'll lose some of the cli features but the tests will run fine)

from ginkgo.

Envek avatar Envek commented on July 19, 2024

Oh, pardon my confusion, I messed up with xgo setup in my terminal (xgo requires that its binary is directly available in the PATH without any intermediate shims from asdf or similar version managers, and I lost this part when reopened my terminal).

Both xgo test -c && ginkgo package.test and xgo test are working, sorry again.

from ginkgo.

onsi avatar onsi commented on July 19, 2024

Ok sounds good. Sounds like the last thing we need to do is allow you to override which Go binary ginkgo uses. Would you be up for submitting a PR?

We'd want to add some code to:
https://github.com/onsi/ginkgo/blob/master/ginkgo/internal/compile.go#L44

to look for a GINKGO_GOBINARY environment variable and use that instead of "go" if it is defined.

We'd then need to update the docs:
https://github.com/onsi/ginkgo/blob/master/docs/index.md?plain=1#L5298

to mention the environment variable.

WDYT?

from ginkgo.

xhd2015 avatar xhd2015 commented on July 19, 2024

Ok sounds good. Sounds like the last thing we need to do is allow you to override which Go binary ginkgo uses. Would you be up for submitting a PR?

We'd want to add some code to: https://github.com/onsi/ginkgo/blob/master/ginkgo/internal/compile.go#L44

to look for a GINKGO_GOBINARY environment variable and use that instead of "go" if it is defined.

We'd then need to update the docs: https://github.com/onsi/ginkgo/blob/master/docs/index.md?plain=1#L5298

to mention the environment variable.

WDYT?

Maybe able to specify the whole building command is more feasible? Like GINKGO_BUILDTEST_COMMAND?
Or something like go's -toolexec flag, which passes the whole command and args to the target binary.

from ginkgo.

onsi avatar onsi commented on July 19, 2024

hey sorry for the delay. my understanding of toolexec is that it chains commands before running the canonical go command, not for changing the go command itself. i also don't want folks to be adding their own flags as that could interfere with Ginkgo's build settings. I do think the simple/easy approach here is to simply override the one go invocation that i describe above.

from ginkgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.