Skip to content

test(diagnostics): expand stellar cli version diagnostic fixtures (#100) - #228

Open
aipd506 wants to merge 1 commit into
DigiNodes:mainfrom
aipd506:feat/stellar-cli-diagnostic-fixtures
Open

aipd506 wants to merge 1 commit into
DigiNodes:mainfrom
aipd506:feat/stellar-cli-diagnostic-fixtures

Conversation

@aipd506

@aipd506 aipd506 commented Oct 2, 2026 •

Copy link
Copy Markdown

Fixes #100

Summary of Changes

  1. Created comprehensive diagnostic fixture library in tests/helpers/stellar-diagnostic-fixtures.ts covering supported semantic versions, whitespace variations, unsupported baselines below floor, malformed output shapes, non-zero execution exit codes, and process spawning errors.
  2. Supported current and future compatible Stellar version shapes: exact baseline floor (27.1.0), patch increments, minor increments, major increments, double-digit components, leading v prefixes, whitespace variations (tabs, spaces, CRLF, leading and trailing newlines), and SemVer prerelease/build metadata tags.
  3. Updated parseStellarVersion in src/diagnostics/stellar.ts to strictly support both prerelease and build metadata suffixes conforming to SemVer 2.0.0.
  4. Covered unsupported baseline versions below 27.1.0 (such as 27.0.0, 27.0.9, 26.0.0, 20.0.0, 0.1.0), asserting failure status, informative error descriptions, and explicit remediation guidance.
  5. Safely classified malformed version outputs: partial semver shapes (27, 27.1, v27, v27.1), invalid non-numeric segments (27.x.1, vA.B.C, 27.1.0a), quadruple quad numbers (27.1.0.0), binary and word prefixes (stellar 27.1.0, version 27.1.0), trailing text, empty or whitespace-only stdout, and structured non-version responses (JSON, YAML, HTML).
  6. Hardened non-zero process execution verification: verified that non-zero exit codes (1, 2, 126, 127, 137) take precedence over stdout content, ensuring failed executions with leftover stdout output fail closed.
  7. Maintained actionable remediation for missing CLI binaries (spawn ENOENT) and execution permissions (spawn EACCES), linking directly to official Stellar documentation while ensuring process errors and environment variables are never leaked.
  8. Enforced protected contract boundaries: verified that the diagnostic strictly invokes the official stellar executable with version and --only-version, never falls back to legacy soroban binaries, and performs zero inspection of identities, keys, networks, or configuration.
  9. Exported fixture definitions through tests/helpers/index.ts for reusable diagnostic test infrastructure across the repository.

Verification

  1. Executed Vitest diagnostic test suite in tests/stellar-diagnostic.test.ts with 64 passing tests and zero failures.
  2. Executed Vitest doctor command test suite in tests/doctor.test.ts with 5 passing tests and zero failures.
  3. Executed full static typecheck via tsc -p tsconfig.json --noEmit with zero TypeScript compilation errors.
  4. Executed ESLint verification via eslint . with zero lint errors or warnings.
  5. Executed Prettier formatting check across all modified files with Prettier code style confirmed.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b6f8c5d0-8c26-4aa5-81c2-2e661c29b0c0

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

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.

SW-005 — Expand Stellar CLI version-format diagnostic fixtures

1 participant