Skip to content
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

Merged
merged 10 commits into from
Feb 14, 2024

Conversation

adam-enko
Copy link
Member

@adam-enko adam-enko commented Feb 9, 2024

Summary

  • Gradle projects:
    • deduplicate project copying code into AbstractGradleIntegrationTest
    • 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
    • added exclusive filter for MavenLocal in template.settings.gradle.kts, so Gradle only searches MavenLocal for Dokka
  • refactor copyAndApplyGitDiff() to try and make it a bit more legible

Verification

To test locally I recommend enabling configuration cache, as this will make the tasks run in parallel

./gradlew integrationTest --configuration-cache --configuration-cache-problems=warn

- 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
@adam-enko adam-enko changed the title refactor Gradle IT project setups Refactor Integration Test project setups Feb 9, 2024
@adam-enko adam-enko marked this pull request as draft February 9, 2024 12:05
@adam-enko adam-enko changed the title Refactor Integration Test project setups Refactor Integration Test project setup steps Feb 9, 2024
@whyoleg
Copy link
Collaborator

whyoleg commented Feb 9, 2024

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
@adam-enko adam-enko marked this pull request as ready for review February 9, 2024 15:56
@@ -101,6 +102,13 @@ testing {

targets.configureEach {
testTask.configure {

inputs.file(templateSettingsGradleKts)
systemProperty(

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.

Copy link
Member Author

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!

@adam-enko adam-enko merged commit d9f1efe into master Feb 14, 2024
12 checks passed
@adam-enko adam-enko deleted the KT-64377/gradle-it-dedupe-project-setup branch February 14, 2024 09:11
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