Skip to content

Execute tests in parallel - #5944

Merged
schalkms merged 4 commits into
detekt:mainfrom
Goooler:test_parallel
Apr 1, 2023
Merged

Execute tests in parallel#5944
schalkms merged 4 commits into
detekt:mainfrom
Goooler:test_parallel

Conversation

@Goooler

@Goooler Goooler commented Mar 27, 2023

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Mar 27, 2023

Copy link
Copy Markdown

Codecov Report

Merging #5944 (52289e5) into main (a3dfea2) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #5944   +/-   ##
=========================================
  Coverage     84.48%   84.48%           
  Complexity     3788     3788           
=========================================
  Files           546      546           
  Lines         12937    12937           
  Branches       2275     2275           
=========================================
  Hits          10930    10930           
  Misses          877      877           
  Partials       1130     1130           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@3flex

3flex commented Mar 28, 2023

Copy link
Copy Markdown
Member

I'm not sure why I haven't tried this earlier!

I think we should be a bit less aggressive though and use the suggestion from the Gradle docs which caps forks to half the processor count at most.

@Goooler

Goooler commented Mar 28, 2023

Copy link
Copy Markdown
Contributor Author

I believe we can use Runtime.getRuntime().availableProcessors() on CI, which means full cores, there are 2 cores in GHA runners, use (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1 (result is 1) here seems to be less improvement on CI.

@3flex

3flex commented Mar 28, 2023

Copy link
Copy Markdown
Member

I was thinking about local builds. Maybe make it conditional on CI environment variable to use all cores in CI but not when building locally.

Comment thread build-logic/src/main/kotlin/module.gradle.kts Outdated
Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
@BraisGabin BraisGabin added this to the 1.23.0 milestone Mar 29, 2023
@BraisGabin BraisGabin added the housekeeping Marker for housekeeping tasks and refactorings label Mar 29, 2023
@schalkms
schalkms merged commit 3047fa1 into detekt:main Apr 1, 2023
@Goooler
Goooler deleted the test_parallel branch April 1, 2023 22:34
@Goooler Goooler mentioned this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build housekeeping Marker for housekeeping tasks and refactorings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants