ghostwheel icon indicating copy to clipboard operation
ghostwheel copied to clipboard

Test only changed functions

Open roman01la opened this issue 7 years ago • 4 comments

Does it runs generative tests for every specced function in a namespace or only for what's changed? Haven't tried it yet, but how does it impacts perf when everything gets checked on every code reload? Thanks!

roman01la avatar Jul 30 '18 09:07 roman01la

When generative testing is enabled and (g/check) is called at the bottom of the namespace, it runs the checks for every specced function in a hot-reloaded namespace. It would be great if we could go more granular and really only re-test changed functions, but we ain't there yet. I heard that there's some work being done by the folks at Cognitect that might make this possible in the future, so keeping an eye on it.

There is a performance impact depending on the number and complexity of the functions in the changed namespace as well as the number of test iterations you set, but whether that'll be a problem really depends on the project and personal workflow/preferences.

There's more info on this in the spec-testing section in the documentation, but the TL;DR is that if you feel the performance impact is too great, you can enable ::check true, adjust ::num-tests-ext, and enable ::extensive-tests in your test configuration, so that you can only run the generated generative tests as part of your regular CI/testing workflow.

With generative testing disabled (which it is by default) in your regular dev build config the performance impact is virtually zero.

gnl avatar Jul 30 '18 14:07 gnl

https://github.com/gnl/ghostwheel#performance-considerations-or-how-much-generative-testing-is-enough

gnl avatar Jul 30 '18 14:07 gnl

👋 Hi. I'm posting this same comment to all issue threads to just give a quick heads up that the project, despite rumours and some evidence to the contrary, is not dead. It was hibernating for a little while and now nearing the long-awaited next release, which will fix some long-standing issues (and introduce some breaking changes to the config).

I'll be reviewing all open issues and PRs over the next couple of weeks, so stay tuned and thanks for the patience.

See also this Slack thread

gnl avatar May 21 '20 01:05 gnl