Skip to content

[Gradle] Add integration tests for KMP test execution, aggregation, and failure reporting - #7620

Open
Yermukhamed Shakhman (ermawqa-jetbrains) wants to merge 4 commits into
masterfrom
yermukhamed/kmp-test-reports-integration-tests
Open

[Gradle] Add integration tests for KMP test execution, aggregation, and failure reporting#7620
Yermukhamed Shakhman (ermawqa-jetbrains) wants to merge 4 commits into
masterfrom
yermukhamed/kmp-test-reports-integration-tests

Conversation

@ermawqa-jetbrains

@ermawqa-jetbrains Yermukhamed Shakhman (ermawqa-jetbrains) commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Added dedicated, lightweight integration tests covering KMP test aggregation (:allTests) and test failure reporting fidelity (:jvmTest)

Changes

MppTestReportIT.kt:

  • Added testAllTestsReportAggregation: Verifies :allTests execution across multiple targets (jvm + js(Node)), aggregate HTML report generation (build/reports/tests/allTests/index.html), and XML test case verification.
  • Added testTestFailureReportingAndStackTrace: Verifies :jvmTest failure handling, structured XML metadata (failure.type, failure.message), anti-drift dynamic line number resolution in stack traces, and target HTML report generation.

testAssertions.kt:

  • Normalized test class name parsing in readTestCases to handle Gradle 9+ non-JVM task name prefixes.

^KQA-3437

@kodee-bot

kodee-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

Hi! It looks like there are no references to any YT issues in the commit messages.
If the change is non-functional, feel free to ignore the comment :)
Otherwise, please add them as requested in the guideline.

@kotlin-safemerge

kotlin-safemerge Bot commented Aug 20, 2026

Copy link
Copy Markdown

Code Owners

RuleOwnersApproval
/​libraries/​tools/​kotlin-​gradle-​plugin-​integration-​tests/​
kotlin-build-tools

Egorand 🔒
PR commands for maintainers
CommandDescriptionParameters
/safe-mergeRebase-merges with automatic fixup commit squashing--fixup Autosquash fixup commits (on by default)
/safe-squash-mergeSquash-merges with optional commit title/body override--title Title of the squashed commit
--message Body of the squashed commit
/dry-runRuns the test pipeline with changes rebased on latest master--retry Retry the CI run on failure
/test-publicTriggers the public test suite without rebasing on latest master
/test-privateTriggers the private test suite without rebasing on latest master
/codeownersTriggers code owners check and comment update
/fixupSquashes fixup commits and force pushes the branch
/cancel-coordinatorCancels the merge coordinator currently running for this branch

@ermawqa-jetbrains

Copy link
Copy Markdown
Contributor Author

Andrey Tyrin (@atyrin) Egor Andreevich (@Egorand) could this test suite be candidate for smoke tests? Personally I couldn't think of cases when this "feature" can be affected by another domains. However, LLM thinks that there are cases when tests can easily be broken by Compiler/Libraries/Js/Wasm domains.

@Egorand Egor Andreevich (Egorand) 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.

Looks good!

/final

assertTasksFailed(":jvmTest")
}

val testCases = readTestCases(":jvmTest")

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.

As an alternative I think we can consider testing against a golden file here, I think this approach might be less brittle against potential HTML report formatting changes in future versions of Gradle.

Co-authored-by: Egor Andreevich <egor.andreevich@jetbrains.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.

2 participants