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

devenv test reporting success even when errors and failures occur #1199

Open
kourtni opened this issue May 14, 2024 · 2 comments
Open

devenv test reporting success even when errors and failures occur #1199

kourtni opened this issue May 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@kourtni
Copy link

kourtni commented May 14, 2024

Describe the bug
When running devenv test, failures and errors can get swallowed resulting in devenv test reporting that "Tests passed".

devenv_test_errors

To reproduce
This gist, https://gist.github.com/kourtni/7ee2749b0bb75253e0d29d2deab1b4fb, is a complete example that reproduces the issue. I expect that running devenv test from that environment should fail, however it currently passes.

Version
devenv 1.0.5 (x86_64-linux)

@kourtni kourtni added the bug Something isn't working label May 14, 2024
@domenkozar
Copy link
Member

Could you also attach the python files so I can reproduce the failure?

@kourtni
Copy link
Author

kourtni commented May 25, 2024

Hi,

The issue is that devenv test swallows errors and test failures if enterTest ends with a command that exits normally.

The screenshot is from tests run in a private repo, so I can't share those files. But as I indicated in the Gist, https://gist.github.com/kourtni/7ee2749b0bb75253e0d29d2deab1b4fb, this behavior is completely reproducible without actually requiring any python files. In fact the point of that Gist is to show that devenv test passes even without ANY of the required packages installed or source files available. I am able to reproduce the issue with only the devenv.nix and devenv.yaml files included in the Gist, and then simply running devenv test.

But if you absolutely want to include a dummy test for some reason, you could create a file with a simple test where you assert 1 == 2 or something that will obviously fail.

As long as the final command in enterTest is an echo or some other command guaranteed to succeed, then any failures that occurred prior will be swallowed and the devenv test will complete in a Tests passed state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants