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

[bug] Tests exit successfully even if unit tests fail #771

Closed
ianlewis opened this issue Aug 29, 2022 · 4 comments · Fixed by #632
Closed

[bug] Tests exit successfully even if unit tests fail #771

ianlewis opened this issue Aug 29, 2022 · 4 comments · Fixed by #632
Labels
area:go Issue related to the Go ecosystem area:tests An issue with tests (unit, e2e, etc.) type:bug Something isn't working

Comments

@ianlewis
Copy link
Member

ianlewis commented Aug 29, 2022

Describe the bug
The golang builder makes an Exec syscall directly. This causes tests that call GoBuild.Run to cause the test runner to exit prematurely as the original test runner's process context is overwritten.

Currently, even if tests fail the process executed Exec syscall returns successfully so no error code is returned and go test exits successfully. This masks unit test errors and is highly unintuitive.

To Reproduce
Create a failing test and run go test -v ./...

@ianlewis ianlewis added type:bug Something isn't working area:go Issue related to the Go ecosystem area:tests An issue with tests (unit, e2e, etc.) labels Aug 29, 2022
@ianlewis ianlewis changed the title [bug] [bug] Tests exit successfully even if unit tests fail Aug 29, 2022
@laurentsimon
Copy link
Collaborator

great catch! Do you know if there's a way to force running the tests each in their own process?

@ianlewis
Copy link
Member Author

I don't know if there is really unless we start our own separate processes. I think the real thing we should do is refactor the Go builder to fork/exec instead as that is generally much more intuitive.

@laurentsimon
Copy link
Collaborator

SG. You have a PR about this, let me know when you need review. Fyi, your PR will also be very useful for the npm builder because it requires running multiple commands. So I'm happy to help getting this PR through :)

@ianlewis
Copy link
Member Author

Ah, yes #632 is related. Perhaps I'll take that off the back burner soon as that would be the proper solution.

#772 disables the offending test and will at least allow us to catch failing tests in the meantime.

@ianlewis ianlewis mentioned this issue Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:go Issue related to the Go ecosystem area:tests An issue with tests (unit, e2e, etc.) type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants