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

Support snippets of test configuration to be merged into settings #457

Closed
tengstrand opened this issue Mar 29, 2024 · 2 comments
Closed

Comments

@tengstrand
Copy link
Collaborator

tengstrand commented Mar 29, 2024

There is a need for test configuration to be merged into the settings, e.g. when running the external test runner, see this comment.

We could solve this by adding a :test-configs key to workspace.edn, e.g.

{
 ...
 :test-configs {:external-test-runner {:create-test-runner [org.corfield.external-test-runner.interface/create]}
                :kaocha-test-runner   {:create-test-runner polylith-kaocha.test-runner/create}
                :exclude-stuff        {:org.corfield/external-test-runner {:focus {:exclude [:stuff]}}}}}
                :exclude-integration  {:org.corfield/external-test-runner {:focus {:exclude [:integration]}}}
}

The Kaocha test runner can now be selected with:

poly test with:kaocha-test-runner

Or the External test runner, without the integration tests:

poly test with:external-test-runner:exclude-integration

The idea is that the selected configuration snippets will be merged to the :test key in the workspace configuration, and if the value lives in a collection (e.g. vector or hash map) it will be added to existing values, e.g.:

poly test with:external-test-runner:exclude-integration:exclude-stuff

Will end up as:

:test {:create-test-runner [org.corfield.external-test-runner.interface/create]
       :org.corfield/external-test-runner {:focus {:exclude [:integration :stuff]}}}

If we run commands from a shell, we will also get autocomplete for the with option.

@seancorfield
Copy link
Contributor

That's nice -- it wouldn't support complete ad hoc test settings (per my original discussion on Slack) but it would make it much less verbose to support a specific set of test settings which should be sufficient, and it would be no big deal to add more :test-configs as needed for a given project for any combination of additional settings. A good compromise, esp. with the auto-complete support this would bring.

tengstrand added a commit that referenced this issue Mar 31, 2024
Issue #457. Support snippets of test configuration to be merged into settings
0.2.20-SNAPSHOT #13
@seancorfield
Copy link
Contributor

Nice! I'll finish up my work on seancorfield/polylith-external-test-runner#5 and seancorfield/polylith-external-test-runner#6 and document usage per this new machinery in Polylith.

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

No branches or pull requests

2 participants