[ZEPPELIN-6648] Add unit test conventions and coverage reporting for the new UI - #5433
Open
voidmatcha wants to merge 1 commit into
Open
[ZEPPELIN-6648] Add unit test conventions and coverage reporting for the new UI#5433voidmatcha wants to merge 1 commit into
voidmatcha wants to merge 1 commit into
Conversation
voidmatcha
force-pushed
the
unit-test-conventions
branch
5 times, most recently
from
August 23, 2026 02:39
3ffc8bc to
f105909
Compare
voidmatcha
force-pushed
the
unit-test-conventions
branch
from
August 23, 2026 02:42
f105909 to
d9b9f3b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR for?
ZEPPELIN-6567 gave
zeppelin-web-angulara self-contained Vitest/jsdom setup, andtest:shellruns in the Maventestphase. Almost nothing runs on it:src/holds 222 source files and two specs, and the five specs underprojects/zeppelin-reactcover theme helpers and two components.The root
AGENTS.mdasks every change to include unit tests without saying how to write one, there is no coverage reporting on the unit side, and nothing stops a spec that cannot fail from being merged — the e2e suite gets that protection fromeslint-plugin-playwright, the unit side had no equivalent.This adds the conventions, the measurement, the enforcement, and three example specs so the conventions have something to point at.
AGENTS.mdfor the package, following the shape ofe2e/AGENTS.md. It is the baseline forsrc/and for the two libraries underprojects/that have no file of their own. A second file underprojects/zeppelin-reactrecords only what differs there, so a rule has one home rather than two copies that drift.@vitest/coverage-v8on both sides. Reported, not gated: with a handful of specs in the tree any threshold set today is either meaningless or permanently red. Coverage sets noinclude— naming a directory makes the provider parse every source under it, and decorator syntax fails there while ZEPPELIN-6637 is open. Coverage parses through a separate path from the test transform, so widening it after 6637 needs re-checking rather than assuming it follows.it.only. The React remote gets them too; its lint runs on every pull request throughlint:react— inside therun-playwright-e2e-testsjob, sincefrontend.ymlbuilds this module with-DskipTests— so they take effect there immediately even though its test suite does not run in CI yet.test:shellnow also coversprojects/zeppelin-sdkandprojects/zeppelin-visualization. Neither needs a runner of its own, but until now a spec added there would have sat unrun, and the lint rules would not have reached it either.e2e/AGENTS.mdgains one corrected line: it is no longer a companion to the repository root, but to this package file.viteis now pinned in bothpackage.jsonfiles. Neither declared it, so vitest's transitive resolution had drifted — 8.2.1 in the shell, 8.0.16 in the remote — and a config warning fired in one but not the other. Aligning the remote surfaces that warning, sovitest.config.tsbecomes.mts, matching the shell config. 36 tests pass on either version and coverage is unchanged; this is version hygiene, not a fix. It rides along because this change already touches bothpackage.jsonfiles and both lock files. Happy to split it out.One thing the exercise turned up:
get-keyword-positionsand theline-mapmodule it builds on have no callers. The spec is kept as a worked example and says so at the top; whether to keep or remove the code is left to a follow-up.Scope is deliberately limited to code that can be tested today. TestBed-based component specs need ZEPPELIN-6637, and wiring the React suite into regular pull-request CI is ZEPPELIN-6566.
What type of PR is it?
Improvement
Todos
AGENTS.mdfor the package and for the React remoteget-keyword-positions,HumanizeBytesPipeandtextUtilsprojects/zeppelin-sdkandprojects/zeppelin-visualizationfrom the runner, the spec tsconfig and lintvitein both packages and rename the remote's vitest config to.mtsWhat is the Jira issue?
ZEPPELIN-6648
How should this be tested?
To confirm the lint rules bite, add a spec with no assertion to either package and run the matching lint command; it is reported as an error.
Screenshots (if appropriate)
N/A
Questions:
AGENTS.mdfiles are the documentation