Replies: 1 comment
|
Hi, On the enumeration question: probably yes, but confirm it on the runner. The smallest sequence I'd use, with each step logging its own exit code and stderr:
For keeping launch checks separate from what's safe to upload: write everything into one folder that nothing ever edits or deletes, and have your redaction step copy only the safe files into a second folder. Upload only the second folder. That way a rejection can't destroy the original evidence, which is what happened last time. Minimal example (paths, the boot step id and the redaction script are placeholders for yours): - name: Validate and run one UI test
id: uitest
shell: bash
env:
XCTESTRUN: build/Products/MyApp.xctestrun # your path
SIM_UDID: ${{ steps.boot_sim.outputs.udid }} # from your boot step
ONLY: MyAppUITests/LoginTests/testLogin # Target/Class/method
run: |
# shell: bash runs with -e and pipefail by default; turn -e off so every
# exit code gets recorded instead of the step dying silently
set +e
mkdir -p diag
DEST="platform=iOS Simulator,id=$SIM_UDID"
xcodebuild -version > diag/xcode-version.txt 2>&1
plutil -lint "$XCTESTRUN" > diag/lint.out 2> diag/lint.err
rc=$?; echo "lint=$rc" >> diag/status.txt
[ "$rc" -eq 0 ] || exit "$rc"
xcrun simctl list devices available > diag/devices.txt 2>&1
grep -q "$SIM_UDID" diag/devices.txt
rc=$?; echo "sim_found=$rc" >> diag/status.txt
[ "$rc" -eq 0 ] || exit "$rc"
xcodebuild test-without-building \
-xctestrun "$XCTESTRUN" \
-destination "$DEST" \
"-only-testing:$ONLY" \
-enumerate-tests \
-test-enumeration-format json \
-test-enumeration-output-path diag/enumeration.json \
> diag/enumerate.out 2> diag/enumerate.err
rc=$?; echo "enumerate=$rc" >> diag/status.txt
[ "$rc" -eq 0 ] || exit "$rc"
xcodebuild test-without-building \
-xctestrun "$XCTESTRUN" \
-destination "$DEST" \
"-only-testing:$ONLY" \
-resultBundlePath diag/UITest.xcresult \
> diag/test.out 2> diag/test.err
rc=$?; echo "test=$rc" >> diag/status.txt
exit "$rc"
- name: Redact diagnostics
if: failure()
run: ./scripts/redact.sh diag upload # reads diag/, copies only safe files to upload/
- name: Upload diagnostics
if: failure()
uses: actions/upload-artifact@v4 # or whichever version you already use
with:
name: uitest-diagnostics
path: upload/
if-no-files-found: warndiag/status.txt tells you which step stopped the run, and the .xcresult only exists if the last command got far enough to create it, so your redaction script should handle it being missing. Hope that gets you to an actual test run. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
💬 Feature/Topic Area
Workflow Configuration
Discussion Details
I’m trying to run an iOS UI test on a GitHub-hosted macOS runner. The app and UI test runner compiled, the simulator booted, and app installation succeeded.
The test itself never started. Our own diagnostic-redaction check rejected the .xctestrun file and stopped preparation before xcodebuild test-without-building was invoked. This is a defect in our preparation script, not evidence of a GitHub outage or an app crash. A separate collection bug then allowed the original file to be deleted, so we no longer have the exact reason for that rejection. No .xcresult was created.
The recorded environment was macos-15, Xcode 26.3 (17C529), and an iPhone SE (3rd generation) simulator on iOS 26.2. The recorded TestBundlePath and TestHostPath existed. We need to keep local launch checks separate from deciding what is safe to upload as diagnostics.
What is the smallest supported Xcode validation sequence to check an existing .xctestrun, its app/test-runner paths, the simulator destination, and one requested UI test before executing it? In particular, can test enumeration use the same .xctestrun, destination, and only-testing filter with this Xcode version?
A minimal GitHub Actions example that also retains the command’s exit status and stderr, plus the .xcresult when one exists, on failure would help. We cannot share the private repository or raw environment files.
All reactions