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

ginkgo CLI cannot run pre-compiled test package on windows #529

Closed
olegch opened this issue Oct 26, 2018 · 2 comments
Closed

ginkgo CLI cannot run pre-compiled test package on windows #529

olegch opened this issue Oct 26, 2018 · 2 comments
Labels
v2 Issues that will be resolved by v2

Comments

@olegch
Copy link

olegch commented Oct 26, 2018

Reproduce

Compile ginkgo for windows:

GOOS=windows GOARCH=amd64 go build -i -v -o ginkgo.exe github.com/onsi/ginkgo/ginkgo

Precompile test package for windows:

GOOS=windows GOARCH=amd64 go test -i -v -c -o target/my.test.exe my-test-package

Try running the test binary on windows:

my.test.exe

It works as expected.
Try running the test binary via ginkgo CLI:

ginkgo.exe my.test.exe

Test suite is not found and not run

@olegch
Copy link
Author

olegch commented Oct 26, 2018

It looks like the heart of the problem lies here: https://github.com/onsi/ginkgo/blob/master/ginkgo/testsuite/test_suite.go#L29-L35

Ginkgo assumes that the precompiled test binary name must end with .test and that it must have an executable bit set.

Neither is true on windows.

I tried to remove these checks from the code and apparently it fixes the issue, at least partially.
With those checks removed ginkgo can run precompiled test package on windows correctly, but only if the binary file does not have .exe extension.
It is not ideal (you want to have exe extension on windows to run the file), but it works.

I suppose it is possible to fix ginkgo to accept binary names ending with exe, but it requires fixes in a couple more places.

@onsi
Copy link
Owner

onsi commented Apr 5, 2021

I'm working through the backlog of old Ginkgo issues - apologies as this issue is probably stale now.

I think you've honed in on why this is happening - I'll fix it and ensure it works in the v2 work I'm doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Issues that will be resolved by v2
Projects
None yet
Development

No branches or pull requests

2 participants