Skip to content

Support multiple junit-platform.properties#5559

Open
holly-cummins wants to merge 1 commit intojunit-team:mainfrom
holly-cummins:support-multiple-config-files
Open

Support multiple junit-platform.properties#5559
holly-cummins wants to merge 1 commit intojunit-team:mainfrom
holly-cummins:support-multiple-config-files

Conversation

@holly-cummins
Copy link
Copy Markdown

Ingest properties from all junit-platform.properties files on the classpath, rather than just the first. Where the same property exists in multiple files, maintain the current behaviour.

Resolves #2794

This ended up being a fairly straightforward change, because all the testing was already in place, and just needed a slight extension for the new behaviour. What I've done is loaded all properties files with the expected name. I reverse the order so that if the same property is present in multiple files, the first occurrence 'wins'.

I also kept the warning (but with amended wording, of course). If we wanted to be really fancy we could only warn if there actually is a conflict, but I wasn't sure if the extra effort was warranted.

I strengthened the assertions in the test to equals rather than contains, since it's easy to accidentally use similar values in test properties files.

I looked through the docs but couldn't find anywhere where it says you can only have one properties file, so I don't think there's anything to change there.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

…sspath, rather than just the first. Where the same property exists in multiple files, maintain the current behaviour.

Issue: 2794
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.

Support multiple junit-platform.properties on the classpath

1 participant