Commit 5ecf1a1
committed
feat(parse-server-mongo): real JS line coverage via NODE_V8_COVERAGE
Replaces the prior API-route-surface "coverage" (counting fired
routes / curated route table) with actual V8 line coverage of the
parse-server library code under node_modules/parse-server/lib.
Architecture:
- `Dockerfile.coverage` extends the base image with a graceful-
shutdown shim (coverage-entrypoint.js installs SIGTERM/SIGINT
handlers calling process.exit(0)) so V8 actually flushes its
coverage data on `compose stop`. Without that shim, express's
app.listen pins the loop and the kernel signal-kills node
(exit 143) before NODE_V8_COVERAGE writes anything.
- `docker-compose.coverage.yml` is an OVERLAY: applied via
`-f docker-compose.yml -f docker-compose.coverage.yml`. It
sets NODE_V8_COVERAGE=/coverage and bind-mounts the host
./coverage dir. The base `Dockerfile` and `docker-compose.yml`
are untouched, so keploy/integrations and keploy/enterprise
CI lanes consume the base compose and pay zero coverage cost.
- `coverage-report.js` reads V8's per-process JSON dumps and
produces a `Covered N/M (XX.X%)` summary plus a c8-shaped
coverage-summary.json. We don't use `c8 report` because c8
filters node_modules even when --include is set, and
parse-server lives entirely under node_modules/parse-server.
The custom tool walks V8's nested ranges (block coverage)
and resolves per-line execution count to the deepest range.
- `flow.sh::parse_coverage` shells into the coverage image to
run coverage-report.js against the dumped V8 data; when called
against the base image (no overlay) it prints
"INFO: ... uninstrumented" and exits 0 so enterprise lanes'
`flow.sh coverage || true` informational calls keep working.
Removed:
- `parse_list_routes` (curated route table denominator).
- `parse_collect_recorded_routes` (keploy-tests / fired-routes
reader).
- The legacy route-surface `parse_coverage` body.
- `list-routes` subcommand.
Validated locally: helper produced `coverage=38.7` to GITHUB_OUTPUT
against a fresh stack (signup + record-traffic + clean stop).
38.7% reflects coverage of node_modules/parse-server/lib —
mongo paths ~46%, REST ~52%, Auth ~40%, schema ~58%; postgres
adapter ~7% (mongo storage selected) and LiveQuery ~3% (not
exercised), which is the expected distribution.
Signed-off-by: Akash Kumar <meakash7902@gmail.com>1 parent 82baa51 commit 5ecf1a1
6 files changed
Lines changed: 383 additions & 166 deletions
File tree
- .github/workflows/scripts
- parse-server-mongo
Lines changed: 47 additions & 59 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
30 | 21 | | |
31 | 22 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 23 | | |
37 | 24 | | |
38 | 25 | | |
39 | 26 | | |
40 | 27 | | |
41 | 28 | | |
42 | 29 | | |
43 | | - | |
44 | | - | |
45 | 30 | | |
46 | | - | |
47 | 31 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
51 | 37 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 38 | + | |
57 | 39 | | |
58 | | - | |
59 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
60 | 47 | | |
61 | 48 | | |
62 | 49 | | |
| |||
65 | 52 | | |
66 | 53 | | |
67 | 54 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 55 | + | |
72 | 56 | | |
73 | 57 | | |
74 | 58 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 59 | + | |
78 | 60 | | |
79 | 61 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
85 | 74 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 75 | + | |
| 76 | + | |
89 | 77 | | |
90 | 78 | | |
91 | 79 | | |
92 | 80 | | |
93 | 81 | | |
94 | 82 | | |
95 | 83 | | |
96 | | - | |
| 84 | + | |
97 | 85 | | |
98 | | - | |
| 86 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
0 commit comments