native macOS codings agent orchestrator
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve test output with xcsift and xcresult failure summary

onevcat e08da9e4 e9a581be

+84 -1
+8
.github/workflows/test.yml
··· 23 23 - run: make test 24 24 - run: make test-cli-smoke 25 25 - run: make test-cli-integration 26 + - name: Upload xcresult bundle (on failure) 27 + if: failure() 28 + uses: actions/upload-artifact@v4 29 + with: 30 + name: xcresult-${{ github.run_id }}-${{ github.run_attempt }} 31 + path: build/test-results/**/*.xcresult 32 + if-no-files-found: ignore 33 + retention-days: 7
+12 -1
Makefile
··· 241 241 bash -o pipefail -c 'xcodebuild -exportArchive -archivePath build/supacode.xcarchive -exportPath build/export -exportOptionsPlist build/ExportOptions.plist 2>&1 | mise exec -- xcsift -qw --format toon' 242 242 243 243 test: ensure-ghostty 244 - xcodebuild test -project supacode.xcodeproj -scheme supacode -destination "platform=macOS" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) 2>&1 244 + @set -euo pipefail; \ 245 + result_bundle="$(CURRENT_MAKEFILE_DIR)/build/test-results/supacode-tests.xcresult"; \ 246 + mkdir -p "$$(dirname "$$result_bundle")"; \ 247 + rm -rf "$$result_bundle"; \ 248 + set +e; \ 249 + xcodebuild test -project supacode.xcodeproj -scheme supacode -destination "platform=macOS" -resultBundlePath "$$result_bundle" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) 2>&1 | mise exec -- xcsift -w --format toon; \ 250 + xcodebuild_status=$${PIPESTATUS[0]}; \ 251 + set -e; \ 252 + if [ "$$xcodebuild_status" -ne 0 ]; then \ 253 + bash "$(CURRENT_MAKEFILE_DIR)/scripts/print-xcresult-failures.sh" "$$result_bundle" || true; \ 254 + fi; \ 255 + exit "$$xcodebuild_status" 245 256 246 257 test-cli-smoke: build-cli # Smoke test CLI executable 247 258 @set -euo pipefail; \
+64
scripts/print-xcresult-failures.sh
··· 1 + #!/usr/bin/env bash 2 + 3 + set -euo pipefail 4 + 5 + if [ "$#" -ne 1 ]; then 6 + echo "usage: $0 <xcresult-path>" >&2 7 + exit 0 8 + fi 9 + 10 + result_bundle="$1" 11 + 12 + if [ ! -d "$result_bundle" ]; then 13 + echo "warning: xcresult bundle not found at $result_bundle" 14 + exit 0 15 + fi 16 + 17 + if ! command -v jq >/dev/null 2>&1; then 18 + echo "warning: jq is required to parse xcresult summary details" 19 + exit 0 20 + fi 21 + 22 + summary_json="$(mktemp)" 23 + cleanup() { 24 + rm -f "$summary_json" 25 + } 26 + trap cleanup EXIT 27 + 28 + if ! xcrun xcresulttool get test-results summary --path "$result_bundle" --compact >"$summary_json" 2>/dev/null; then 29 + echo "warning: failed to parse xcresult summary from $result_bundle" 30 + exit 0 31 + fi 32 + 33 + failed_tests="$( 34 + jq -r ' 35 + if (.failedTests? | type) == "number" then .failedTests 36 + elif (.failedTests? | type) == "string" then (.failedTests | tonumber? // 0) 37 + else 0 38 + end 39 + ' "$summary_json" 40 + )" 41 + 42 + if [ "$failed_tests" -eq 0 ]; then 43 + echo "No failed tests found in xcresult summary." 44 + exit 0 45 + fi 46 + 47 + echo 48 + echo "================ xcresult failure details ================" 49 + 50 + jq -r ' 51 + (.testFailures // []) as $failures 52 + | if ($failures | length) == 0 then 53 + "warning: summary has failedTests=\(.failedTests // "unknown"), but no testFailures entries were found." 54 + else 55 + $failures[] 56 + | "test: \(.testName // "unknown")", 57 + "target: \(.targetName // "unknown")", 58 + "identifier: \(.testIdentifierString // "n/a")", 59 + ("failure: " + ((.failureText // "n/a") | gsub("\\n"; "\n "))), 60 + "" 61 + end 62 + ' "$summary_json" 63 + 64 + echo "=========================================================="