[quality] add 25 tests for ArgoCD parser functions in pkg/k8s#18269
Conversation
Cover previously-untested or undertested ArgoCD parsing logic: parseGeneratorTypes (0% → 100%): - All 9 known generator types detected individually - Multiple generators in single AppSet - Unknown/empty/invalid entries handled gracefully parseAppSetConditionStatus (0% → 100%): - Healthy, Error, Progressing states - Error takes priority over other conditions - Invalid/empty conditions default to Progressing parseArgoApplicationsFromList (54.8% → 100%): - Full app with source, sync, health, operationState - Fallback to reconciledAt when operationState missing - No-status defaults to Unknown - Non-UnstructuredList and empty list handling parseArgoApplicationSetsFromList (53.6% → 100%): - Full AppSet with generators, template, syncPolicy, status, appCount - Manual sync policy (no automated key) - No-spec and error status cases All 4 target functions now at 100% coverage. Signed-off-by: Copilot <copilot@example.com>
✅ Deploy Preview for kubestellarconsole canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
Cover ValidateWebSocketOrigin and isWSOriginAllowed (both were 0%): - No Origin header (non-browser) → allowed - Dev mode → all origins allowed - Matching host → allowed - Mismatched host → rejected (403) - Trailing slash normalization - ALLOWED_WS_ORIGINS env override: allowed list, rejection, case-insensitive - X-Forwarded-Proto HTTPS detection Both functions: 0% → 100% Package coverage: 79.9% → 86.3% (+6.4pp) Signed-off-by: Copilot <copilot@example.com>
Additional commit: middleware WebSocket origin testsAdded 10 tests for
Tests cover: no-origin (non-browser), dev mode bypass, host matching, rejection, trailing slash normalization, env override, case-insensitive matching, X-Forwarded-Proto. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
✅ Post-Merge Verification: passedCommit: |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
Test Improvement
Adds 25 unit tests covering ArgoCD parsing logic in
pkg/k8s/argocd.gothat was previously at 0-54.8% coverage.parseGeneratorTypes (0% → 100%)
parseAppSetConditionStatus (0% → 100%)
parseArgoApplicationsFromList (54.8% → 100%)
parseArgoApplicationSetsFromList (53.6% → 100%)
All 4 target functions: 0-54.8% → 100%
Package coverage: 73.5% → 74.6% (+1.1pp)
Filed by quality agent (ACMM L4/L6 — full mode)