Skip to content

chore: soak test scripts to typescript#3062

Open
AmberFryar wants to merge 10 commits intomainfrom
3061-soak-test-scripts-to-typescript
Open

chore: soak test scripts to typescript#3062
AmberFryar wants to merge 10 commits intomainfrom
3061-soak-test-scripts-to-typescript

Conversation

@AmberFryar
Copy link
Copy Markdown
Contributor

Description

Converted soak-test.sh, soak-summary.sh, soak-test-metrics.sh, soak-record-metrics.sh to .ts files to reduce complexity and increase maintainability.

End to End Test:
(See Pepr Excellent Examples)

Related Issue

Fixes #

Relates to #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@AmberFryar AmberFryar requested a review from a team as a code owner April 21, 2026 17:22
@AmberFryar AmberFryar linked an issue Apr 21, 2026 that may be closed by this pull request
Comment thread scripts/soak-test.ts Fixed
…from environment values'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR converts four soak-test shell scripts to TypeScript, wiring them into the workflow with a new setup-node/npm ci step. The port is largely faithful — metric assertions, per-even-iteration pod stability checks, and updatePodMap inside the loop are all correctly restored — with one reporting regression: the post-stabilization cache miss trend section (### Cache Miss Trend) present in soak-summary.sh is absent from soak-summary.ts.

Confidence Score: 5/5

Safe to merge; the only finding is a P2 reporting regression in the step summary output that does not affect test correctness.

All functional test logic (metric assertions, pod stability, updatePodMap per even iteration) is correctly ported. The single finding is a missing informational section in the GitHub Step Summary — the test will still pass or fail correctly without it.

scripts/soak-summary.ts — missing cache miss trend section

Important Files Changed

Filename Overview
scripts/soak-test.ts New TypeScript soak test loop; restores metric assertions and per-even-iteration pod-stability + updatePodMap calls; sleep unconditionally at end of loop including final iteration; spawns a new npx tsx subprocess for record-metrics each of 70 iterations
scripts/soak-summary.ts New TypeScript summary writer; validates GITHUB_STEP_SUMMARY and args; missing post-stabilization cache miss trend section that was present in the bash equivalent
scripts/soak-record-metrics.ts Faithful TypeScript port of soak-record-metrics.sh; delta computation, state file, and CSV append logic are correct
.github/workflows/soak.yaml Adds setup-node (v24) and npm ci before npx tsx; switches bash script invocations to TypeScript; CACHE_MISS_GROWTH_THRESHOLD still defined as env var for soak-test.ts but no longer passed as positional arg to summary script
config/tsconfig.scripts.json New tsconfig for scripts/ directory; strict, NodeNext module resolution, ES2022 target — appropriate for tsx-executed scripts
config/eslint.root.config.mjs Adds tsconfig.scripts.json to the ESLint parser project list so TypeScript scripts are linted correctly

Sequence Diagram

sequenceDiagram
    participant WF as soak.yaml
    participant ST as soak-test.ts
    participant RM as soak-record-metrics.ts
    participant SS as soak-summary.ts
    participant K8s as kubectl/cluster

    WF->>ST: npx tsx soak-test.ts
    ST->>K8s: updatePodMap() — initial snapshot
    loop i = 1..70 (every 5 min)
        ST->>K8s: collectMetrics()
        ST->>RM: npx tsx soak-record-metrics.ts i auditor informer metrics.csv
        RM-->>ST: appends CSV row
        ST->>ST: assertMetrics(i) — ctrl failures, cache miss growth, resync failures
        opt i % 2 === 0
            ST->>K8s: checkPodStability(i) + updatePodMap()
        end
        ST->>ST: sleep 300s
    end
    ST-->>WF: exit 0 / exit 1 + failure-reason.txt
    WF->>SS: npx tsx soak-summary.ts metrics.csv informer-log failure-reason
    SS->>SS: read CSV, compute totals
    SS-->>WF: write GITHUB_STEP_SUMMARY
Loading

Reviews (3): Last reviewed commit: "chore: address greptile comments" | Re-trigger Greptile

Comment thread .github/workflows/soak.yaml
Comment thread scripts/soak-test.ts Outdated
Comment thread scripts/soak-summary.ts Outdated
AmberFryar and others added 4 commits April 21, 2026 11:27
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@AmberFryar AmberFryar changed the title 3061 soak test scripts to typescript chore: soak test scripts to typescript Apr 21, 2026
Comment thread scripts/soak-test.ts Outdated
Comment thread scripts/soak-test.ts
Comment thread scripts/soak-test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Soak Test Scripts to Typescript

2 participants