Commit 5094f03
authored
feat(parse-server-mongo): compat-lane-ready sample + JS line coverage gate (#97)
* feat(parse-server-mongo): subcommand flow + env-driven compose + noise template
Make the parse-server-mongo sample directly consumable as a keploy compat-lane
sample, on par with samples-typescript/umami-postgres and samples-python/
doccano-django.
- flow.sh refactored to subcommand form: bootstrap | record-traffic |
coverage | list-routes. bootstrap is idempotent (4xx during signup is
treated as already-exists), persists the session token to
/tmp/parse-token-${PARSE_PHASE}, and preserves the 3-second post-/health
pause that the boot-phase _SCHEMA divergence reproducer needs.
- record-traffic ports the broad parse-server REST + GraphQL surface
(51 fire calls across users/sessions/classes/roles/files/cloud-functions/
schemas/hooks/graphql/aggregate). Every curl is preceded by log_fired so
PARSE_FIRED_ROUTES_FILE captures (method,route) for coverage. The
multi-class _SCHEMA mutation (GameScore, PlayerStats, Achievement) is
retained so the boot-phase tiebreaker reproducer still triggers.
- coverage subcommand reports (method,route) coverage with numerator from
keploy/test-set-*/tests/*.yaml when present, else from the fired-routes
log. Denominator from a curated 35-route table in parse_list_routes.
- docker-compose.yml takes ${VAR:-default} for project name, network name,
network subnet, IPs, container names, host:container port, and the
internal PORT env. Defaults preserve standalone `docker compose up`;
overrides let concurrent matrix cells share a single docker daemon.
- keploy.yml.template carries the parse-server noise filter (header.Date,
body.objectId, body.sessionToken, body.createdAt, body.updatedAt) so a
lane consumer can apply it to keploy.yml after `keploy config --generate`.
- README rewritten to document the four subcommands, all env vars, the
route surface covered, the boot-phase divergence rationale, and a
concurrent-cell run recipe.
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
* ci(parse-server-mongo): add per-sample coverage gate workflow
Introduce a GitHub Actions workflow scoped to the parse-server-mongo
sample that runs the same end-to-end record/coverage shape as the
doccano-django and umami-postgres lanes. The workflow is path-filtered
to `parse-server-mongo/**` (plus the workflow file and its helper
script) so it does NOT trigger on changes to other samples in this
repo or on changes elsewhere.
Three jobs:
* build-coverage — runs the sample end-to-end against the PR's
HEAD ref; emits a coverage percentage.
* release-coverage — same, against the PR's base ref; first-PR
bootstrap escape hatch returns 0% if the
sample doesn't exist on the base ref yet.
* coverage-gate — fails the PR if HEAD coverage drops more
than COVERAGE_THRESHOLD percentage points
below base. Default 1.0pp; override via the
repo variable PARSE_COVERAGE_THRESHOLD.
A sticky PR comment surfaces the base-vs-PR coverage diff with a
prose explanation of which parse-server REST + GraphQL routes the
sample's flow.sh::parse_record_traffic exercises.
Helper script .github/workflows/scripts/run-and-measure-parse-server.sh
is per-sample (sibling samples will land their own
run-and-measure-<sample>.sh on parallel branches). It does docker
compose up -d --build, polls /parse/health, runs flow.sh bootstrap →
record-traffic → coverage with PARSE_FIRED_ROUTES_FILE as the
standalone numerator, parses the report, and emits coverage=PCT to
GITHUB_OUTPUT.
This gate runs ONLY on PRs touching parse-server-mongo/. The
enterprise PR pipeline (.woodpecker/parse-server-linux.yml) calls
flow.sh coverage informationally and does NOT gate; the gate lives
here on the sample repo, isolated from the enterprise lane.
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
* ci(parse-server-mongo): detect step also requires helper script on base ref
parse-server-mongo/ already exists on main (PRs #94/#95), so the
prior detect step returned true on every PR's release-coverage
job and the measure step then tried to invoke a helper script
that didn't exist on the base ref. Extending detect to require
the helper script too lets the first-PR escape hatch fire when
the workflow itself is the change being introduced.
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
* 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>
* ci(parse-server-mongo): drop trailing prose from sticky comment
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
* docs(parse-server-mongo): document coverage overlay; drop list-routes/FIRED_ROUTES refs
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
---------
Signed-off-by: Akash Kumar <meakash7902@gmail.com>1 parent ac33825 commit 5094f03
10 files changed
Lines changed: 1145 additions & 136 deletions
File tree
- .github/workflows
- scripts
- parse-server-mongo
| 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 | + | |
Lines changed: 86 additions & 0 deletions
| 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 | + | |
| 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 | + | |
0 commit comments