api-client/packages/hoppscotch-cli/src
James George c6c86e8db2 fix(cli): prevent false test skips for intentional error scenarios
Refined network retry logic to distinguish between transient infrastructure
failures and intentional test errors, preventing incorrect test skips in
JUnit validation scenarios.

1. Network Error Detection (utils.ts)
   - Renamed `hasNetworkError` → `hasLowLevelNetworkError` for clarity
   - Removed REQUEST_ERROR from retry patterns (too generic, matches intentional bad URLs)
   - Now only retries on unambiguous TCP/DNS errors: ECONNRESET, EAI_AGAIN,
     ENOTFOUND, ETIMEDOUT, ECONNREFUSED
   - Preserved TEST_SCRIPT_ERROR detection when concurrent with REQUEST_ERROR
     (the actual CI failure mode from undefined response objects)
   - Added comprehensive JSDoc explaining when to use vs plain runCLI

2. JUnit XML Validation (test.spec.ts, 4 locations)
   - Removed REQUEST_ERROR and TEST_SCRIPT_ERROR from XML retry patterns
   - Only retry when low-level errors corrupt XML structure
   - Prevents skipping tests with intentional errors in collections
     (test-junit-report-export-coll.json has intentional invalid-url and
     script reference errors for validation)

3. Test Corrections
   - Fixed: "Fails to display console logs..." test now uses plain runCLI
     (test expects errors from legacy sandbox, shouldn't use retry)
   - Added: Environment version tests (v0, v1, v2) now use runCLIWithNetworkRetry
     (use echo.hoppscotch.io, expect success, benefit from retry)
   - Removed: Obsolete SKIP_EXTERNAL_TESTS env var check (retry logic handles this)
2025-11-26 19:39:38 +05:30
..
__tests__ fix(cli): prevent false test skips for intentional error scenarios 2025-11-26 19:39:38 +05:30
commands feat: migrate to a unified scripting system based on faraday-cage (#5090) 2025-05-23 22:54:27 +05:30
handlers feat: collection CLI runner with iterations and data feed (#4475) 2024-11-22 22:38:51 +05:30
interfaces feat(scripting-revamp): introduce hopp namespace (#5388) 2025-09-24 17:09:55 +05:30
options/test feat: migrate to a unified scripting system based on faraday-cage (#5090) 2025-05-23 22:54:27 +05:30
types feat: collection variables (#5325) 2025-08-22 14:39:42 +05:30
utils feat(scripting-revamp): add support for sending requests in scripting context (#5596) 2025-11-26 09:52:00 +05:30
index.ts feat: migrate to a unified scripting system based on faraday-cage (#5090) 2025-05-23 22:54:27 +05:30
tsconfig.json Feature: hopp-cli in TypeScript (#2074) 2022-03-28 13:56:15 +05:30