-
Notifications
You must be signed in to change notification settings - Fork 417
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
Refactor Integration Test project setup steps #3492
Conversation
- deduplicate project copying code - move custom repos into template.settings.gradle.kts & remove redundant template.root.gradle.kts - pass template.settings.gradle.kts as a Gradle task input, so the project-copying code can use it - refactor `copyAndApplyGitDiff()` to try and make it a bit more legible
...ts/gradle/src/testExternalProjectKotlinxCoroutines/kotlin/CoroutinesGradleIntegrationTest.kt
Show resolved
Hide resolved
I haven't run changes locally, but looks legit :) |
- it makes it clearer about the order of the setup tasks (first prepare files, then apply diff) - also Coroutines test does the same, and it's unusual if they aren't both the same
@@ -101,6 +102,13 @@ testing { | |||
|
|||
targets.configureEach { | |||
testTask.configure { | |||
|
|||
inputs.file(templateSettingsGradleKts) | |||
systemProperty( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, we set a system property, which is used in AbstractGradleIntegrationTest
. However, it is not clear to me where we set the second templateProjectDir
system property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, it's not clear.
I've moved inputs.file(templateSettingsGradleKts)
to the registerTestProjectSuite()
util function, so it's next to the templateProjectDir
input.
This also triggered me to add property names and path sensitivity.
Thanks!
Summary
AbstractGradleIntegrationTest
template.settings.gradle.kts
& remove redundanttemplate.root.gradle.kts
template.settings.gradle.kts
as a Gradle task input, so the project-copying code can use ittemplate.settings.gradle.kts
, so Gradle only searches MavenLocal for DokkacopyAndApplyGitDiff()
to try and make it a bit more legibleVerification
To test locally I recommend enabling configuration cache, as this will make the tasks run in parallel