Is your feature request related to a problem? Please describe.
I would like to write tests that should not always be run, eg:
- benchmarking/performance tests that take too long to be run every time
- integration tests with external systems that rely on working VPN, etc. and cannot be run in all environments.
Describe the solution you'd like
The cognitect.test-runner supports this via keyword options:
:includes - coll of test metadata keywords to include
:excludes - coll of test metadata keywords to exclude
The filter is applied to which vars will be run: https://github.com/cognitect-labs/test-runner/blob/334f2e2a5491747dff52f9ca8cbb4a53f54d344d/src/cognitect/test_runner.clj#L27-L32
I think a solution could be to similarly support filtering out specific metadata keywords before generating the final test-statements (after all the other logic for which bricks have changed, etc):
|
test-statements (mapv ->test-statement (concat brick-test-namespaces project-test-namespaces)) |
The other question would be where to configure the inclusion/exclusions. Perhaps a combo of having defaults configured in the workspace.edn and support for passing specific exclusion/inclusion keywords via poly test?
Describe alternatives you've considered
Right now, these kind of tests:
- need to be commented out and run manually (e.g. via a REPL inside a rich-comment-form)
- defined in a separate project that will need to be excluded by default in poly tooling
- perhaps not defined as tests but separate main executables that are run from root (but then we're reinventing the test-runner framework for reporting, etc)
I would prefer if they would be first-class deftest vars that are tagged via metadata and a way of excluding/including the tags via the poly test CLI. Bonus points if we can have poly CLI report that X number of tests were skipped.
Additional context
Kaocha test-runner also has a similar feature via:
Kaocha supports both filtering via metadata on the test-var and on the namespace. I would not consider the latter strictly necessary, but it is interesting to consider.
Is your feature request related to a problem? Please describe.
I would like to write tests that should not always be run, eg:
Describe the solution you'd like
The
cognitect.test-runnersupports this via keyword options:The filter is applied to which vars will be run: https://github.com/cognitect-labs/test-runner/blob/334f2e2a5491747dff52f9ca8cbb4a53f54d344d/src/cognitect/test_runner.clj#L27-L32
I think a solution could be to similarly support filtering out specific metadata keywords before generating the final
test-statements(after all the other logic for which bricks have changed, etc):polylith/components/test-runner/src/polylith/clj/core/test_runner/core.clj
Line 109 in 4b08954
The other question would be where to configure the inclusion/exclusions. Perhaps a combo of having defaults configured in the
workspace.ednand support for passing specific exclusion/inclusion keywords viapoly test?Describe alternatives you've considered
Right now, these kind of tests:
I would prefer if they would be first-class
deftestvars that are tagged via metadata and a way of excluding/including the tags via thepoly testCLI. Bonus points if we can havepolyCLI report that X number of tests were skipped.Additional context
Kaocha test-runner also has a similar feature via:
Kaocha supports both filtering via metadata on the test-var and on the namespace. I would not consider the latter strictly necessary, but it is interesting to consider.