Skip to content

Conversation

@marcphilipp
Copy link
Member

@marcphilipp marcphilipp commented Aug 13, 2020

This commit introduces a new global resource lock "global" that all
test descriptors that are children of the engine descriptor acquire by
default in READ mode. Using the @Isolated annotation in the Jupiter
API causes the mode to be changed to READ_WRITE.

Will eventually resolve #2142.


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


Definition of Done

This commit introduces a new global resource lock "__global__" that all
test descriptors that are children of the engine descriptor acquire by
default in READ mode. Using the `@Isolated` annotation in the Jupiter
API causes the mode to be changed to READ_WRITE.

Co-authored-by: Leonard Brünings <[email protected]>
@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #2382 into main will increase coverage by 0.00%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #2382   +/-   ##
=========================================
  Coverage     89.84%   89.84%           
- Complexity     4533     4542    +9     
=========================================
  Files           397      397           
  Lines         11211    11233   +22     
  Branches        909      908    -1     
=========================================
+ Hits          10072    10092   +20     
- Misses          863      864    +1     
- Partials        276      277    +1     
Impacted Files Coverage Δ Complexity Δ
...tform/engine/support/hierarchical/LockManager.java 92.00% <85.71%> (-8.00%) 12.00 <9.00> (+1.00) ⬇️
...engine/support/hierarchical/ExclusiveResource.java 77.27% <100.00%> (+2.27%) 8.00 <1.00> (+1.00)
...rm/engine/support/hierarchical/NodeTreeWalker.java 100.00% <100.00%> (ø) 14.00 <6.00> (+5.00)
...orm/launcher/core/EngineExecutionOrchestrator.java 100.00% <0.00%> (ø) 12.00% <0.00%> (ø%)
...junit/platform/launcher/core/InternalTestPlan.java 96.29% <0.00%> (+0.64%) 17.00% <0.00%> (+2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89c708e...30f1955. Read the comment docs.

@marcphilipp marcphilipp marked this pull request as ready for review August 15, 2020 09:15
@marcphilipp marcphilipp requested a review from leonard84 August 15, 2020 09:16
@marcphilipp marcphilipp merged commit 8760ec1 into main Aug 15, 2020
@marcphilipp marcphilipp deleted the issues/2142-isolated-test-execution branch August 15, 2020 14:47
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
@ResourceLock("org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY")
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if the constant could be declared in the interface, so it could be referenced from ExclusiveResource

Copy link
Member Author

Choose a reason for hiding this comment

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

jupiter-api doesn't have a dependency on platform-engine or vice versa.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to run some tests isolated

4 participants