Commit 69ad7f2
test(provisioner): real-backend gRPC round-trips for Mongo/Queue/Storage (Wave 4) (#47)
* test(provisioner): real-backend gRPC round-trips for Mongo/Queue/Storage (Wave 4)
Closes the remaining cells of the provisioner gRPC × backend matrix
(INTEGRATION-COVERAGE-PLAN §2.3 / Wave 4). Postgres + Redis server-layer
round-trips already shipped (#45, #46); this adds the real-backend
Provision → assert artifact → Deprovision → assert-gone lifecycle for the
three remaining backends, all driven through the genuine gRPC handlers
(breaker wrapping, tier routing, mapError, response shaping):
- Mongo: ProvisionResource creates usr_/db_ on a real MongoDB, GetStorageBytes
reads real dbStats (>0 after seeding), DeprovisionResource runs the real
dropUser/dropDatabase (truehomie DROP-incident class), second Deprovision is
a clean idempotent no-op, and Regrade(mongo) asserts the documented skip path.
- Queue (NATS): ProvisionResource passes the real NATS monitor health check and
returns nats:// URL + subject prefix, GetStorageBytes(queue)=0 (message-metered),
Deprovision is the shared-backend no-op, idempotent.
- Storage (MinIO/S3): GetStorageBytes object-walk — empty prefix=0, after a real
PutObject=exact byte count, after delete=0. (Storage Provision/Deprovision are
API-side; provisioner only meters.)
All tests env-gated (skip cleanly under `go test -short`, the deploy gate; run
for real when the backend env is present). CI: added NATS service container +
MinIO docker-run step + the TEST_NATS_HOST / TEST_MINIO_* / CUSTOMER_MONGO_AUTH_URL
env wiring to coverage.yml so they execute (mongo was already provided).
Verified locally against real mongo/nats/minio containers: all 8 server
round-trip tests PASS; integration-only coverage for internal/server = 99.2%
(provisionMongo/provisionQueue/GetStorageBytes/DeprovisionResource/RegradeResource
all 100%). No bug found in the destroy/regrade paths. Added
INTEGRATION-COVERAGE-EXCLUSIONS.md documenting the ≥80 floor method + the only
genuinely-unreachable lines (k8s dedicated-backend boot wiring, cmd/ entrypoints).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci(provisioner): start NATS via docker run, not a services container
The minimal nats:2 image has no wget/curl/nc, so the service-container
--health-cmd ('wget ... :8222/healthz') could never pass — GitHub Actions
marked the container unhealthy and aborted the coverage job before any test
ran (NATS logged 'Server is ready'). Mirror the MinIO pattern: docker run
nats:2 -js -m 8222 + a runner-side curl wait on /healthz. Unblocks #47.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Manas Srivastava <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent bb1935b commit 69ad7f2
3 files changed
Lines changed: 635 additions & 0 deletions
File tree
- .github/workflows
- internal/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
| |||
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
123 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
124 | 152 | | |
125 | 153 | | |
126 | 154 | | |
| |||
146 | 174 | | |
147 | 175 | | |
148 | 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 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
149 | 217 | | |
150 | 218 | | |
151 | 219 | | |
| |||
| 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 | + | |
0 commit comments