Skip to content

Raise test coverage; credit psi coverage from psi-java - #180

Merged
alexander-yevsyukov merged 9 commits into
masterfrom
raise-coverage
Jun 10, 2026
Merged

Raise test coverage; credit psi coverage from psi-java#180
alexander-yevsyukov merged 9 commits into
masterfrom
raise-coverage

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Raises JVM test coverage across several Gradle-plugin modules and adds the
build-infra needed to credit coverage that was previously produced but not
attributed to the right module. Bumps the project version to
2.0.0-SNAPSHOT.399.

What changed

New tests (production code unchanged):

  • plugin-baseGradleTaskBuilderSpec: covers the task-registration
    failure branch of GradleTask.Builder.applyNowTo (wraps the failure into an
    IllegalStateException). plugin-base line coverage 94.4% → 95.0%.
  • gradle-plugin-apiLibrarySettingsPluginSpec: a new case applies two
    settings plugins so both remaining branches of LibrarySettingsPlugin.apply
    are exercised — the already-present root-extension path and the
    dslSpec == null path. The lib package reaches 100% branch coverage. Adds
    a NullDslSettingsPlugin fixture (+ its plugin id) to drive the null path.
  • psi — first-ever tests for the module: IdeaStandaloneExecutionSpec and
    PsiExtsSpec.

Build-infra — SiblingCoverage.creditTestCoverageFrom(contributor):
The language-neutral psi classes are exercised by the Java-PSI test fixtures
that live in psi-java, but Kover's per-module report for psi only sees
psi's own test data, so that cross-module coverage was missing from the
per-module report. The new helper adds the contributor module's JaCoCo
execution data to this module's Kover report as an additionalBinaryReports
(only this module's classes are credited from it). Applied in psi crediting
psi-java, this raises psi's own report from 31% → 70% line.

Build fix: psi:test now declares an explicit dependency on
:intellij-platform:shadowJar. The intellij-platform module assembles its
artifact with the Shadow plugin (which disables the regular jar), so a
consumer that puts that JAR on its runtime classpath gets no automatic task
dependency — Gradle's task-output validation rejected it the moment psi first
had a running test task. This mirrors the workaround already used in
uber-jar-module for publishing.

Other notable changes

  • Latest config was applied.

Reviewer notes

  • Verified that CI's ./gradlew build generates only the root Kover report
    (build/reports/kover/report.xml), which is what Codecov ingests. The root
    report already cross-credits psi (~87%) via the root aggregation. The
    creditTestCoverageFrom change fixes psi's per-module report; it does
    not alter the root report or risk double-counting (subproject-level
    additionalBinaryReports do not propagate into the root rollup).
  • Pre-PR passed: ./gradlew build dokkaGenerate green; spine-code-review,
    kotlin-engineer, review-docs all APPROVE (one cosmetic Should-fix: a
    double blank line in SiblingCoverage.kt).
  • The diff also carries a routine config submodule update (workflows,
    gradle.properties, buildSrc config-tester files) that was already on the
    branch — config-distributed, out of scope for review in this consumer repo.

🤖 Generated with Claude Code
🙌🏻 Updated by @alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov changed the title Raise test coverage; credit psi coverage from psi-java Raise test coverage; credit psi coverage from psi-java Jun 9, 2026
alexander-yevsyukov and others added 2 commits June 9, 2026 19:58
The Kover verification task that consumes the credited binary report is
named `koverCachedVerify`, not `koverVerify`, so it read the contributor
module's `test.exec` without a declared dependency on `:<contributor>:test`
and failed Gradle's task-output validation on a clean CI run (it was cached
locally, hiding the problem).

Match Kover report/verify tasks by name suffix (`*Report` / `*Verify`) so the
`Cached*` variants Kover registers are covered.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.40%. Comparing base (988bf2a) to head (8b86c50).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #180      +/-   ##
============================================
+ Coverage     90.17%   90.40%   +0.22%     
- Complexity      552      554       +2     
============================================
  Files           122      122              
  Lines          2230     2230              
  Branches        311      311              
============================================
+ Hits           2011     2016       +5     
+ Misses           96       93       -3     
+ Partials        123      121       -2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR increases JVM test coverage across multiple Gradle-plugin modules, introduces psi module tests for the first time, and adds build infrastructure to attribute cross-module PSI coverage (crediting psi coverage produced by psi-java). It also bumps the project snapshot version to 2.0.0-SNAPSHOT.399.

Changes:

  • Added new tests in plugin-base, gradle-plugin-api, and psi to cover previously untested branches and behaviors.
  • Updated psi build configuration to (a) credit psi-java’s JaCoCo/Kover execution data into psi’s per-module report and (b) fix psi:test runtime classpath task dependency on :intellij-platform:shadowJar.
  • Bumped snapshot version and refreshed generated dependency/license reports accordingly.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
version.gradle.kts Bumps published snapshot version to .399.
psi/src/test/kotlin/io/spine/tools/psi/PsiExtsSpec.kt Adds first tests for PsiExts.convertLineSeparators().
psi/src/test/kotlin/io/spine/tools/psi/IdeaStandaloneExecutionSpec.kt Adds first tests for IdeaStandaloneExecution system-property setup/idempotence.
psi/build.gradle.kts Credits psi coverage from psi-java and adds explicit test:intellij-platform:shadowJar dependency.
plugin-base/src/test/kotlin/io/spine/tools/gradle/task/GradleTaskBuilderSpec.kt Adds a test for applyNowTo() failure-wrapping behavior.
gradle-plugin-api/src/test/kotlin/io/spine/tools/gradle/lib/LibrarySettingsPluginSpec.kt Adds coverage for LibrarySettingsPlugin.apply branches via applying two settings plugins.
gradle-plugin-api-test-fixtures/src/main/kotlin/io/spine/tools/gradle/lib/given/StubSettingsPlugin.kt Adds NullDslSettingsPlugin fixture to exercise dslSpec == null path.
gradle-plugin-api-test-fixtures/build.gradle.kts Registers plugin id for the new NullDslSettingsPlugin test fixture.
docs/dependencies/pom.xml Updates docs POM version to .399.
docs/dependencies/dependencies.md Refreshes generated dependency/license report content for .399.
gradle.properties Enables Gradle build cache by default (config-synced change).
buildSrc/src/main/kotlin/io/spine/gradle/report/coverage/SiblingCoverage.kt Adds helper to credit coverage across sibling modules (config-synced build infra).
buildSrc/src/main/kotlin/io/spine/gradle/ConfigTester.kt Updates config-tester repo reference (core-javacore-jvm) (config-synced).
buildSrc/src/main/kotlin/config-tester.gradle.kts Uses updated repo reference in config-tester script (config-synced).
.github/workflows/remove-obsolete-artifacts-from-packages.yaml Workflow action version updates (config-synced).
.github/workflows/publish.yml Workflow action version updates + switches to gradle/actions/setup-gradle (config-synced).
.github/workflows/increment-guard.yml Workflow action version updates + switches to gradle/actions/setup-gradle (config-synced).
.github/workflows/gradle-wrapper-validation.yml Workflow action version update (config-synced).
.github/workflows/ensure-reports-updated.yml Workflow action version update (config-synced).
.github/workflows/check-links.yml Workflow action version update (config-synced).
.github/workflows/build-on-windows.yml Workflow action version updates + switches to gradle/actions/setup-gradle (config-synced).
.github/workflows/build-on-ubuntu.yml Workflow action version updates + switches to gradle/actions/setup-gradle (config-synced).

Comment thread psi/src/test/kotlin/io/spine/tools/psi/IdeaStandaloneExecutionSpec.kt Outdated
…utionSpec`

`IdeaStandaloneExecution` forces headless mode on only when the property is
undefined. The test now captures the prior value and asserts that contract —
"true" when it was unset, unchanged otherwise — instead of always expecting
"true", which could fail under a JVM started with `-Djava.awt.headless=false`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alexander-yevsyukov
alexander-yevsyukov merged commit e50738d into master Jun 10, 2026
8 checks passed
@alexander-yevsyukov
alexander-yevsyukov deleted the raise-coverage branch June 10, 2026 09:14
alexander-yevsyukov added a commit to SpineEventEngine/core-jvm-compiler that referenced this pull request Jun 11, 2026
The renderers and views of the `annotation` module are exercised
end-to-end by the `annotation-tests` module, which runs the Compiler
pipeline in-process. Apply `creditTestCoverageFrom(...)` so that this
coverage is credited to the per-module Kover report of `annotation`,
raising its line coverage from 43% to 94%.

This mirrors the approach used for `psi` <- `psi-java` in
SpineEventEngine/tool-base#180. The root aggregated report is not
affected: it already cross-credits this coverage via root aggregation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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