Skip to content

fix(node-dependency-matrix): count gRPC test cases in recording calibration (0 → 2)#103

Merged
Shivanipandey31 merged 1 commit into
codex/node-dependency-matrixfrom
grpc-testcase-calibration
Jul 2, 2026
Merged

fix(node-dependency-matrix): count gRPC test cases in recording calibration (0 → 2)#103
Shivanipandey31 merged 1 commit into
codex/node-dependency-matrixfrom
grpc-testcase-calibration

Conversation

@Shivanipandey31

Copy link
Copy Markdown
Contributor

📝 Description

Problem

The kube-regression suite (enterprise-ui, kube-flow.spec.ts test 8) asserts that the number of recorded test cases stays at or below a calibrated total read from this sample's fixtures/expected-values.json:

getExpectedTotalTestcases() = httpTrafficScript.expectedTestcasesExact
                            + grpcTrafficScript.expectedAdditionalTestcasesExact

expectedAdditionalTestcasesExact was pinned at 0 because, at calibration time, k8s-proxy silently dropped gRPC test cases from the recording session — processTestCase only counted entries with a non-empty HTTPReq.URL, so the two gRPC calls in send_grpc_traffic.sh never incremented the recorded total. Observed gRPC contribution was genuinely 0.

k8s-proxy PR #542 now records gRPC test cases (recognizes GRPC_EXPORT, populates the endpoint list, increments TestsRecorded). With that change the recording produces 21 test cases (19 HTTP + 2 gRPC), tripping the assertion:

Error: Recorded test cases should not exceed the calibrated dedup total
Expected: <= 19
Received:    21

Fix

Bump grpcTrafficScript.expectedAdditionalTestcasesExact from 0 → 2, so the calibrated total becomes 19 + 2 = 21 and matches the recorded reality once gRPC cases are counted.

This just reconciles the aggregate with the per-call values already declared in the same file — both gRPC calls (Ping, RunDependencyScenario) already carry expectedAdditionalTestcases: 1.

🔄 Change

  • node-dependency-matrix/fixtures/expected-values.json: expectedAdditionalTestcasesExact 0 → 2 (1 line)

✅ Compatibility

The kube-regression assertion is a <= ceiling, so raising it is backward-compatible:

  • Released k8s-proxy (records 19): 19 <= 21
  • k8s-proxy PR #542 (records 21): 21 <= 21

No ordering dependency with PR #542 — this can merge before or after it without breaking any consumer.

🧪 Testing

Validated against k8s-proxy PR #542's playwright-kube-regression pipeline by temporarily pointing SAMPLES_TYPESCRIPT_REF at this change. Test 8 went green with Test cases=21 and the full record → auto-replay flow completed:

Attempt 1/30: Test cases=21, Mocks=52, ... ready=true
✓ 8. Assert dedup data matches expected-values.json (10.8s)

Related: keploy/k8s-proxy#542

…ration

k8s-proxy now records gRPC test cases in the recording session (previously
dropped because processTestCase only counted entries with a non-empty
HTTPReq.URL). The two calls in send_grpc_traffic.sh (Ping,
RunDependencyScenario) each declare expectedAdditionalTestcases: 1, so the
aggregate must reflect them.

Bump grpcTrafficScript.expectedAdditionalTestcasesExact 0 -> 2 so
getExpectedTotalTestcases() settles at 19 (HTTP) + 2 (gRPC) = 21, matching
the recorded total once k8s-proxy counts gRPC cases. The kube-regression
assertion is a <= ceiling, so this stays backward-compatible with released
k8s-proxy (records 19; 19 <= 21).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Shivanipandey31 Shivanipandey31 merged commit 9922fb5 into codex/node-dependency-matrix Jul 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant