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
@sormuras
Copy link
Copy Markdown
Member

sormuras commented Apr 14, 2026

Hi Holly, I started the CI checks - and expect only the "Cross-Version / OpenJDK 27 (ea)" one to fail (due to #5605).

I note that the underlying issue

is still under discussion.

@testlens-app
Copy link
Copy Markdown

testlens-app bot commented Apr 14, 2026

✅ All tests passed ✅

🏷️ Commit: ec5e192
▶️ Tests: 27689 executed
⚪️ Checks: 16/16 completed


Learn more about TestLens at testlens.app.

@holly-cummins
Copy link
Copy Markdown
Author

Oh dear, it looks like the Leyden job is failing as well (https://github.com/junit-team/junit-framework/actions/runs/23615551087/job/71287894863?pr=5559). It looks like either a hang or excessive slowness. I can't see anything obviously related to my changes in the thread dumps.

(Thanks for kicking the jobs off, @sormuras!)

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

2 participants