Skip to content

test(cloud): run every cloud script test by glob and fix the staging deploy-arguments test - #28785

Closed
zanmlakar wants to merge 1 commit into
stablyai:mainfrom
zanmlakar:zanmlakar/cloud-test-globs
Closed

zanmlakar wants to merge 1 commit into
stablyai:mainfrom
zanmlakar:zanmlakar/cloud-test-globs

Conversation

@zanmlakar

Copy link
Copy Markdown
Contributor

ELI5

The cloud's CI ran a hand-typed list of 80 test files. Two newer files were never added, so they never ran, and one of them had been failing for days without anyone noticing. Now CI runs every test file in those folders by pattern, so a new file can't be left out, and the failing test is fixed.

What Changed

  • Before: cloud/package.json named 80 test files, 22 in pretest and 58 in test. A new file only ran if someone added it to one of those lists. relay-deploy-workflow-argv.test.mjs and relay-live-cell-image-overlay.test.mjs were never added.
  • After: test is pnpm -r test && node --test "dev/scripts/**/*.test.mjs" "../.github/actions/cloud-sql-rollout-lease/*.test.mjs". The patterns match the same 80 files plus the two that were missing. Node expands the quoted patterns itself, so the shell doesn't matter. Cloud Verify uses Node 24, and cloud's engines requires 24 or newer.
  • pretest is folded into test: no file pattern separates the 22 pretest files from the other 58, so a separate step would still need a hand-written list. Nothing I found needs those 22 to run before the workspace tests. The split dates from the cloud import (chore(cloud): add the relay fence broker, ops console, Terraform root, scripts, and 24 cloud-* workflows #18413). They now run after pnpm -r test. That's also when relay-load-control-peer.test.mjs gets the @orca-cloud/relay-contract build it needs, from apps/relay's own pretest, which is unchanged.
  • Argv test fix: the test used to merge every bash array a workflow splices into one command line. Staging's three optional arrays, identity_args, shape_args and topology_args, are mutually exclusive by its guard step. Merging them built a call the workflow can never make, and deploy-relay-blue-green.mjs correctly refused it. The test now checks the call with none of the three and with each one alone. Arrays outside that set, such as floor_args, are always included. A new case pins that staging produces exactly those four command lines.

Why

Details are in #28774. A pattern can't silently miss a new file. The repo already lists this as a follow-up in cloud/docs/relay-improvement-checklist-2026-09.md:45.

Alternatives considered:

  • Adding the two files to the list: this fixes today's gap and leaves the next one.
  • A test that fails when a file isn't listed (the checklist's other option): this keeps an 80-entry string to maintain and adds a second check on top of it.
  • Letting deploy-relay-blue-green.mjs accept shape together with identity: that would be wrong. The staging guard forbids the pair on purpose, and the script is right to refuse it. The test was the thing that was wrong.
  • Keeping pretest as a second pattern: no pattern separates the two groups.

If the old run-these-first order was intentional, let me know and I'll restore a separate step.

Linked Issue

Fixes #28774

Visual Proof

N/A. This changes the cloud test command and one test; there's no UI or app behavior change.

Testing

  • Before, on main: running the two unlisted files gives 9 tests: 8 pass, and the argv test fails with --shape-baseline-revision cannot combine with a runtime identity bootstrap. The argv test passes on the commit before fix(relay): director reaches Cloud SQL through a proxy sidecar (staging), adoptable deploy shape, event-loop stall alert #27406 and fails from fix(relay): director reaches Cloud SQL through a proxy sidecar (staging), adoptable deploy shape, event-loop stall alert #27406 on.

  • After: the argv test passes (4 tests, including the new one), and relay-live-cell-image-overlay.test.mjs passes (6 tests).

  • File coverage: I compared the files the patterns match with the old lists. They match the old 80 plus the 2 missing files, with nothing dropped.

  • Full pattern run, locally: every file passes except relay-load-control-peer.test.mjs, which needs cloud/node_modules and the built @orca-cloud/relay-contract. I couldn't install the cloud workspace here. That file was already in the old list and is unchanged. In CI, pnpm -r test builds what it needs first.

  • Not run locally: pnpm test in cloud/ end to end, because it needs pnpm install there. Cloud Verify runs it on this PR, since cloud/** is in its path filter.

  • Lint: the repo's oxlint and oxfmt ignore cloud/**, so I matched the surrounding style by hand.

  • Platforms: Linux only. Cloud Verify runs on ubuntu-22.04.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Written with Claude Code (Claude Opus 5.5).

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The relay workflow argv test now generates and parses variants that include no more than one array from each exclusive set. It checks staging’s identity-bootstrap, shape-baseline, and capacity-cell arrays individually and verifies that each variant retains --min-instances. The cloud package test command now discovers dev script and cloud-SQL rollout-lease action tests with globs. The separate pretest script was removed.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to 628ca

The test command discovers the intended files, but the argv test misses a valid default staging invocation. Add that variant for confidence; this coverage gap does not appear to block merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies both primary changes: running all cloud script tests by glob and fixing the staging deploy-arguments test.
Description check Passed The description includes all required sections, explains the before and after state, gives the reason and alternatives, links issue #28774, documents testing limitations, and marks the visual proof as…
Linked Issues check Passed Issue #28774 requires Cloud Verify to run every test file in both target folders without a maintained file list, and requires the argv test to check only workflow-valid staging combinations. `cloud/pa…
Out of Scope Changes check Passed The changes are limited to the Cloud test command and the related relay workflow argv test. Both changes directly implement issue #28774. The test refactoring supports coverage of the required workflo…
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments: 1
cloud/dev/scripts/relay-deploy-workflow-argv.test.mjs: 1

135-146: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Model the preserve floor variant.

The staging workflow omits floor_args when min-instances is preserve, but argvVariants always expands the populated floor array. The assertion therefore excludes the default staging invocation and checks only invocations with --min-instances. Generate both omitted and present floor variants, using the reachable 0 and 2 values. Do not require --min-instances for every variant.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54685fbc-45e0-46a0-9ee0-8a803d48245a
📥 Commits

Reviewing files that changed from the base of the PR and between dc146c0 and 628ca94.

📒 Files selected for processing: 2
  • cloud/dev/scripts/relay-deploy-workflow-argv.test.mjs
  • cloud/package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@nwparker

Copy link
Copy Markdown
Contributor

Closing as obsolete. The test this PR fixes (cloud/dev/scripts/relay-deploy-workflow-argv.test.mjs) was removed from main in #31792 (307f0cd), when Relay deployment configuration moved into private cloud operations. cloud/package.json on main no longer has the per-file pretest/test lists, so there is nothing left to change. Thanks for the careful investigation.

@nwparker nwparker closed this Nov 26, 2026
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.

[Bug]: Cloud Verify never runs two cloud script tests, and one of them fails on main

2 participants