Skip to content

Commit 793cff2

Browse files
test(analytics): comprehensive integration and edge-case tests (#3308)
* test(analytics): add comprehensive integration and edge-case tests Express integration tests (supertest): middleware tracks real requests, handles concurrent load, skips health routes, captures query strings. Service resilience tests: SDK error propagation (sync + async), post-shutdown no-op safety, double-shutdown idempotency, optional args. Init wiring tests: module init calls AnalyticsService.init(), registers middleware, sets up billing plan.changed listener with error isolation. Feature-flag middleware edge cases: falsy _id variants (null, 0, empty), ObjectId-like coercion, concurrent flag evaluations, 403 response shape. Closes #3298 * fix(skills): align verify, feature, and pull-request with Vue conventions * fix(analytics): update comprehensive tests for async init and query stripping
1 parent 7a24d2a commit 793cff2

4 files changed

Lines changed: 632 additions & 3 deletions

File tree

.claude/skills/feature/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ If an action affects another user:
7777
- [ ] Error responses have user-friendly `description` field
7878

7979
**Tests:**
80-
- [ ] Tests: add unit + integration tests. Add E2E (`*.e2e.tests.js`) only if the change affects a critical user flow (auth, org onboarding, invite/join).
80+
- [ ] Tests: add unit (`*.unit.tests.js`) + integration (`*.integration.tests.js`) tests. Add E2E (`*.e2e.tests.js`) only if the change affects a critical user flow (auth, org onboarding, invite/join).
8181

8282
**Modularity:**
8383
- [ ] Isolated in ONE module (or justified)

.claude/skills/pull-request/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ REPEAT:
135135
6. If actionable comments → fix all, /verify, commit, push, reply, resolve, consecutive_zero=0, GOTO 1
136136
7. If non-actionable unresolved → reply all explaining why, resolve all, consecutive_zero=0, GOTO 5
137137
8. If zero unresolved threads → consecutive_zero++
138-
if consecutive_zero >= 3 → check branch protection (see 6f), then STOP ✓
138+
if consecutive_zero >= 3 (~9 min) → check branch protection (see 6f), then STOP ✓
139139
else GOTO 3
140140
```
141141

@@ -202,14 +202,15 @@ Wait 30s before watching CI (regular or force-push). Loop back to 6a. Never post
202202

203203
### 6f. Stop condition
204204

205-
CI green **and** 2 consecutive passes with zero unresolved threads. Mergeable status is also checked after every CI pass (step 2b) — conflicts cause an early stop. Final branch protection check:
205+
CI green **and** 3 consecutive passes (~9 min of grace periods) with zero unresolved threads. Mergeable status is also checked after every CI pass (step 2b) — conflicts cause an early stop. Final branch protection check:
206206

207207
```bash
208208
gh pr view "$PR" --json reviewDecision,mergeable | jq '{reviewDecision, mergeable}'
209209
```
210210

211211
- `APPROVED` + `MERGEABLE`**STOP ✓**
212212
- `REVIEW_REQUIRED` → report to user, stop
213+
- `CHANGES_REQUESTED` → report to user, stop
213214
- `BLOCKED` → report details to user
214215

215216
**Safety limit:** 10 iterations max — report to user if still unresolved.

0 commit comments

Comments
 (0)