Skip to content

[quality] add unit tests for demoData.ts (Refs #22679) - #22688

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-demodata
Open

[quality] add unit tests for demoData.ts (Refs #22679)#22688
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-demodata

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/demoData.test.ts (54 assertions) targeting the previously zero-test module web/src/lib/unified/registerHooks/demoData.ts (487 LOC) — a follow-up to #22679. Same lightweight structural-invariant pattern used for #22686 (acmm.criteria.ts).

What the tests cover

  • Module surface: every DEMO_* export is defined, non-null, and object-typed.
  • DEMO_HOOK_TABLE consistency:
    • Non-empty; every entry has { name: string, data: unknown[] }.
    • Hook names are unique and follow the use[A-Z][A-Za-z0-9]* React-hook convention.
    • Every referenced dataset is a non-empty array (catches accidental removals when new cards are wired up).
  • Representative dataset shapes (spot-checks that catch the most common regressions when the schema shifts):
    • DEMO_CLUSTER_METRICS — numeric timestamp/cpu/memory/pods.
    • DEMO_TOP_PODS — string name/namespace/cluster, numeric cpu/memory.
    • DEMO_GITOPS_DRIFT — status enum {synced, drifted}, numeric lastSync.
    • DEMO_ARGOCD_APPLICATIONS — Argo-shaped strings.
    • DEMO_STORAGE_OVERVIEW — numeric fields; used <= totalCapacity.
    • DEMO_COMPUTE_OVERVIEW — numeric fields.
    • DEMO_GPU_INVENTORY — utilization in [0, 100].
    • DEMO_RESOURCE_TREND — cpu/memory percentages in [0, 100].
    • DEMO_POD_HEALTH_TREND — non-negative counts.
  • Bulk check (table-driven via it.each): every array-typed DEMO_* export is a non-empty array of plain objects — 40+ generated cases with per-export failure messages.

Result

✓ src/lib/unified/registerHooks/__tests__/demoData.test.ts (54 tests) 101ms
Test Files  1 passed (1)
     Tests  54 passed (54)

Refs #22679 — this is the second in the follow-up series after #22686. lib/cache/cacheCore.ts and the hooks/mcp/* family remain open for later PRs (recorded as advisory beads).


Filed by quality agent (ACMM L3/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-opus-4.7

Adds `__tests__/demoData.test.ts` (54 assertions) targeting the
zero-test module `web/src/lib/unified/registerHooks/demoData.ts`
(487 LOC), a follow-up to #22679.

Asserts:
- every DEMO_* export is a defined, non-null array or object
- DEMO_HOOK_TABLE is internally consistent: unique names, useXxx
  PascalCase convention, every referenced dataset is a non-empty array
- representative dataset shapes (DEMO_CLUSTER_METRICS,
  DEMO_TOP_PODS, DEMO_GITOPS_DRIFT status enum,
  DEMO_ARGOCD_APPLICATIONS, DEMO_STORAGE_OVERVIEW,
  DEMO_COMPUTE_OVERVIEW, DEMO_GPU_INVENTORY, DEMO_POD_HEALTH_TREND,
  DEMO_RESOURCE_TREND percent bounds)
- every array-typed DEMO_* export is a non-empty array of plain objects
  (table-driven via it.each)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Aug 21, 2026
@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 64a9642
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a87e0b10451af0008b8060e
😎 Deploy Preview https://deploy-preview-22688.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@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 Aug 21, 2026
@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 21, 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.

// The pattern in the table is: array-typed exports are inlined,
// object-typed exports are wrapped as `[DEMO_FOO]`. A .length of 1
// where the element is a plain object confirms the wrapper form.
for (const { name, data } of DEMO_HOOK_TABLE) {
// The pattern in the table is: array-typed exports are inlined,
// object-typed exports are wrapped as `[DEMO_FOO]`. A .length of 1
// where the element is a plain object confirms the wrapper form.
for (const { name, data } of DEMO_HOOK_TABLE) {
@github-actions

Copy link
Copy Markdown
Contributor

❌ Playwright Tests Failed

📊 View Full Report

Download the playwright-report artifact from the workflow run for screenshots and detailed traces.

To view the report locally:

# Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report

@kubestellar-hive

Copy link
Copy Markdown
Contributor Author

🛑 Fix loop escalated — human attention needed

This PR has failed CI on 1 distinct fix attempts (new commits, still red). The hive has stopped dispatching further automated fixes for it.

Failing checks: Test (chromium, shard 2), Test (chromium, shard 3), build-gate

Raw failure evidence (from check-run annotations):

Test (chromium, shard 3): Process completed with exit code 1.
Test (chromium, shard 3): 2) [chromium] › e2e/smoke.spec.ts:161:5 › Smoke Tests › Navigation Consistency › clicking navbar logo navigates to home from non-home route 
Test (chromium, shard 3): 2) [chromium] › e2e/smoke.spec.ts:161:5 › Smoke Tests › Navigation Consistency › clicking navbar logo navigates to home from non-home route 
Test (chromium, shard 3): 1) [chromium] › e2e/perf/dashboard-nav.spec.ts:520:1 › cold-nav — first visit to each dashboard via sidebar 
Test (chromium, shard 3): 1) [chromium] › e2e/perf/dashboard-nav.spec.ts:520:1 › cold-nav — first visit to each dashboard via sidebar 
Test (chromium, shard 2): 3) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to FedRAMP vertical 

Remove the needs-human label after addressing the root cause to return the PR to the automated fix lane.

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. needs-human size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant