Gate Zed and Rider coverage; replace the Zed tests that asserted nothing - #211
Merged
Conversation
`.config/coverage/thresholds.json` gated five packages. Neither editor
integration was one of them.
Zed shipped 23 unit tests that were never executed: `make _lint-zed` runs
clippy `--all-targets`, which compiles them, and `make test` had no Zed
target. Unrun, they had rotted into tautologies —
`expected_version_matches_cargo_toml` asserted `EXPECTED_VERSION ==
env!("CARGO_PKG_VERSION")` where `EXPECTED_VERSION` *is* that env; the test
named for extension.toml/Cargo.toml version parity never opened
extension.toml; the missing-binary test rebuilt the error string inside
itself and asserted on its own copy.
Rider had 2961 LOC of Kotlin, zero tests, and zero CI presence — not built,
not linted, not tested. build.gradle.kts declared junit-jupiter, the platform
test framework, and a `test { useJUnitPlatform() }` block against no `src/test`
directory at all.
Zed: extract the parse -> read -> enrich -> format pipeline out of the
`zed::Worktree` shell into pipeline.rs so it is reachable from a test, and
split `cached_or` / `with_default_log_level` / `tree_output` out of the WASM
API adapters. Real tests replace the vacuous ones, including version parity
that actually parses extension.toml. 75.41% -> 85.04%.
Rider: first tests (NuGetState — installed-list merge, case-insensitive id
matching, sort order, pending flags), plus Kover wired to the repo ratchet at
its honest 4.09%. Two build fixes were needed before any test could run: the
platform's JUnit5TestSessionListener loads junit.framework.TestCase and dies
without JUnit 4 on the runtime classpath, and the junit-vintage it drags in
throws during discovery against junit-jupiter 5.11.3's older
junit-platform-commons. `failOnNoDiscoveredTests` now stops an empty test task
reporting BUILD SUCCESSFUL, which is how the harness stayed green while empty.
ci-editors.yml runs both. RIDER_REQUIRED=1 turns a missing JDK 21+ from a
local convenience skip into a hard CI failure.
Also: drop `default_threshold: 90`, which check-coverage.mjs never read, and
de-duplicate the JDK-21 discovery loop into tools/rider/gradle.sh.
Remaining debt tracked in #210.
The Zed workspace builds into src/editors/zed/target, so on a fresh checkout the root target/ that holds every other coverage artifact does not exist and llvm-cov fails with "No such file or directory" after all 31 tests pass. Local runs missed it because target/ was already there from the Rust host build.
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.
.config/coverage/thresholds.jsongated five packages —sharplsp,vscode-extension, and the three sidecars. Neither editor integration was one of them.What was unguarded
Zed shipped 23 unit tests that were never executed.
make _lint-zedruns clippy--all-targets, which compiles them;make testhad no Zed target. Unrun, they had rotted:expected_version_matches_cargo_tomlEXPECTED_VERSION == env!("CARGO_PKG_VERSION")— andEXPECTED_VERSIONis that env. Tautology.server_binary_name_is_sharplspconstequals its own literalexpected_version_matches_extension_toml_versionextension.toml/Cargo.tomlparity; it never opensextension.toml.missing_binary_error_...resolve_binarycould not fail itRider had 2961 LOC of Kotlin, zero tests, and zero CI presence — not built, not linted, not tested on any PR.
build.gradle.ktsdeclaredjunit-jupiter,testFramework(TestFrameworkType.Platform), andtasks.test { useJUnitPlatform() }against nosrc/testdirectory at all.What this adds
sharplsp-zedmake _test-zedsharplsp-ridermake _test-rider(Kover)Zed — the parse → read → enrich → format pipeline moves out of the
zed::Worktreeshell intopipeline.rs(98.41%) so it is reachable from a test;cached_or,with_default_log_levelandtree_outputsplit out of the WASM API adapters. The version-parity test now actually parsesextension.toml, and the missing-binary test asserts on the messagecached_orreally produces.Rider — first tests cover
NuGetState: the installed-list merge, case-insensitive id matching (the two LSP responses do not agree on casing), sort order, and pending flags. Kover is wired to the repo ratchet at its honest 4.09%.Two build defects had to be fixed before any Rider test could run:
com.intellij.tests.JUnit5TestSessionListener, whose constructor loadsjunit.framework.TestCase. Without JUnit 4 on the runtime classpath it fails to instantiate and the task dies before a single test runs —NoClassDefFoundError, not a test failure.junit-vintageon the classpath, built against a newerjunit-platform-commonsthanjunit-jupiter5.11.3 ships (support.scanning.ClassFilter). Vintage throws during discovery, aborting the whole task. Discovery is now Jupiter-only.failOnNoDiscoveredTests = truestops an emptytesttask reporting BUILD SUCCESSFUL — which is exactly how this harness stayed green while containing nothing.CI
New
ci-editors.ymlruns both legs.RIDER_REQUIRED=1turns "no JDK 21+ found" from a local convenience skip into a hard CI failure, so the gate cannot silently skip. The Rider job also builds the plugin — it was never compiled on a PR before, so a Kotlin break could reachmainbehind a fully green pipeline.Also
default_threshold: 90removed.check-coverage.mjsreadsthresholds[project].line_percentand hard-fails on an unknown key; it never consulteddefault_threshold. Hard-failing on an ungated package is the correct strict behaviour and is what surfaced this gap.tools/rider/gradle.sh.Verified locally
make _lint-zedclean.make _build-riderstill producesdist/sharplsp-rider.zipthrough the shared script.Remaining debt
Tracked in #210: 95.9% of the Rider plugin is still untested (
LspBridge, the tree nodes,PackageCardRenderer,PackageDetailsPanel, settings persistence — most needsBasePlatformTestCasefixtures), and Zed's 85% is near its ceiling as structured, since the remainder only exists inside Zed's WASM host.