fork of hey-api/openapi-ts because I need some additional things

test: print logs

Lubos 0b773597 0a76a039

+6 -36
+6 -36
scripts/examples-generate.sh
··· 10 10 ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" 11 11 12 12 echo "⏳ Generating client code for all examples..." 13 - # Build the CLI package so its bin is available to examples in the workspace. 14 - echo "Building @hey-api/openapi-ts (required for example generation)..." 15 - if pnpm -w -s --version >/dev/null 2>&1; then 16 - pnpm -w -s --filter "@hey-api/openapi-ts" build 17 - else 18 - pnpm -s --filter "@hey-api/openapi-ts" build 19 - fi 20 13 21 14 # Find all examples with openapi-ts script and generate code in parallel 22 15 # Concurrency control: adjust this number depending on CI machine resources ··· 52 45 echo "Generating: $example_name" 53 46 set -e 54 47 cd "$dir" 55 - echo "-> Debug: node $(node --version 2>/dev/null || echo 'node-not-found')" 56 - echo "-> Debug: pnpm $(pnpm --version 2>/dev/null || echo 'pnpm-not-found')" 57 - echo "-> Debug: pwd $(pwd)" 58 - echo "-> Running pnpm run openapi-ts (invokes package script in example)" 59 - # Run the example's package script so pnpm resolves the workspace binary correctly 60 - # Use silent mode to keep logs concise but preserve errors 61 - echo "--- begin openapi-ts output ---" 62 - if pnpm -s --version >/dev/null 2>&1; then 63 - pnpm -s run openapi-ts || rc=$? 64 - else 65 - pnpm run openapi-ts || rc=$? 66 - fi 67 - rc=${rc:-0} 68 - echo "--- end openapi-ts output (rc=$rc) ---" 69 - if [ "$rc" -ne 0 ]; then 70 - echo "openapi-ts failed with exit code $rc" 71 - exit $rc 72 - fi 48 + echo "-> Running openapi-ts" 49 + pnpm run openapi-ts 73 50 74 51 # Format generated files in this example only to keep the step fast 75 52 if command -v pnpm >/dev/null 2>&1 && pnpm -w -s --version >/dev/null 2>&1; then ··· 103 80 # Read the metadata file which contains the path to the real log 104 81 logpath=$(cat "$tmpdir/$pid.log" 2>/dev/null || echo "") 105 82 if [ -n "$logpath" ] && [ -f "$logpath" ]; then 106 - echo "❌ $name failed — showing log excerpt ($logpath):" 107 - echo "---- log excerpt (last 200 lines) ----" 108 - tail -n 200 "$logpath" || true 109 - echo "---- possible error lines (case-insensitive match: error|exception|failed) ----" 110 - if grep -iE 'error|exception|failed' "$logpath" >/dev/null 2>&1; then 111 - # show up to 200 matching lines to keep CI output bounded 112 - grep -iE 'error|exception|failed' "$logpath" | sed -n '1,200p' || true 113 - else 114 - echo "(no obvious error lines found in log)" 115 - fi 116 - echo "Full log available at: $logpath" 83 + echo "❌ $name failed — showing full log ($logpath):" 84 + echo "---- full log start ----" 85 + cat "$logpath" || true 86 + echo "---- full log end ----" 117 87 else 118 88 echo "❌ $name failed — no log found (metadata: $tmpdir/$pid.log)" 119 89 fi