junit5
junit5 copied to clipboard
Add support for configuration parameters resources
Overview
This commit adds support for specifying a properties file, for use with configuration parameters.
- Added a new field configurationParametersResources of type List<String> to store the configuration parameters resources.
- Added new methods configurationParametersResource(String propertiesFile) and configurationParametersResources(List<String> propertiesFiles) to add configuration parameters resources to the request builder.
- Updated the buildLauncherConfigurationParameters() method to include the configurationParametersResources in the Builder instance.
Related to issue: #3340
Open questions:
- ~~The
@APIannotation values, what should they be? Are they experimental or set to STABLE at once? Which version nr?~~
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
- [x] There are no TODOs left in the code
- [x] Method preconditions are checked and documented in the method's Javadoc
- [x] Coding conventions (e.g. for logging) have been followed
- [x] Change is covered by automated tests including corner cases, errors, and exception handling
- [x] Public API has Javadoc and
@APIannotations - [x] Change is documented in the User Guide and Release Notes
Question: I seem to have forgot about the picocli console runner. Should I add new picocli options for selecting a config resource file? (--config-resource perhaps?) in TestDiscoveryOptionsMixin.RuntimeConfigurationOptions
Question: I seem to have forgot about the picocli console runner. Should I add new picocli options for selecting a config resource file? (
--config-resourceperhaps?) inTestDiscoveryOptionsMixin.RuntimeConfigurationOptions
Yes, that sounds like a good idea.
Though maybe --config-resources which accepts a comma-separated list of resource paths.
Yes, that sounds like a good idea.
Though maybe
--config-resourceswhich accepts a comma-separated list of resource paths.
Or just make --config-resource repeatable, like the existing --configcli option? I think I would prefer that, instead of CSVing it.
~~Also; I couldn't help but notice that the CLI configuration parameters have a strict validation of unique key-value pairs (#1308). And am a bit confused how configuration resources should behave with that in mind.~~
~~I would prefer a similar approach as the suite annotations, eg. the explicit parameters take precedence over any property file based ones. Any suggestions or does that sound good?~~
Edit: Nevermind, I don't think it applies to this anyway. The launcher request builder is used from here, so the logic will be the same regardless. I've updated the PR with a commit for new CLI options 👍
Ping @sbrannen, do you have time to check my fixes to your requested changes?
Hi @robinjhector,
Ping @sbrannen, do you have time to check my fixes to your requested changes?
Sorry for the belated reply.
#3340 is assigned to the 5.11 M3 milestone, so somebody within the core team will hopefully find time to follow up on your PR in the relatively near future.
If you would like us to be able to process this pull request, please provide the requested information or make the requested changes. If the information is not provided or the requested changes are not made within the next 3 weeks, we will be unable to proceed and this pull request will be closed.
Closing due to lack of requested feedback. If you would like to proceed with your contribution, please provide the requested information or make the requested changes, and we will re-open this pull request.
Hi @robinjhector,
I realize quite a bit of time has passed since you originally worked on this, but do you think you'll find time to make the suggested changes and complete this PR?
If not, I imagine that someone in the team can pick it up from here.
Please let us know how you'd like to proceed.
Thanks
Hey @sbrannen ! Thanks for getting back to me, I have rebased and adjusted the code + documentation after your review. Sorry about the delay!
@robinjhector Thank you for your contribution! :+1: