Skip to content

Fix support for Gradle configuration cache #2992

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

Merged
merged 1 commit into from
Aug 22, 2020

Conversation

3flex
Copy link
Member

@3flex 3flex commented Aug 20, 2020

#2813 missed one usage of Project at execution time.

This PR:

  • Makes Detekt task compatible with the configuration cache
  • Adds tests

@codecov
Copy link

codecov bot commented Aug 20, 2020

Codecov Report

Merging #2992 into master will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2992   +/-   ##
=========================================
  Coverage     79.74%   79.74%           
  Complexity     2493     2493           
=========================================
  Files           424      424           
  Lines          7491     7491           
  Branches       1410     1410           
=========================================
  Hits           5974     5974           
  Misses          768      768           
  Partials        749      749           
Impacted Files Coverage Δ Complexity Δ
.../main/kotlin/io/gitlab/arturbosch/detekt/Detekt.kt 28.57% <0.00%> (ø) 16.00 <0.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 102c28d...85e9f2d. Read the comment docs.

// Second run reuses the cache
val result = gradleRunner.runTasks("--configuration-cache", "detektGenerateConfig")

assertThat(result.output).contains("Reusing configuration cache.")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can refactor those 3 usages into 1 method in order to avoid code duplication.

Copy link
Member Author

Choose a reason for hiding this comment

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

I could, but my preference is to keep tests self-contained, showing all steps within the test and not in extra methods. I think with just the three tests the duplication is OK in this case.

@arturbosch arturbosch added this to the 1.12.0 milestone Aug 20, 2020
@arturbosch
Copy link
Member

Oh, I started to do the same in #2944
But your tests look great :).
You will need to rebase this when the 1.4 branch is merged to have Gradle 6.6 and a running dokka on Java 11

@arturbosch arturbosch merged commit a7fc88b into detekt:master Aug 22, 2020
@3flex 3flex deleted the config-cache branch August 22, 2020 14:24
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.

3 participants