Skip to content

[quality] add 25 tests for ArgoCD parser functions in pkg/k8s#18269

Merged
kubestellar-hive[bot] merged 2 commits into
mainfrom
quality/test-argocd-parsers
Jun 13, 2026
Merged

[quality] add 25 tests for ArgoCD parser functions in pkg/k8s#18269
kubestellar-hive[bot] merged 2 commits into
mainfrom
quality/test-argocd-parsers

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds 25 unit tests covering ArgoCD parsing logic in pkg/k8s/argocd.go that was previously at 0-54.8% coverage.

parseGeneratorTypes (0% → 100%)

  • All 9 known generator types detected individually
  • Multiple generators, unknown types, invalid entries

parseAppSetConditionStatus (0% → 100%)

  • Healthy, Error, Progressing states
  • Error priority, invalid/empty conditions

parseArgoApplicationsFromList (54.8% → 100%)

  • Full app parsing (source, sync, health, timestamps)
  • Fallback reconciledAt, no-status defaults, edge cases

parseArgoApplicationSetsFromList (53.6% → 100%)

  • Full AppSet (generators, template, syncPolicy, status, appCount)
  • Manual sync, no-spec, error status

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)

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>
Copilot AI review requested due to automatic review settings June 13, 2026 06:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jun 13, 2026
@netlify

netlify Bot commented Jun 13, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole canceled.

Name Link
🔨 Latest commit 067bf80
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a2cf44a81eea70008bd96bc

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eeshaansa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Jun 13, 2026
@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


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>
@kubestellar-prow kubestellar-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 13, 2026
@kubestellar-hive

Copy link
Copy Markdown
Contributor Author

Additional commit: middleware WebSocket origin tests

Added 10 tests for pkg/api/middleware:

  • ValidateWebSocketOrigin: 0% → 100%
  • isWSOriginAllowed: 0% → 100%
  • Package coverage: 79.9% → 86.3% (+6.4pp)

Tests cover: no-origin (non-browser), dev mode bypass, host matching, rejection, trailing slash normalization, env override, case-insensitive matching, X-Forwarded-Proto.

@kubestellar-hive kubestellar-hive Bot merged commit d16ab8c into main Jun 13, 2026
26 of 33 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the quality/test-argocd-parsers branch June 13, 2026 07:32
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: d16ab8c97ed376a637061dcc62d634b4bae16a54
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/27460449706

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit d16ab8c97ed376a637061dcc62d634b4bae16a54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. quality size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. testing tier/3-restricted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant