Skip to content

ci(pull-request-kotlin): single Gradle invocation for ktlint + test + kover [NO-JIRA]#302

Closed
JesperTerkelsen wants to merge 1 commit into
mainfrom
ci/kotlin-pr-single-gradle-invocation
Closed

ci(pull-request-kotlin): single Gradle invocation for ktlint + test + kover [NO-JIRA]#302
JesperTerkelsen wants to merge 1 commit into
mainfrom
ci/kotlin-pr-single-gradle-invocation

Conversation

@JesperTerkelsen

Copy link
Copy Markdown
Member

What

Merge the ktlintCheck, test, and kover tasks into a single Gradle invocation in the Kotlin PR test job (was two separate ./gradlew --no-daemon runs). Sonar stays its own step.

Why

The linter and test steps are two separate --no-daemon invocations, so Gradle pays configuration + KSP/JVM startup twice. On a cold run that's ~1m of config before the first task even runs in the linter step, then again in the test step. The main compile is already reused between them (on-disk UP-TO-DATE — verified: compileKotlin UP-TO-DATE in the test invocation), so the duplication is purely per-invocation overhead, not recompilation.

One invocation pays that overhead once.

--continue runs all tasks even if one fails, so a ktlint failure no longer hides test results — previously the separate test step was skipped when the linter step failed.

Scope / risk

Expected impact

Saves the redundant Gradle config/startup (~30s–1m on cold runs; a smaller slice on warm). Modest on its own — the bigger remaining lever is test execution (ClickHouse testcontainers + maxParallelForks), tracked separately.

Will canary on service-feature (cold + warm) before merging to @main.

🤖 Generated with Claude Code

…cation [NO-JIRA]

The linter and test steps were two separate './gradlew --no-daemon'
invocations, so Gradle paid configuration + KSP/JVM startup twice (~1m of the
linter step is config before the first task even runs). The main compile is
already reused between them (on-disk UP-TO-DATE), so the duplication is purely
the per-invocation config/startup overhead, not recompilation.

Merge ktlintCheck + test + kover into one invocation so that overhead is paid
once. --continue runs all tasks even if one fails, so a ktlint failure no
longer hides test results (previously the test step was skipped on lint
failure). Sonar stays a separate step (conditional on skip-sonar, needs its
own token, small third invocation).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JesperTerkelsen

Copy link
Copy Markdown
Member Author

Parking this — superseded by warm-on-main caching (see follow-up). The single-invocation saving (~30s) is small next to warming the main baseline so fresh PR branches aren't cold.

@JesperTerkelsen JesperTerkelsen deleted the ci/kotlin-pr-single-gradle-invocation branch June 5, 2026 06:56
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.

1 participant