supercov 4.22.0 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/cli.md +1 -0
- package/docs/supported-suites.md +67 -0
- package/docs/workspace-isolation.md +3 -2
- package/package.json +9 -9
package/docs/cli.md
CHANGED
|
@@ -921,6 +921,7 @@ terminal or offline environment after the package has been downloaded.
|
|
|
921
921
|
| Variable | Use |
|
|
922
922
|
| --- | --- |
|
|
923
923
|
| `SUPERCOV_SOURCE_ROOTS` | Comma-separated directories or files that hold your own code, in any language; everything else is left out |
|
|
924
|
+
| `SUPERCOV_TEST_ROOTS` | For an Ant build whose `<batchtest>` directories cannot be read from its files: comma-separated directories that hold its tests |
|
|
924
925
|
| `SUPERCOV_TEST_KIND` | Label the wrapped command as a test level such as `unit` or `e2e` |
|
|
925
926
|
| `SUPERCOV_SOURCE_TOOLS` | Comma-separated names of tools the test command runs that read source as text, such as a linter or a spell checker, besides Biome, oxlint, dprint, cspell and knip. Each is run on your source as you wrote it instead of on the instrumented copy |
|
|
926
927
|
| `SUPERCOV_RUN_ID` | Set by Supercov, not by you: in every process a measured command starts, the run's id, so a test or harness can tell it is measured |
|
package/docs/supported-suites.md
CHANGED
|
@@ -736,6 +736,9 @@ npx supercov -- npx playwright test
|
|
|
736
736
|
| Spock | Exact per feature, under the names Spock itself reports | — |
|
|
737
737
|
| TestNG | Exact per test, each data-provider invocation its own | — |
|
|
738
738
|
| JUnit 4 alone | Exact per test, through Vintage — see below | Maven or Gradle |
|
|
739
|
+
| JUnit 4 under Ant's `<junit>` | Exact per test, under the names Ant's XML report uses | Ant 1.10 — see below |
|
|
740
|
+
| Any platform engine under Ant's `<junitlauncher>` | Exact per test, through the platform listener | Ant 1.10 — see below |
|
|
741
|
+
| TestNG under Ant's `<testng>` | Exact per test, through the TestNG listener | TestNG 6.x with its Ant task — see below |
|
|
739
742
|
|
|
740
743
|
Multi-module builds are measured module by module: each compiles its own source
|
|
741
744
|
set and forks its own JVM, so each gets a runtime and records evidence of its
|
|
@@ -798,6 +801,70 @@ npx supercov -- ./gradlew test
|
|
|
798
801
|
npx supercov -- ./mvnw verify
|
|
799
802
|
```
|
|
800
803
|
|
|
804
|
+
### Ant and Ivy
|
|
805
|
+
|
|
806
|
+
A project with a `build.xml` (and no Maven or Gradle build) is an Ant build.
|
|
807
|
+
Ant has no layout convention, so Supercov reads the build: it follows the
|
|
808
|
+
`<import>` chain with the properties it defines, takes the directories each
|
|
809
|
+
`<batchtest>` or `<testclasses>` scans as the tests — or, where it scans
|
|
810
|
+
compiled classes, the sources the `<javac>` writing them compiles — and what
|
|
811
|
+
its other `<javac>` tasks compile as the code they test, leaving out the
|
|
812
|
+
directories the build writes into. Java elsewhere, such as the sources a test
|
|
813
|
+
compiles as its input, is left alone. Where a `<javac>` compiles from a path
|
|
814
|
+
the build makes only at run time, every other `src` directory holding Java is
|
|
815
|
+
taken as product code too.
|
|
816
|
+
When the build names its tests where that cannot be read — a path a custom
|
|
817
|
+
task builds at run time — say where they are:
|
|
818
|
+
|
|
819
|
+
```sh
|
|
820
|
+
SUPERCOV_TEST_ROOTS=test/src npx supercov -- ant test
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
`SUPERCOV_SOURCE_ROOTS` narrows the product code the same way as for any
|
|
824
|
+
project.
|
|
825
|
+
|
|
826
|
+
Ant's `<junit>` task runs JUnit 4 itself, not on the JUnit Platform, so in the
|
|
827
|
+
copy each `<junit>` task gets a result formatter of Supercov's next to its own
|
|
828
|
+
formatters. The task loads it in every JVM it forks — one per test class by
|
|
829
|
+
default — and it tells the runtime when each test starts and ends. Each JVM
|
|
830
|
+
writes its evidence at the end of its suite and on shutdown, so a JVM the
|
|
831
|
+
task stops for running past its timeout still leaves what it recorded, and
|
|
832
|
+
the run merges every one. The formatter is compiled by the copy's build just
|
|
833
|
+
before the task, against the task's own classpath and Ant's runtime. Tests
|
|
834
|
+
keep the names Ant's XML reports give them, `Class#method`; a test a suite
|
|
835
|
+
runs is named within it, `Suite#Class#method`, and a test two tasks or
|
|
836
|
+
filesets both run is numbered in the second (`[2]`). A test the task stops
|
|
837
|
+
for its timeout is recorded as failed, with what it ran until then. A build
|
|
838
|
+
that names no tests where they can be read keeps the `src/main` and
|
|
839
|
+
`src/test` convention.
|
|
840
|
+
|
|
841
|
+
Ant's `<junitlauncher>` runs tests on the JUnit Platform, so it gets the same
|
|
842
|
+
platform listener Maven and Gradle builds get, as a `<listener>` of the task,
|
|
843
|
+
compiled the same way against the task's classpath. TestNG's `<testng>` task
|
|
844
|
+
gets the TestNG listener in its own `listeners` attribute, beside any the
|
|
845
|
+
build names.
|
|
846
|
+
|
|
847
|
+
Many Ant builds import a shared harness from beside the project —
|
|
848
|
+
`<import file="../../../tools/master/build/common/common-build.xml"/>` — and
|
|
849
|
+
the `<junit>` task lives there. The copy is laid out at the project's place
|
|
850
|
+
within the closest directory holding it and everything its build imports,
|
|
851
|
+
with links standing for the rest, so `../` reaches what it reaches in the
|
|
852
|
+
checkout. A file outside the project that holds a `<junit>` task — the
|
|
853
|
+
harness, or a wrapper script's own build file beside it — is changed in the
|
|
854
|
+
copy's own version of that file; the original and the rest of the harness
|
|
855
|
+
are only read. Small files and directories beside the project are copied
|
|
856
|
+
rather than linked, so a wrapper script that writes beside itself writes into
|
|
857
|
+
the copy; anything larger than 4 MB stays a link.
|
|
858
|
+
|
|
859
|
+
Only the project's own sources are measured: modules resolved as jars, Ivy's
|
|
860
|
+
included, are not instrumented. Code that is not Java or Kotlin — XSLT,
|
|
861
|
+
sitemaps, scripts run by the JVM — is outside what the figure covers.
|
|
862
|
+
|
|
863
|
+
```sh
|
|
864
|
+
npx supercov -- ant test
|
|
865
|
+
npx supercov -- ../../../run-single-test.sh . ALL
|
|
866
|
+
```
|
|
867
|
+
|
|
801
868
|
## Containers, VMs, and remote execution
|
|
802
869
|
|
|
803
870
|
Supercov can collect from supported processes launched through a container, VM,
|
|
@@ -200,8 +200,9 @@ its settings with paths moved to the guest's mount, and the guest's coverage is
|
|
|
200
200
|
credited to the test that launched it. A guest started any other way, with none
|
|
201
201
|
of those settings, still runs the instrumented code: it reads the run's
|
|
202
202
|
settings from the mounted workspace itself, and its coverage counts for the run
|
|
203
|
-
as background coverage, credited to no test. The run summary's `
|
|
204
|
-
|
|
203
|
+
as background coverage, credited to no test. The run summary's `Unattributed`
|
|
204
|
+
line counts processes whose coverage has no named test identity. Local processes
|
|
205
|
+
can also appear here; this count does not establish container or VM execution.
|
|
205
206
|
|
|
206
207
|
Dependencies stay out of the instrumented copy. The root `node_modules` is
|
|
207
208
|
linked entry by entry to the project's own, so an environment that mounts the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supercov",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.23.0",
|
|
4
4
|
"description": "Coverage, security and code quality for coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"coverage",
|
|
@@ -122,14 +122,14 @@
|
|
|
122
122
|
"test:windows-tls": "node scripts/windows-tls-test.mjs"
|
|
123
123
|
},
|
|
124
124
|
"optionalDependencies": {
|
|
125
|
-
"@supercov/cli-darwin-arm64": "4.
|
|
126
|
-
"@supercov/cli-darwin-x64": "4.
|
|
127
|
-
"@supercov/cli-linux-arm64-gnu": "4.
|
|
128
|
-
"@supercov/cli-linux-arm64-musl": "4.
|
|
129
|
-
"@supercov/cli-linux-x64-gnu": "4.
|
|
130
|
-
"@supercov/cli-linux-x64-musl": "4.
|
|
131
|
-
"@supercov/cli-win32-arm64": "4.
|
|
132
|
-
"@supercov/cli-win32-x64": "4.
|
|
125
|
+
"@supercov/cli-darwin-arm64": "4.23.0",
|
|
126
|
+
"@supercov/cli-darwin-x64": "4.23.0",
|
|
127
|
+
"@supercov/cli-linux-arm64-gnu": "4.23.0",
|
|
128
|
+
"@supercov/cli-linux-arm64-musl": "4.23.0",
|
|
129
|
+
"@supercov/cli-linux-x64-gnu": "4.23.0",
|
|
130
|
+
"@supercov/cli-linux-x64-musl": "4.23.0",
|
|
131
|
+
"@supercov/cli-win32-arm64": "4.23.0",
|
|
132
|
+
"@supercov/cli-win32-x64": "4.23.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@playwright/test": ">=1.55.0",
|