test(ios-readplace): add a per-file code-coverage gate to make test#920
Merged
FagnerMartinsBrack merged 1 commit intoJul 5, 2026
Merged
Conversation
The rest of the repo enforces a 100% coverage gate, but the iOS suite ran with no coverage measurement or threshold at all — a structural blind spot. `make test` now runs with `-enableCodeCoverage` and fails if any source file drops below its recorded floor (`scripts/check-coverage.py`). The gate is a ratchet, not an all-at-once 100%: `scripts/coverage-baseline.json` excludes pure SwiftUI views and WebKit/OS-boundary glue (the Swift analog of the repo's whole-file OS-boundary exclusion) and records a per-file floor for every other file, seeded at today's coverage. A file with no floor must be 100%, so a new logic file cannot land untested. Later PRs raise the floors toward 100% and move ShareURLExtractor out of the exclusions once it is testable. The checker uses only the system python3 + xcrun, so the CI ios-tests job needs no extra toolchain setup.
This was referenced Jul 4, 2026
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.
Purpose
The rest of the monorepo enforces a 100% coverage gate, but the iOS suite ran
xcodebuild testwith no coverage measurement and no threshold at all — a structural exemption from the repo's coverage doctrine. Nothing stopped iOS logic from landing untested.This wires a real coverage gate into
make test(which the CIios-testsjob runs), so iOS coverage is measured and enforced on every run.What it solves & the value
make testnow runs with-enableCodeCoverage YES -resultBundlePath build/TestResults.xcresult.scripts/check-coverage.pyreads the.xcresultand fails the build if any source file drops below its recorded floor. A file with no floor must be 100%, so a newly added logic file cannot land untested.scripts/coverage-baseline.jsonseeds each file's floor at today's coverage and excludes pure SwiftUI views and WebKit/OS-boundary glue (the Swift analog of the repo's whole-file OS-boundary exclusion). The later E-series PRs raise these floors toward 100% and moveShareURLExtractorout of the exclusions once it becomes testable.python3+xcrun, so theios-testsjob (which only installs xcodegen) needs no extra setup.Design notes
Testing
Full suite green with the gate active locally (207 tests,
iOS coverage gate passed: 19 files at or above floor, 10 excluded), plus the STAGING smoke pass. Run as CI runsmake test.