Skip to content

fix(timeout): reject invalid request-timeout flags#53

Open
JerryNee wants to merge 1 commit into
TestSprite:mainfrom
JerryNee:fix/request-timeout-flag-validation
Open

fix(timeout): reject invalid request-timeout flags#53
JerryNee wants to merge 1 commit into
TestSprite:mainfrom
JerryNee:fix/request-timeout-flag-validation

Conversation

@JerryNee

Copy link
Copy Markdown

Summary

  • centralize parsing for the global --request-timeout <seconds> flag
  • reject explicit invalid values such as abc, 0, 1.5, and 601 with a local VALIDATION_ERROR instead of silently using/rounding/clamping another timeout
  • keep env/direct factory timeout resolution behavior unchanged while wiring auth/project/test/usage/setup through the shared flag parser

Repro

Before this change, testsprite project list --dry-run --request-timeout abc exited 0 and used the default timeout. After this change it exits 5 with a machine-readable VALIDATION_ERROR naming request-timeout.

Verification

  • npm test -- src/lib/client-factory.test.ts
  • npm test -- test/cli.subprocess.test.ts
  • npm run lint
  • npm run typecheck
  • npm test
  • npm run build
  • node dist/index.js --output json project list --dry-run --request-timeout abc

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.

1 participant