Skip to content

Commit 0589c75

Browse files
authored
Fix FV iOS job (#1506)
- Switch from iPhone11 to 14 - Enable tester app installation on it - Add test execution - TODO later in OLPEDGE-2543: finish with app log parsing and test results parsing Relates-To: OLPEDGE-2543 Signed-off-by: Yaroslav Stefinko <ext-yaroslav.stefinko@here.com>
1 parent 98f82b7 commit 0589c75

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

scripts/ios/fv/gh-actions-functional-network-test.sh

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -ex
22
#
3-
# Copyright (C) 2021 HERE Europe B.V.
3+
# Copyright (C) 2021-2024 HERE Europe B.V.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -97,37 +97,45 @@ xcrun simctl list
9797
xcrun simctl list devices
9898
xcrun simctl list runtimes
9999

100-
export CurrentDeviceUDID=$(xcrun simctl list devices | grep "iPhone 11 (" | grep -v "unavailable" | grep -v "com.apple.CoreSimulator.SimDeviceType" | cut -d'(' -f2 | cut -d')' -f1 | head -1)
100+
export CurrentDeviceUDID=$(xcrun simctl list devices | grep "iPhone 14 (" | grep -v "unavailable" | grep -v "com.apple.CoreSimulator.SimDeviceType" | cut -d'(' -f2 | cut -d')' -f1 | head -1)
101101

102102
# Create new Simulator device
103103

104-
xcrun simctl list devices | grep "iPhone 11"
105-
xcrun simctl boot "iPhone 11" || true
106-
xcrun simctl list devices | grep "iPhone 11"
107-
xcrun simctl create ${GITHUB_RUN_ID}_iphone11 "com.apple.CoreSimulator.SimDeviceType.iPhone-11"
108-
xcrun simctl list devices | grep "iPhone 11"
104+
xcrun simctl list devices | grep ${CurrentDeviceUDID}
105+
xcrun simctl boot ${CurrentDeviceUDID} || true
106+
xcrun simctl list devices | grep ${CurrentDeviceUDID}
107+
xcrun simctl create ${GITHUB_RUN_ID}_iphone14 "com.apple.CoreSimulator.SimDeviceType.iPhone-14"
108+
xcrun simctl list devices | grep ${CurrentDeviceUDID}
109109
echo "Simulator created"
110110

111-
#/Applications/Xcode_11.2.1.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID ${CurrentDeviceUDID} & export SIMULATOR_PID=$! || /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID ${CurrentDeviceUDID} & export SIMULATOR_PID=$!
112-
#echo "Simulator started device"
111+
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID ${CurrentDeviceUDID} & export SIMULATOR_PID=$! || /Applications/Xcode_15.0.1.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator -CurrentDeviceUDID ${CurrentDeviceUDID} & export SIMULATOR_PID=$!
112+
echo "Simulator started device"
113113
#
114-
#xcrun simctl logverbose enable
115-
#xcrun simctl install ${CurrentDeviceUDID} ./build/tests/functional/network/ios/olp-cpp-sdk-functional-network-tests-tester/Debug-iphonesimulator/olp-ios-olp-cpp-sdk-functional-network-tests-lib-tester.app
116-
#echo "App installed"
117-
#xcrun simctl launch ${CurrentDeviceUDID} com.here.olp.olp-ios-olp-cpp-sdk-functional-network-tests-lib-tester
118-
# Need to find out how to parse `xcrun simctl spawn booted log stream` and catch finish of test-run. Otherwise it goes to infinite loop.
119-
# xcrun simctl spawn booted log stream | grep "olp-ios-olp-cpp-sdk-functional-network-tests-lib-tester:" | tee app.log
120-
#result=$?
121-
#echo "App launched"
122-
#xcrun simctl shutdown ${CurrentDeviceUDID}
123-
#echo "Simulator shutdown done"
124-
125-
#echo ">>> Finished network tests >>>"
114+
xcrun simctl logverbose enable
115+
xcrun simctl install ${CurrentDeviceUDID} ./build/tests/functional/network/ios/olp-cpp-sdk-functional-network-tests-tester/Debug-iphonesimulator/olp-ios-olp-cpp-sdk-functional-network-tests-lib-tester.app
116+
echo "App installed"
117+
xcrun simctl launch ${CurrentDeviceUDID} com.here.olp.olp-ios-olp-cpp-sdk-functional-network-tests-lib-tester
118+
# TODO: Need to find out how to parse `xcrun simctl spawn booted log stream` and catch finish of test-run. Otherwise it goes to infinite loop.
119+
#xcrun simctl spawn booted log stream | grep "olp-ios-olp-cpp-sdk-functional-network-tests-lib-tester:"
120+
# TODO: Need to find out how to fix issue with Mock Server: OLPEDGE-2543
121+
xcrun simctl spawn booted log stream | grep "error" &
122+
# collect log data
123+
xcrun simctl spawn booted log collect
124+
# open location
125+
cd `xcrun simctl getenv booted SIMULATOR_SHARED_RESOURCES_DIRECTORY`
126+
ls -la /Users/runner/Library/Logs/CoreSimulator/AC3F6347-30F3-40CA-948A-58390550C1D1/system_logs.logarchive || true
127+
tail /Users/runner/Library/Logs/CoreSimulator/AC3F6347-30F3-40CA-948A-58390550C1D1/system_logs.logarchive || true
128+
result=$?
129+
echo "App launched"
130+
xcrun simctl shutdown ${CurrentDeviceUDID}
131+
echo "Simulator shutdown done"
132+
133+
echo ">>> Finished network tests >>>"
126134

127135
# Terminate the mock server
128-
#kill -TERM $SERVER_PID || true
129-
#kill -TERM $SIMULATOR_PID || true
136+
kill -TERM $SERVER_PID || true
137+
kill -TERM $SIMULATOR_PID || true
130138

131139
#wait
132140

133-
#exit ${result}
141+
exit ${result}

0 commit comments

Comments
 (0)