-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Setup the correct pipeline for integration test of detekt gradle plugin #3324
Comments
Other option (no exclusive): checkout some opensource projects that already use detekt and run them. Problem: we need to be carefull with false positives if they break their build. Some options: Firefox & LeakCanary. |
I guess this is hard to automate, since the tests directly depend on 3rd party code. If 3rd party gets changed, those tests have to be adapted in the detekt repository. For testing purposes it's enough to have a few files containing some issues and folders to test detekt end-to-end. |
Such integration tests need to keep some code with violation of detekt rules. I doubt a 3rd party repo would satisfy our need: Well-maintained repos tend to have good hygiene to remove detekt violations quickly. |
My statement was based on out-dated information. Please allow me to correct the statement here. In addition to the common unit testing, this project embraces two ways to test our Gradle plugins:
The end-to-end would probably use GradleRunner, but the current test does not seem to have high coverage. For example:
End-to-end would be exceeding beneficial as we are introducing tooling and lower-level changes. |
ProblemOne of the problems that I encountered when prototype #3327:
Some technical lower-level details: JavaGradlePluginPlugin:204 uses
Note that the dependencies in Solution
RecommendationSolution 1 can kill two birds with one stone. We can create a |
Thank you very much for this further elaboration. I completely agree with your recommendation (solution 1). This solves the problem. I don’t think a big refactoring for solution 2 is beneficial looking towards detekt v2.0.
|
@schalkms if possible, would you mind changing the issue title to be |
@chao2zhang I updated the title. |
This issue was also discovered earlier as described in the main summary of #2493 |
@chao2zhang and me had a discussion about adding more end-to-end like tests to detekt's code base. This is definitely beneficial in terms of code quality.
Hence, the quote from PR #3319 is included in this issue. It contains a good idea, which might be followed. Of course this is an opened discussion. So please feel free to submit your ideas inside this issue.
The text was updated successfully, but these errors were encountered: