kaocha icon indicating copy to clipboard operation
kaocha copied to clipboard

#kaocha/v2 wish list

Open plexus opened this issue 3 years ago • 5 comments

The #kaocha/v1 reader tag does two things, it normalizes the test config, and it fills in various defaults.

Now that Kaocha is a bit more mature we can look back at some of the choices made early on, and maybe reconsider some of those defaults. By introducing a #kaocha/v2 we can provide different defaults for new users, while not changing the behavior of existing test suites using #kaocha/v1.

We are not yet sure if we'll add a /v2 or when we would do it, but I do have some ideas of what I would want to do with it, maybe others do too, so this is a wishlist issue where we can collect those ideas.

The general idea I think is to make all the "smart" features that actually end up confusing people opt-in. The documentation would show a default config that has these features turned on, so you still get the rich kaocha experience, but it would be explicit, so people can make a choice if they want these things, and are made aware that they exist.

  • :capture-output? -> currently defaults to true, change that to false
  • :test-ns-patterns -> currently set to #"-test", change it to match all namespaces (see #60)
  • ::skip-add-classpath? -> stop adding test directories to the classpath at runtime, it's too flaky and can interact badly with other tools. Just let people manage their own classpath through deps.edn or whatever they are using

plexus avatar Dec 04 '20 08:12 plexus

I wonder if we want to warn when there is no tests.edn and Kaocha's using the latest default configuration because having versioned reader tags don't help in that situation. If we did that soon, that would give people plenty of advance notice before we introduced #kaocha/v2 (assuming we do).

alysbrooks avatar Dec 08 '20 00:12 alysbrooks

Oh that's a good point!

plexus avatar Dec 08 '20 03:12 plexus

I think kaocha.watch/use-ignore-file is a candidate for #kaocha/v2.

alysbrooks avatar Jan 19 '21 00:01 alysbrooks

A bit out of left field here, but in the spirit of trying to perhaps be helpful for your v2, and not in the spirit of being nit-picky:

@borkdude and I were looking at expanded kaocha v1 configs and he made the observation that :kaocha.type/clojure.test has a technically illegal keyword name. According to Clojure docs the name part of keywords cannot contain periods and therefore clojure.test is technically invalid.

lread avatar Mar 26 '21 20:03 lread

I think avoiding illegal keywords going forward is ideal, although it's not worth breaking backward compatibility, imo. And I'm not sure about :kaocha.type/clojure.test in particular, since clojure.test is a natural way to refer to the built-in test library.

The other complication is that the reader is more permissive than it's supposed to be, and previous attempts to make it more strict have been rolled back.

Update: Documented the illegal character issue with some thoughts in #212.

alysbrooks avatar Mar 27 '21 04:03 alysbrooks