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

Add support for configuration parameters resources #3345

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

robinjhector
Copy link

@robinjhector robinjhector commented Jun 8, 2023

Overview

This commit adds support for specifying a properties file, for use with configuration parameters.

  • Added a new field configurationParametersResources of type List to store the configuration parameters resources.
  • Added new methods configurationParametersResource(String propertiesFile) and configurationParametersResources(List 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 @API annotation 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

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: junit-team#3340
@robinjhector
Copy link
Author

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

@sbrannen
Copy link
Member

sbrannen commented Jun 9, 2023

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

Yes, that sounds like a good idea.

Though maybe --config-resources which accepts a comma-separated list of resource paths.

Copy link
Member

@sbrannen sbrannen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting the PR.

I requested a few minor changes.

@robinjhector
Copy link
Author

robinjhector commented Jun 9, 2023

Yes, that sounds like a good idea.

Though maybe --config-resources which 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 👍

@robinjhector robinjhector force-pushed the configuration-parameter-resources branch from e5ff689 to 628a605 Compare June 9, 2023 09:19
Adjusted annotation parameter name to `value()`.
Scrapped duplicate configurationParametersResources method on discovery request builder. (Is now var-args)
@robinjhector robinjhector force-pushed the configuration-parameter-resources branch from 628a605 to 1d12ffc Compare June 9, 2023 09:31
@robinjhector
Copy link
Author

Ping @sbrannen, do you have time to check my fixes to your requested changes?

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

Successfully merging this pull request may close these issues.

None yet

2 participants