Skip to content

Commit f8e5022

Browse files
committed
Fix(performance): Correct UI test target and improve test script
The PerformanceExample UI tests were failing with a `UITargetAppPath should be provided` error. This was caused by the `TEST_TARGET_NAME` in the Xcode project being set to the product name (`PerformanceExampleSwift`) instead of the target name (`PerformanceExample`). Additionally, the main `test.sh` script is updated to only run the `sudo xcode-select` command during GitHub Actions, preventing sudo prompts during local execution and simplifying debugging.
1 parent 56cdd6e commit f8e5022

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

performance/PerformanceExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
277277
SWIFT_VERSION = 5.0;
278278
TARGETED_DEVICE_FAMILY = "1,2";
279-
TEST_TARGET_NAME = PerformanceExampleSwift;
279+
TEST_TARGET_NAME = PerformanceExample;
280280
};
281281
name = Debug;
282282
};
@@ -305,7 +305,7 @@
305305
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
306306
SWIFT_VERSION = 5.0;
307307
TARGETED_DEVICE_FAMILY = "1,2";
308-
TEST_TARGET_NAME = PerformanceExampleSwift;
308+
TEST_TARGET_NAME = PerformanceExample;
309309
};
310310
name = Release;
311311
};

scripts/test.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ else
143143
fi
144144

145145
function xcb() {
146-
echo xcodebuild "$@"
147-
xcodebuild "$@" | xcpretty
146+
echo xcodebuild -quiet "$@"
147+
xcodebuild -quiet "$@" | xcpretty
148148
}
149149

150150
# Run xcodebuild
151-
sudo xcode-select -s "/Applications/Xcode_${xcode_version}.app/Contents/Developer"
151+
if [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then
152+
sudo xcode-select -s "/Applications/Xcode_${xcode_version}.app/Contents/Developer"
153+
fi
152154
xcb "${flags[@]}"
153155
echo "$message"

0 commit comments

Comments
 (0)