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

[pull] main from junit-team:main #130

Open
wants to merge 1,457 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
1457 commits
Select commit Hold shift + click to select a range
6527613
Rename `requireArguments` to `allowZeroInvocations` (#4149)
Anmavel Nov 23, 2024
7bafb7e
Update documentation wording
juliette-derancourt Nov 23, 2024
de40dbe
Ignore asdf configuration file
marcphilipp Nov 25, 2024
b8b5dc4
Enable auto-flushing of output to fix `testfeed` details mode (#4153)
marcphilipp Nov 26, 2024
af6b502
Allow declaring exclusive resources for child nodes (#4151)
vdmitrienko Nov 26, 2024
f7c8d66
Simplify EngineTestKit usage
marcphilipp Nov 26, 2024
c1a976e
Move Jupiter-specific tests to jupiter-tests project
marcphilipp Nov 26, 2024
e3f2a09
Convert test base class to custom assertion to promote best practices
marcphilipp Nov 26, 2024
dbd4e2e
Allow attaching files to test results (#4138)
marcphilipp Nov 26, 2024
b6ea45f
Remove reference to 5.10.4 in 5.11.2 release notes
marcphilipp Oct 4, 2024
0c2285a
Removed entry backported to 5.11.1
marcphilipp Nov 27, 2024
4cb0978
Prevent `execute` subcommand warning to be emitted
sormuras Nov 27, 2024
9f1fd85
Update bnd to v7.1.0 (#4154)
renovate[bot] Nov 27, 2024
7a11032
Update plugin org.jetbrains.kotlin.jvm to v2.1.0
renovate[bot] Nov 27, 2024
58c09e1
Clean report dir before running tests to avoid test failures
marcphilipp Nov 27, 2024
ce59bef
Fix config parameter referenced in error message
marcphilipp Nov 27, 2024
7bb5f39
Update jackson monorepo to v2.18.2
renovate[bot] Nov 28, 2024
bb76a7e
Configure default timeout for all tests
marcphilipp Nov 27, 2024
09d4daf
Introduce custom wrapper around ProcessBuilder
marcphilipp Nov 27, 2024
14a4c30
Adapt GraalVmStarterTests
marcphilipp Nov 27, 2024
a70e470
Adapt GradleKotlinExtensionsTests
marcphilipp Nov 27, 2024
4fc8f82
Adapt GradleMissingEngineTests
marcphilipp Nov 27, 2024
c08cd32
Adapt GradleStarterTests
marcphilipp Nov 27, 2024
e56437d
Adapt JarDescribeModuleTests
marcphilipp Nov 27, 2024
26187f0
Adapt JavaVersionsTests
marcphilipp Nov 27, 2024
a9b4db2
Adapt MavenStarterTests
marcphilipp Nov 27, 2024
0027edc
Adapt MavenSurefireCompatibilityTests
marcphilipp Nov 27, 2024
e3349ac
Adapt MultiReleaseJarTests
marcphilipp Nov 27, 2024
2f114a2
Adapt ReflectionCompatibilityTests
marcphilipp Nov 27, 2024
ed2f704
Adapt StandaloneTests
marcphilipp Nov 27, 2024
5d0b83f
Adapt VintageGradleIntegrationTests
marcphilipp Nov 27, 2024
a0beecb
Adapt VintageMavenIntegrationTests
marcphilipp Nov 27, 2024
ff4d13f
Remove Bartholdy reference
marcphilipp Nov 27, 2024
7b488cf
Delete package cycle test as it's covered by ArchUnit
marcphilipp Nov 27, 2024
483e1cf
Remove more references to Bartholdy
marcphilipp Nov 27, 2024
2f73267
Adapt ModularUserGuideTests
marcphilipp Nov 27, 2024
d94324e
Move process ProcessStarter to main source set
marcphilipp Nov 27, 2024
6e43e27
Remove dependency on Bartholdy
marcphilipp Nov 27, 2024
45930ab
Remove no longer necessary resource locks
marcphilipp Nov 27, 2024
0839b2b
Set max pool size for parallel execution
marcphilipp Nov 27, 2024
4ca5bfd
Reduce number of Helper methods
marcphilipp Nov 28, 2024
7a4ee8e
Choose right executable on Windows
marcphilipp Nov 28, 2024
164f590
Inject versions into Gradle and Maven builds more idiomatically
marcphilipp Nov 28, 2024
eb96144
Remove unused tracking of duration
marcphilipp Nov 28, 2024
e2f5a43
Try to force the JVM to release file handles on Windows
marcphilipp Nov 28, 2024
21c24ae
Polishing
marcphilipp Nov 28, 2024
4e39fc3
Recordify WatchedOutput
marcphilipp Nov 28, 2024
79c2cdc
Make test independent of local Git repo config
marcphilipp Nov 28, 2024
33679e7
Move ProcessStarter to separate source set to allow reuse
marcphilipp Nov 28, 2024
3b84604
Add tests for Git info in Open Test Reporting XML output
marcphilipp Nov 28, 2024
ec0b681
Avoid hard-coding Java version for processStarter source set
marcphilipp Nov 28, 2024
5f1159d
Refactor UniqueIdTrackingListenerIntegrationTests to use a temp dir
marcphilipp Nov 28, 2024
a8c1d97
Hide HTML report generator output by default
marcphilipp Nov 29, 2024
f2b95b5
Avoid warning for duplicate junit-platform.properties file
marcphilipp Dec 1, 2024
a24ceb0
Update dependency com.puppycrawl.tools:checkstyle to v10.20.2
renovate[bot] Dec 1, 2024
d7d326e
Adapt to API change in open-test-reporting
marcphilipp Dec 2, 2024
88feb58
Force checking for new snapshots on CI
marcphilipp Dec 2, 2024
3e6c876
Add TODO
marcphilipp Dec 2, 2024
35a3fd6
Fix Maven integration tests on JDK 24
marcphilipp Dec 3, 2024
b49daea
Set JAVA_HOME for all Maven builds triggered from integration tests
marcphilipp Dec 3, 2024
0ecfc2f
Update plugin foojayResolver to v0.9.0 (#4166)
renovate[bot] Dec 3, 2024
7e96c90
Update github/codeql-action digest to aa57810
renovate[bot] Dec 3, 2024
d6eda8b
Update plugin org.gradle.toolchains.foojay-resolver-convention to v0.…
renovate[bot] Dec 3, 2024
74800c5
Update plugin org.graalvm.buildtools.native to v0.10.4
renovate[bot] Dec 3, 2024
f6223ec
Update actions/attest-build-provenance action to v2 (#4172)
renovate[bot] Dec 4, 2024
2f2dc33
Update dependency com.pinterest.ktlint:ktlint-cli to v1.5.0
renovate[bot] Dec 5, 2024
3580f04
Add contracts to Kotlin-specific assertions (#3259)
awelless Dec 5, 2024
7413e30
Update codecov/codecov-action digest to 7f8b4b4
renovate[bot] Dec 5, 2024
e8ca0c8
Update dependency org.eclipse.platform:org.eclipse.platform to v4.34.0
renovate[bot] Dec 6, 2024
086ac2f
Create initial 5.11.4 release notes from template
marcphilipp Dec 6, 2024
803762c
Fix IntelliJ package order config to be consistent with Spotless
marcphilipp Dec 7, 2024
e460a03
Update actions/attest-build-provenance action to v2.0.1 (#4179)
renovate[bot] Dec 8, 2024
91fd95e
Add test task using Woodstox for XML serialization
marcphilipp Dec 7, 2024
361eb6f
Delete duplicate test relying on implementation details
marcphilipp Dec 7, 2024
7cacd27
Use Unicode replacement character for illegal characters
marcphilipp Dec 7, 2024
20092d1
Add test for whitespace escaping
marcphilipp Dec 7, 2024
432d556
Implement workaround for escaping whitespace chars in attribute values
marcphilipp Dec 8, 2024
a1b2f6f
Revert to Spotless 7.0.0.BETA2 to attempt to fix build on CI
marcphilipp Dec 8, 2024
2206087
Update dependency com.fasterxml.woodstox:woodstox-core to v7.1.0
renovate[bot] Dec 8, 2024
293c178
Revert to Spotless 7.0.0.BETA1 to attempt to fix build on CI
marcphilipp Dec 8, 2024
e3715cf
Add `JAVA_25` to `JRE` enum
sormuras Dec 9, 2024
7784a45
Update actions/attest-build-provenance action to v2.1.0
renovate[bot] Dec 9, 2024
6c26fbb
Update Spotless to 7.0.0.BETA2 to attempt to fix the build on CI
marcphilipp Dec 10, 2024
59a5f77
Update github/codeql-action digest to babb554 (#4194)
renovate[bot] Dec 10, 2024
bc3ea92
Update plugin gitPublish to v5
renovate[bot] Dec 10, 2024
378cdd5
Inject username and password via new DSL
marcphilipp Dec 11, 2024
4f29473
Set reference repo URI
marcphilipp Dec 11, 2024
dab4e51
Configure Git username and email
marcphilipp Dec 11, 2024
6a4cb06
Ensure the XMLStreamWriter is closed after use
marcphilipp Dec 11, 2024
5a42e12
Revert to Spotless 6.25.0 to attempt to fix build on CI
marcphilipp Dec 11, 2024
d7e765c
Move #4153 to 5.11.4 release notes
marcphilipp Dec 11, 2024
7f4361d
Finalize 5.11.4 release notes
marcphilipp Dec 12, 2024
bf0c912
Update plugin develocity to v3.19
renovate[bot] Dec 12, 2024
29f88c1
Update dependency com.puppycrawl.tools:checkstyle to v10.21.0
renovate[bot] Dec 13, 2024
1b4dce5
Update github/codeql-action digest to df409f7
renovate[bot] Dec 13, 2024
ebf60bb
Add comments explaining lack of contracts for `Executable` parameter
marcphilipp Dec 13, 2024
22f4f21
Remove duplicate entry from 5.11.4
marcphilipp Dec 13, 2024
dcb4f49
Update log4j2 monorepo to v2.24.3
renovate[bot] Dec 13, 2024
779ee68
Report captured output using OTR's new dedicated XML element (#4199)
marcphilipp Dec 16, 2024
3997952
Attribute non-test thread output to most recent test thread (#4200)
marcphilipp Dec 16, 2024
540639d
Release 5.11.4
marcphilipp Dec 16, 2024
efa1527
Remove JDK 22 build as it's EOL
marcphilipp Dec 16, 2024
16c6f72
Add include/exclude-based filtering for auto-detected extensions (#4120)
YongGoose Dec 16, 2024
24881de
Update actions/upload-artifact digest to 6f51ac0 (#4204)
renovate[bot] Dec 18, 2024
01d4d67
Update gradle/actions digest to 0bdd871
renovate[bot] Dec 18, 2024
5da1e6c
Update actions/setup-java digest to 7a6d8a8
renovate[bot] Dec 18, 2024
3aa0f48
Update codecov/codecov-action digest to 1e68e06
renovate[bot] Dec 18, 2024
6fb2ea3
Allow third parties to provide a custom `ClasspathScanner` implementa…
juliette-derancourt Dec 19, 2024
f95e249
Fail `@ParameterizedTest` if there are no registered `ArgumentProvide…
juliette-derancourt Dec 19, 2024
47af824
Add mandatory media type for publishing files
marcphilipp Dec 19, 2024
0447db6
Include media type in Open Test Report XML output
marcphilipp Dec 19, 2024
f1b5d7a
Fix test on Windows
marcphilipp Dec 19, 2024
aa922c7
Capture process output as file attachments
marcphilipp Dec 19, 2024
7593ded
Add native-image.properties files to jars (#4208)
marcphilipp Dec 20, 2024
d36d653
Document #4207 in release notes
marcphilipp Dec 20, 2024
c1efd00
Update dependency org.assertj:assertj-core to v3.27.0
renovate[bot] Dec 20, 2024
f535af3
Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1…
renovate[bot] Dec 20, 2024
963a9fd
Update github/codeql-action digest to 48ab28a
renovate[bot] Dec 20, 2024
77b7614
Update dependency gradle to v8.12
renovate[bot] Dec 20, 2024
efc375d
Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1…
renovate[bot] Dec 21, 2024
863e4d4
Update dependency com.puppycrawl.tools:checkstyle to v10.21.1
renovate[bot] Dec 28, 2024
5a4e409
Update asciidoctor.plugins to v4.0.4
renovate[bot] Dec 28, 2024
bd3b945
Work around CVE-2024-12798 and CVE-2024-12801 in Logback
marcphilipp Dec 30, 2024
f5137fb
Depend on macOS instead of Linux job because it's faster on average
marcphilipp Dec 31, 2024
6db5a0d
Extract methods to improve readability
marcphilipp Dec 31, 2024
529da15
Extract more methods to improve readability
marcphilipp Dec 31, 2024
bd7db61
Fail build when assembling a release version that depends on snapshot…
marcphilipp Dec 31, 2024
0a9374d
Use lazy filtering API
marcphilipp Dec 31, 2024
9d8d864
Move script closer to GitHub Actions workflow
marcphilipp Jan 1, 2025
3c10fd2
Add workflow to verify reproducibility of binary release artifacts (#…
marcphilipp Jan 1, 2025
f86eedd
Update dependency org.assertj:assertj-core to v3.27.1
renovate[bot] Jan 1, 2025
0af1e2c
Replace usage of deprecated API
marcphilipp Jan 2, 2025
057debc
Fix typo
marcphilipp Jan 2, 2025
98422b4
Update Open Test Reporting to 0.2.0-M2
marcphilipp Jan 2, 2025
d0294f3
Remove snapshot dependency setup
marcphilipp Jan 2, 2025
767150e
Update mockito monorepo to v5.15.2
renovate[bot] Jan 2, 2025
ccaab7b
Automate verification of releases artifact consumability (#4227)
marcphilipp Jan 3, 2025
29666e5
Set up sbt explicitly because it will be dropped in ubuntu-24.04
marcphilipp Jan 3, 2025
7d878b8
Add job for releasing the staging repository
marcphilipp Jan 3, 2025
31e7b80
Add job for publishing documentation
marcphilipp Jan 3, 2025
6f3ea40
Add job for closing the GitHub milestone of the release
marcphilipp Jan 3, 2025
d071110
Add job for waiting for sync to Maven Central
marcphilipp Jan 3, 2025
d88001d
Add job for updating samples after sync to Maven Central was successful
marcphilipp Jan 3, 2025
279d78f
Add job for creating a GitHub release
marcphilipp Jan 3, 2025
8362ee8
Check out release tag
marcphilipp Jan 3, 2025
821c794
Pin dependencies
renovate[bot] Jan 3, 2025
e481459
Update copyright template
marcphilipp Jan 5, 2025
ee52c64
Update copyright headers
junit-builds Jan 5, 2025
a68309a
Update dependency org.assertj:assertj-core to v3.27.2
renovate[bot] Jan 5, 2025
ef13c44
Update dependency ch.qos.logback:logback-core to v1.5.16
renovate[bot] Jan 5, 2025
00b22a7
Introduce dry-run mode
marcphilipp Jan 6, 2025
1b5006a
Inject repository owner for testing
marcphilipp Jan 6, 2025
c7c918c
Inject custom GitHub token
marcphilipp Jan 6, 2025
b1484ed
Shorten names to improve summary graph
marcphilipp Jan 6, 2025
71b3cdb
Checkout repo prior to running script
marcphilipp Jan 6, 2025
b479c50
Inject GitHub credentials
marcphilipp Jan 6, 2025
7a9e5ae
Improve error message
marcphilipp Jan 6, 2025
28f1940
Print Git status prior to creating commit
marcphilipp Jan 6, 2025
42809a7
Simplify github-script jobs again
marcphilipp Jan 6, 2025
3970316
Remove dry-run mode after local testing
marcphilipp Jan 6, 2025
4f926ed
Document #4120 in release notes
marcphilipp Jan 7, 2025
0a55239
Move entry to Platform section
marcphilipp Jan 7, 2025
7664e38
Update plugin spotless to v7
renovate[bot] Jan 7, 2025
bebff41
Revert "Update plugin spotless to v7"
marcphilipp Jan 8, 2025
cc2f60c
Introduce from and to attributes on @EnumSource (#4221)
yhkuo41 Jan 8, 2025
3e040d0
Support parallelization in junit-vintage-engine (#4135)
YongGoose Jan 8, 2025
23cf286
Close milestone early to avoid late failures in the workflow
marcphilipp Jan 9, 2025
e2e093a
Set milestone date when closing
marcphilipp Jan 9, 2025
d01905f
Inject Sonatype credentials
marcphilipp Jan 9, 2025
872d95a
Install Graphviz prior to building documentation
marcphilipp Jan 9, 2025
097b7bf
Remove unnecessary timeout
marcphilipp Jan 9, 2025
9130f38
Document release steps as a checklist (#4239)
marcphilipp Jan 10, 2025
7998275
Update actions/upload-artifact digest to 65c4c4a
renovate[bot] Jan 10, 2025
28a261e
Update github/codeql-action digest to b6a472f
renovate[bot] Jan 11, 2025
86a64bb
Update dependency gg.jte:jte to v3.1.16
renovate[bot] Jan 14, 2025
1a03531
Check for classpath alignment on LinkageErrors (#4244)
marcphilipp Jan 15, 2025
f07e3ff
Document that `AnnotationSupport.isAnnotated()` does not find repeata…
YongGoose Jan 16, 2025
4130009
Update graalvm/setup-graalvm digest to c09e29b (#4247)
renovate[bot] Jan 17, 2025
f3536d3
Update dependency org.assertj:assertj-core to v3.27.3
renovate[bot] Jan 18, 2025
72d668a
Make OutputDirectoryProvider available via ExecutionRequest
marcphilipp Jan 18, 2025
4fa576f
Remove logging to SYS_ERR in test
sbrannen Jan 19, 2025
57e20cd
Revise Javadoc and release notes regarding void lookups
sbrannen Jan 19, 2025
30cbe62
Move Kotlin contracts release note to correct section
sbrannen Jan 19, 2025
254ca62
Revise recent changes to @⁠ResourceLock and related APIs
sbrannen Jan 19, 2025
2e14b3d
Revise release notes for 5.12 M1
sbrannen Jan 19, 2025
d583ab0
Fix Javadoc errors
sbrannen Jan 19, 2025
f6eff60
Polish Javadoc in TestTemplateInvocationContextProvider
sbrannen Jan 20, 2025
dde72a9
Polishing
sbrannen Jan 20, 2025
5fd9e88
Remove Void wrapper registration in ReflectionUtils
sbrannen Jan 20, 2025
3f40a7e
Update @⁠since/@⁠API versions in Reflection[Support|Utils] plus polis…
sbrannen Jan 20, 2025
9bddac8
Update Javadoc due to changes in 5fd9e88d07
sbrannen Jan 20, 2025
0fe36c7
Increase test coverage for ReflectionUtils.tryToLoadClass()
sbrannen Jan 20, 2025
2bae68b
Delete cases covered by `Class.forName()`
sormuras Jan 17, 2025
5ca0ced
Fix grammar in Javadoc for NestedMethodSelector
sbrannen Jan 21, 2025
aec4ad9
Update plugin commonCustomUserData to v2.1
renovate[bot] Jan 22, 2025
ba3a4ff
Update actions/stale digest to 5bef64f (#4253)
renovate[bot] Jan 22, 2025
10eeeda
Update github/codeql-action digest to d68b2d4 (#4255)
renovate[bot] Jan 22, 2025
ab41b23
Update codecov/codecov-action digest to 5a605bd (#4257)
renovate[bot] Jan 22, 2025
15539b0
Update graalvm/setup-graalvm digest to aafbedb (#4254)
renovate[bot] Jan 23, 2025
5cb4571
Update actions/attest-build-provenance action to v2.2.0 (#4258)
renovate[bot] Jan 23, 2025
21bb094
Update github/codeql-action digest to dd196fa (#4260)
renovate[bot] Jan 23, 2025
544c3b2
Update plugin plantuml to v8.12
renovate[bot] Jan 23, 2025
3583e01
Use separate local Maven repos when file system type is NTFS (#4259)
marcphilipp Jan 23, 2025
292f6a0
Revert "Use Gradle's new daemon JVM criteria feature"
marcphilipp Jan 23, 2025
9d45d42
Update plugin versions to v0.52.0 (#4262)
renovate[bot] Jan 23, 2025
e78ca1d
Update plugin develocity to v3.19.1
renovate[bot] Jan 23, 2025
73d7f12
Update github/codeql-action digest to ee117c9
renovate[bot] Jan 23, 2025
bf08ea2
Update codecov/codecov-action digest to 0da7aa6
renovate[bot] Jan 24, 2025
6d260da
Remove Twitter/X
marcphilipp Jan 24, 2025
a1a5353
Update codecov/codecov-action digest to 13ce06b
renovate[bot] Jan 26, 2025
9149fb8
Update github/codeql-action digest to f6091c0
renovate[bot] Jan 26, 2025
4c382d0
Update dependency gradle to v8.12.1
renovate[bot] Jan 26, 2025
80a22b6
Update dependency org.apache.groovy:groovy to v4.0.25 (#4273)
renovate[bot] Jan 26, 2025
7b4b972
Revert to older Eclipse version to fix Spotless issue on CI
marcphilipp Jan 26, 2025
ca7bb80
Revert "Revert to older Eclipse version to fix Spotless issue on CI"
marcphilipp Jan 26, 2025
060f4db
Pass enclosing instance types to `DisplayNameGenerators` (#4266)
marcphilipp Jan 26, 2025
511ab7d
Provide runtime enclosing instance types to `ResourceLocksProviders`
marcphilipp Jan 26, 2025
b7349b4
Update dependency com.puppycrawl.tools:checkstyle to v10.21.2 (#4274)
renovate[bot] Jan 27, 2025
7d66196
Re-open completed non-task/-question issues without assigned milestone
marcphilipp Jan 27, 2025
e6446ff
Remove milestone assignment from issues closed as "not planned"
marcphilipp Jan 27, 2025
f93b1fc
Support `@TempDir` constructor injection for Java record classes (#4279)
marcphilipp Jan 27, 2025
3fa27e9
Add "Getting Started" section (#4280)
marcphilipp Jan 27, 2025
ed68831
Check for `DisplayNameGeneration` annotations on runtime enclosing types
marcphilipp Jan 27, 2025
b4ea6ec
Update plugin org.jetbrains.kotlin.jvm to v2.1.10 (#4278)
renovate[bot] Jan 27, 2025
7372246
Suppress deprecation warning
sbrannen Jan 27, 2025
495ed6c
Configure Spotless for module descriptors and update copyright
marcphilipp Jan 27, 2025
69c248f
Configure Spotless for Groovy sources and update copyright
marcphilipp Jan 27, 2025
6532cd3
Simplify regex since module descriptors are handled separately
marcphilipp Jan 27, 2025
ae9fe7f
Update github/codeql-action digest to 17a820b
renovate[bot] Jan 27, 2025
36019b7
Use ListIterator to improve support for non-random-access lists
marcphilipp Jan 28, 2025
63d97b1
Pass unmodifiable lists to `ResourceLocksProvider`
marcphilipp Jan 28, 2025
a6343e4
Pass unmodifiable lists to `DisplayNameGenerator`
marcphilipp Jan 28, 2025
c9438d5
Update actions/setup-java digest to 3a4f6e1 (#4286)
renovate[bot] Jan 29, 2025
0211454
Include AnnotatedElement description in @⁠TempDir log messages
sbrannen Jan 29, 2025
d9848df
Polishing
sbrannen Jan 29, 2025
f45b882
Polishing
sbrannen Jan 29, 2025
3246321
Fully document that @⁠TempDir can be used on constructor parameters
sbrannen Jan 29, 2025
712f2af
Suppress warnings in Kotlin tests
marcphilipp Jan 30, 2025
64c2973
Use ubuntu-latest now that 24.04 has been rolled out as default
marcphilipp Jan 30, 2025
4be0622
Update github/codeql-action digest to dd74661
renovate[bot] Jan 30, 2025
0c64782
Update gradle/actions digest to 94baf22
renovate[bot] Jan 30, 2025
b30caa2
Update plugin jmh to v0.7.3
renovate[bot] Jan 30, 2025
0b474f0
Remove no longer necessary workaround
marcphilipp Jan 31, 2025
42055f0
Finalize release notes for 5.12.0-M1
marcphilipp Jan 31, 2025
11fd60c
Release 5.12.0-M1
marcphilipp Jan 31, 2025
e27d27a
Back to snapshots for further development
marcphilipp Jan 31, 2025
b04fe73
Add initial 5.12.0-RC1 release notes from template
marcphilipp Jan 31, 2025
6900696
Match all PR branches
marcphilipp Jan 31, 2025
0ba92b4
Don't trigger when pushing a tag to avoid deploying to staging repo
marcphilipp Jan 31, 2025
907a13b
Update plugin shadow to v8.3.6 (#4295)
renovate[bot] Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow declaring exclusive resources for child nodes (junit-team#4151)
Allow declaring "shared resources" for direct child nodes via the new 
`@ResourceLock(target = CHILDREN)` attribute.

Using the `@ResourceLock(target = CHILDREN)` in a class-level annotation
has the same semantics as adding an annotation with the same value and 
mode to each test method and nested test class declared in this class.

This may improve parallelization when a test class declares a `READ` 
lock, but only a few methods hold a `READ_WRITE` lock.

Resolves junit-team#3102.

---------

Co-authored-by: Marc Philipp <mail@marcphilipp.de>
vdmitrienko and marcphilipp authored Nov 26, 2024
commit af6b502e373a7f80150433e95aed5cd6af39e87b
1 change: 1 addition & 0 deletions documentation/src/docs/asciidoc/link-attributes.adoc
Original file line number Diff line number Diff line change
@@ -128,6 +128,7 @@ endif::[]
:Execution: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/parallel/Execution.html[@Execution]
:Isolated: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/parallel/Isolated.html[@Isolated]
:ResourceLock: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/parallel/ResourceLock.html[@ResourceLock]
:ResourceLockTarget: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/parallel/ResourceLockTarget.html[ResourceLockTarget]
:ResourceLocksProvider: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/parallel/ResourceLocksProvider.html[ResourceLocksProvider]
:Resources: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/parallel/Resources.html[Resources]
// Jupiter Extension APIs
Original file line number Diff line number Diff line change
@@ -91,6 +91,9 @@ JUnit repository on GitHub.
the absence of invocations is expected in some cases and should not cause a test failure.
* Allow determining "shared resources" at runtime via the new `@ResourceLock#providers`
attribute that accepts implementations of `ResourceLocksProvider`.
* Allow declaring "shared resources" for _direct_ child nodes via the new
`@ResourceLock(target = CHILDREN)` attribute. This may improve parallelization when
a test class declares a `READ` lock, but only a few methods hold a `READ_WRITE` lock.
* Extensions that implement `TestInstancePreConstructCallback`, `TestInstanceFactory`,
`TestInstancePostProcessor`, `ParameterResolver`, or `InvocationInterceptor` may
override the `getTestInstantiationExtensionContextScope()` method to enable receiving
24 changes: 23 additions & 1 deletion documentation/src/docs/asciidoc/user-guide/writing-tests.adoc
Original file line number Diff line number Diff line change
@@ -2992,7 +2992,7 @@ Note that resources declared statically with `{ResourceLock}` annotation are com
resources added dynamically by `{ResourceLocksProvider}` implementations.

If the tests in the following example were run in parallel _without_ the use of
{ResourceLock}, they would be _flaky_. Sometimes they would pass, and at other times they
`{ResourceLock}`, they would be _flaky_. Sometimes they would pass, and at other times they
would fail due to the inherent race condition of writing and then reading the same JVM
System Property.

@@ -3029,6 +3029,28 @@ include::{testDir}/example/sharedresources/StaticSharedResourcesDemo.java[tags=u
include::{testDir}/example/sharedresources/DynamicSharedResourcesDemo.java[tags=user_guide]
----

Also, "static" shared resources can be declared for _direct_ child nodes via the `target`
attribute in the `{ResourceLock}` annotation, the attribute accepts a value from
the `{ResourceLockTarget}` enum.

Specifying `target = CHILDREN` in a class-level `{ResourceLock}` annotation
has the same semantics as adding an annotation with the same `value` and `mode`
to each test method and nested test class declared in this class.

This may improve parallelization when a test class declares a `READ` lock,
but only a few methods hold a `READ_WRITE` lock.

Tests in the following example would run in the `SAME_THREAD` if the `{ResourceLock}`
didn't have `target = CHILDREN`. This is because the test class declares a `READ`
shared resource, but one test method holds a `READ_WRITE` lock,
which would force the `SAME_THREAD` execution mode for all the test methods.

[source,java]
.Declaring shared resources for child nodes with `target` attribute
----
include::{testDir}/example/sharedresources/ChildrenSharedResourcesDemo.java[tags=user_guide]
----


[[writing-tests-built-in-extensions]]
=== Built-in Extensions
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2015-2024 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* https://www.eclipse.org/legal/epl-v20.html
*/

package example.sharedresources;

import static org.junit.jupiter.api.parallel.ExecutionMode.CONCURRENT;
import static org.junit.jupiter.api.parallel.ResourceAccessMode.READ;
import static org.junit.jupiter.api.parallel.ResourceAccessMode.READ_WRITE;
import static org.junit.jupiter.api.parallel.ResourceLockTarget.CHILDREN;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ResourceLock;

// tag::user_guide[]
@Execution(CONCURRENT)
@ResourceLock(value = "a", mode = READ, target = CHILDREN)
public class ChildrenSharedResourcesDemo {

@ResourceLock(value = "a", mode = READ_WRITE)
@Test
void test1() throws InterruptedException {
Thread.sleep(2000L);
}

@Test
void test2() throws InterruptedException {
Thread.sleep(2000L);
}

@Test
void test3() throws InterruptedException {
Thread.sleep(2000L);
}

@Test
void test4() throws InterruptedException {
Thread.sleep(2000L);
}

@Test
void test5() throws InterruptedException {
Thread.sleep(2000L);
}

}
// end::user_guide[]
Original file line number Diff line number Diff line change
@@ -46,21 +46,44 @@
*
* <p>This annotation can be repeated to declare the use of multiple shared resources.
*
* <p>Uniqueness of a shared resource is identified by both {@link #value()} and
* {@link #mode()}. Duplicated shared resources do not cause errors.
*
* <p>Since JUnit Jupiter 5.4, this annotation is {@linkplain Inherited inherited}
* within class hierarchies.
*
* <p>Since JUnit Jupiter 5.12, this annotation supports adding shared resources
* dynamically at runtime via {@link ResourceLock#providers}.
* dynamically at runtime via {@link #providers}.
*
* <p>Resources declared "statically" using {@link #value()} and {@link #mode()}
* are combined with "dynamic" resources added via {@link #providers()}.
* For example, declaring resource "A" via {@code @ResourceLock("A")}
* and resource "B" via a provider returning {@code new Lock("B")} will result
* in two shared resources "A" and "B".
*
* <p>Since JUnit Jupiter 5.12, this annotation supports declaring "static"
* shared resources for <em>direct</em> child nodes via the {@link #target()}
* attribute.
*
* <p>Using the {@link ResourceLockTarget#CHILDREN} in a class-level
* annotation has the same semantics as adding an annotation with the same
* {@link #value()} and {@link #mode()} to each test method and nested test
* class declared in this class.
*
* <p>This may improve parallelization when a test class declares a
* {@link ResourceAccessMode#READ READ} lock, but only a few methods hold
* {@link ResourceAccessMode#READ_WRITE READ_WRITE} lock.
*
* <p>Note that the {@code target = CHILDREN} means that
* {@link #value()} and {@link #mode()} no longer apply to a node
* declaring the annotation. However, the {@link #providers()} attribute
* remains applicable, and the target of "dynamic" shared resources
* added via implementations of {@link ResourceLocksProvider} is not changed.
*
* @see Isolated
* @see Resources
* @see ResourceAccessMode
* @see ResourceLockTarget
* @see ResourceLocks
* @see ResourceLocksProvider
* @since 5.3
@@ -92,6 +115,20 @@
*/
ResourceAccessMode mode() default ResourceAccessMode.READ_WRITE;

/**
* The target of a resource created from {@link #value()} and {@link #mode()}.
*
* <p>Defaults to {@link ResourceLockTarget#SELF SELF}.
*
* <p>Note that using {@link ResourceLockTarget#CHILDREN} in
* a method-level annotation results in an exception.
*
* @see ResourceLockTarget
* @since 5.12
*/
@API(status = EXPERIMENTAL, since = "5.12")
ResourceLockTarget target() default ResourceLockTarget.SELF;

/**
* An array of one or more classes implementing {@link ResourceLocksProvider}.
*
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2015-2024 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* https://www.eclipse.org/legal/epl-v20.html
*/

package org.junit.jupiter.api.parallel;

import static org.apiguardian.api.API.Status.EXPERIMENTAL;

import org.apiguardian.api.API;

/**
* {@code ResourceLockTarget} is used to define the target of a shared resource.
*
* @since 5.12
* @see ResourceLock#target()
*/
@API(status = EXPERIMENTAL, since = "5.12")
public enum ResourceLockTarget {

/**
* Add a shared resource to the current node.
*/
SELF,

/**
* Add a shared resource to the <em>direct</em> children of the current node.
*
* <p>Examples of "parent - child" relationship in the context of
* {@link ResourceLockTarget}:
* <ul>
* <li>a test class
* - test methods and nested test classes declared in the class.</li>
* <li>a nested test class
* - test methods and nested test classes declared in the nested class.
* </li>
* <li>a test method
* - considered to have no children. Using {@code CHILDREN} for
* a test method results in an exception.</li>
* </ul>
*/
CHILDREN

}
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@

package org.junit.jupiter.engine.descriptor;

import static org.junit.jupiter.api.parallel.ResourceLockTarget.SELF;
import static org.junit.platform.commons.support.AnnotationSupport.findRepeatableAnnotations;
import static org.junit.platform.commons.util.CollectionUtils.toUnmodifiableList;

@@ -22,6 +23,7 @@

import org.junit.jupiter.api.parallel.ResourceAccessMode;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.api.parallel.ResourceLockTarget;
import org.junit.jupiter.api.parallel.ResourceLocksProvider;
import org.junit.platform.commons.JUnitException;
import org.junit.platform.commons.util.ReflectionUtils;
@@ -42,7 +44,7 @@ Stream<ExclusiveResource> getAllExclusiveResources(
}

@Override
public Stream<ExclusiveResource> getStaticResources() {
Stream<ExclusiveResource> getStaticResourcesFor(ResourceLockTarget target) {
return Stream.empty();
}

@@ -55,10 +57,10 @@ Stream<ExclusiveResource> getDynamicResources(

Stream<ExclusiveResource> getAllExclusiveResources(
Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks) {
return Stream.concat(getStaticResources(), getDynamicResources(providerToLocks));
return Stream.concat(getStaticResourcesFor(SELF), getDynamicResources(providerToLocks));
}

abstract Stream<ExclusiveResource> getStaticResources();
abstract Stream<ExclusiveResource> getStaticResourcesFor(ResourceLockTarget target);

abstract Stream<ExclusiveResource> getDynamicResources(
Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks);
@@ -78,9 +80,10 @@ private static class DefaultExclusiveResourceCollector extends ExclusiveResource
}

@Override
public Stream<ExclusiveResource> getStaticResources() {
Stream<ExclusiveResource> getStaticResourcesFor(ResourceLockTarget target) {
return annotations.stream() //
.filter(annotation -> StringUtils.isNotBlank(annotation.value())) //
.filter(annotation -> annotation.target() == target) //
.map(annotation -> new ExclusiveResource(annotation.value(), toLockMode(annotation.mode())));
}

Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
package org.junit.jupiter.engine.descriptor;

import static org.apiguardian.api.API.Status.INTERNAL;
import static org.junit.jupiter.api.parallel.ResourceLockTarget.CHILDREN;
import static org.junit.jupiter.engine.descriptor.DisplayNameUtils.determineDisplayNameForMethod;
import static org.junit.platform.commons.util.CollectionUtils.forEachInReverseOrder;

@@ -27,6 +28,7 @@
import org.junit.jupiter.api.parallel.ResourceLocksProvider;
import org.junit.jupiter.engine.config.JupiterConfiguration;
import org.junit.jupiter.engine.execution.JupiterEngineExecutionContext;
import org.junit.platform.commons.JUnitException;
import org.junit.platform.commons.logging.Logger;
import org.junit.platform.commons.logging.LoggerFactory;
import org.junit.platform.commons.util.ClassUtils;
@@ -82,7 +84,15 @@ public final Set<TestTag> getTags() {
@Override
public ExclusiveResourceCollector getExclusiveResourceCollector() {
// There's no need to cache this as this method should only be called once
return ExclusiveResourceCollector.from(getTestMethod());
ExclusiveResourceCollector collector = ExclusiveResourceCollector.from(getTestMethod());

if (collector.getStaticResourcesFor(CHILDREN).findAny().isPresent()) {
String message = "'ResourceLockTarget.CHILDREN' is not supported for methods." + //
" Invalid method: " + getTestMethod();
throw new JUnitException(message);
}

return collector;
}

@Override
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@

package org.junit.jupiter.engine.descriptor;

import static org.junit.jupiter.api.parallel.ResourceLockTarget.CHILDREN;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Set;
@@ -37,11 +39,15 @@ default Stream<ExclusiveResource> determineExclusiveResources() {
return determineOwnExclusiveResources();
}

Stream<ExclusiveResource> parentStaticResourcesForChildren = ancestors.getLast() //
.getExclusiveResourceCollector().getStaticResourcesFor(CHILDREN);

Stream<ExclusiveResource> ancestorDynamicResources = ancestors.stream() //
.map(ResourceLockAware::getExclusiveResourceCollector) //
.flatMap(collector -> collector.getDynamicResources(this::evaluateResourceLocksProvider));

return Stream.concat(ancestorDynamicResources, determineOwnExclusiveResources());
return Stream.of(ancestorDynamicResources, parentStaticResourcesForChildren, determineOwnExclusiveResources())//
.flatMap(s -> s);
}

default Stream<ExclusiveResource> determineOwnExclusiveResources() {

Large diffs are not rendered by default.