kaocha icon indicating copy to clipboard operation
kaocha copied to clipboard

Default ns-pattern "-test$" is confusing

Open tonsky opened this issue 6 years ago • 5 comments

Following README, it’s not clear why after everything is set up no tests have been found. Maybe change default ns-pattern value to ".*", with option to rewrite? Otherwise you might just get stuck, with no idea why it’s not working and how to continue. I spent a great deal of time figuring if it’s a classpath problem or what

tonsky avatar Jan 26 '19 21:01 tonsky

Related: #34

plexus avatar Jan 28 '19 01:01 plexus

I'm ok with changing this. I would generally recommend to stick to the Clojure convention of naming your test namespaces something-test, and to be selective so Kaocha doesn't load more than it needs to, but the current default is confusing. Better to load everything by default, but show in examples how to narrow it down.

plexus avatar Jan 30 '19 03:01 plexus

I would generally recommend to stick to the Clojure convention of naming your test namespaces something-test...

Departing from the Java convention, clojure.test 1.10 is more friendly with embedded tests, see API sections "DEFINING TESTS" and "OMITTING TESTS FROM PRODUCTION CODE". AFAIK test code is already being suppressed in ClojureScript under optimised compilation (conditions may apply).

Indeed, not all tests should be embedded within code, but (eg. in Rust) it's really convenient to have unit tests close to the object under test.

Been bitten too, but a fix would also make embedding tests more straightforward.

fdserr avatar Feb 23 '19 16:02 fdserr

I was looking over issues with the "first issue only" tag, and I'm not sure we need to do this any more. Thanks to #72, the quickstart is much clearer, (and I've since made that change to the docs) and #34 will help too.

If we still go ahead and do it, I think we should introduce a new #kaocha/v2 reader, so it doesn't affect existing configs that haven't specified ns-pattern.

alysbrooks avatar Dec 02 '20 23:12 alysbrooks

Agreed that this would be a good candidate for a #kaocha/v2, I've started a ticket to track that: #183.

plexus avatar Dec 04 '20 08:12 plexus