feat(test): fail torb test below the coverage threshold #265
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/230-coverage-threshold"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task: project loop
torbscript, item #230, the second slice of #191:torb testcheckstest { coverageThreshold }against the VM's line coverage.What
feat(project): read test { coverageThreshold } from the manifestManifest.coverageThreshold(default 0) is read statically, including a negative literal, and from the evaluated settings (withEvaluated), sotorb manifest --checkcompares it too.feat(test): fail torb test below the coverage thresholdtestInMachinegroups the run's test entries by package (testedPackagesOf) and reads each package's manifest (withCoverageThresholds).Coverage. After the runtime's summary,coverageOfis computed per package over its ownsrc/(sourceModulesOf); a file no test imports counts as missed.acme/app:when the run covers several packages. The run exits 1 where the tests passed; a failing test's code wins.--report jsonemits onecoverageevent per measured package, with"package"only in a multi-package run.--filter/--shard, coverage is not measured and one note goes to stderr.--native/--profile/--releasewith a threshold are refused inbuildTreeafter the check, before the build.Coverageand does not turn on debug lowering, so nothing changes.examples/game-engine/project.trbdrops its threshold (the gates run it with--native).tools/gates.shis unchanged.docs/design/PROJECT.mdsection 10 says what landed. The user docs and the "What is left" sentence are #231.Notes
manifestOfProjectper package).tests/test-report/coverage/is a nested fixture package and is not in the gates'manifest --checklist, becausetools/gates.shstays unchanged.Test
compiler/tests/coverage.test.trbcovers:src/-only scope with an unimported file counted as missedcompiler/tests/project.test.trbcovers reading the setting, the range problem and the evaluated value.tools/test-report.shgets a VMcoveragecase overtests/test-report/coverage/(coverage.expected, stdout + stderr + exit):--filterskips with the note--nativerefusal is a case inarguments.expected.torb format --checkon all touched files andtorb checkon the touched sources/tests (no problems). The new grouping and rendering tests pass in the nightly VM. The VM-in-VM coverage tests need the native suite. Everything else runs in CI.Closes #230
Refs #191
`torb test` reads `test { coverageThreshold }` of every package whose tests run. Above 0 the run is lowered for the debugger and measured with a Coverage over each package's own `src/` - a file no test imports counts as missed - and checked against that package's threshold: one line after the summary below it, exit 1 where the tests passed, and a `coverage` event per package with `--report json`. A run of several packages names them. `--filter` and `--shard` skip the measurement with a note on standard error; `--native`, `--profile` and `--release` are refused before the build. The game engine example drops its threshold, since the gates run its tests natively. tests/test-report/coverage is the fixture of tools/test-report.sh. Refs #230f336c58aff06008fd500Approved. Checklist for
06008fd:Non-blocking:
test { coverageThreshold }(coverage measurement) #191