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

Interpret the "0 test" situation as a failure #211

Open
gracechin opened this issue Mar 22, 2021 · 5 comments · May be fixed by #404
Open

Interpret the "0 test" situation as a failure #211

gracechin opened this issue Mar 22, 2021 · 5 comments · May be fixed by #404
Assignees

Comments

@gracechin
Copy link

Currently tests pass and no fails are thrown when there are 0 tests.

0 tests, 0 assertions, 0 failures.

Not sure if this kind of kaocha configuration is possible in the tests.edn, but it would be useful to have the kaocha fail when 0 tests are detected. This would help indicate that configurations are incorrect, similar to how an error is thrown, if a deftest doesn't contain any assertions. This will ensure that any mis-configurations can be brought to attention

@onetom
Copy link

onetom commented Mar 22, 2021

Recommendation on Slack, by @lread :

@onetom, I would prefer a non zero exit in this scenario as well. But... it is also pretty easy to write a kaocha hook to achieve this.

@alysbrooks
Copy link
Member

alysbrooks commented Mar 22, 2021

Thanks for suggesting this improvement! I think this makes a lot of sense. Maybe not as default behavior, but as an option you can enable.

@plexus
Copy link
Member

plexus commented Mar 23, 2021

This could be a good candidate for #183 , we can already introduce a flag to opt-in, then change the default for #kaocha/v2

@frenchy64
Copy link
Contributor

Along similar lines, the No tests found situation might also be considered a failure.

kaocha/src/kaocha/api.clj

Lines 104 to 106 in 3d83494

(output/warn (str "No tests were found, make sure :test-paths and "
":ns-patterns are configured correctly in tests.edn."))
(throw+ {:kaocha/early-exit 0}))

That might also make internal bugs like #208 more apparent.

@humorless
Copy link
Contributor

It seems that it can be related the PR #404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

6 participants