Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ jobs:
timeout-minutes: 5 # 5 minutes timeout
env:
OS_VERSION: "18.4"
run: ./sentry-cocoa/scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION"
PLATFORM: "iOS"
run: ./sentry-cocoa/scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM"

- name: Create simulator device for iOS 18.4
run: ./sentry-cocoa/scripts/ci-create-simulator.sh --platform "iOS" --os-version "18.4" --device-name "iPhone 15 Pro"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ jobs:
--remove-duplicate true \
--change-path false \
--remove-binary-targets true
- name: Ensure required runtime is loaded
# Ideally we will not need this, but CI sometimes is failing to load some runtimes, this will ensure they are loaded
timeout-minutes: 5 # 5 minutes timeout
env:
OS_VERSION: "18.4"
PLATFORM: "iOS"
run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM"
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
- run: set -o pipefail && NSUnbufferedIO=YES SKIP_BINARIES=1 xcodebuild test -scheme Sentry-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=18.4,name=iPhone 16 Pro' | tee raw-test-output-distribution.log | xcbeautify --preserve-unbeautified
shell: sh
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ui-tests-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ jobs:
run: ./scripts/ci-install-platforms.sh --platforms "$PLATFORM" --os-version "$OS_VERSION"

- name: Ensure required runtime is loaded
if: ${{ inputs.platform == 'iOS' || inputs.platform == 'tvOS' }}
# Ideally we will not need this, but CI sometimes is failing to load some runtimes, this will ensure they are loaded
if: ${{ inputs.platform == 'iOS' }}
timeout-minutes: 5 # 5 minutes timeout
env:
OS_VERSION: ${{ inputs.test-destination-os }}
run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION"
PLATFORM: ${{ inputs.platform }}
run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM"

- name: Create simulator device
if: ${{ inputs.create_device }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ui-tests-critical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ jobs:
timeout-minutes: 5 # 5 minutes timeout
env:
OS_VERSION: "18.4"
run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION"
PLATFORM: "iOS"
run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM"

- name: Boot simulator
run: ./scripts/ci-boot-simulator.sh
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/unit-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ jobs:
run: ./scripts/ci-install-platforms.sh --platforms "$PLATFORMS" --os-version "$OS_VERSION"

- name: Ensure required runtime is loaded
if: ${{ inputs.platform == 'iOS' || inputs.platform == 'tvOS' || inputs.platform == 'visionOS' }}
# Ideally we will not need this, but CI sometimes is failing to load some runtimes, this will ensure they are loaded
if: ${{ inputs.platform == 'iOS' }}
timeout-minutes: 5 # 5 minutes timeout
env:
OS_VERSION: ${{ inputs.test-destination-os }}
run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION"
PLATFORM: ${{ inputs.platform }}
run: ./scripts/ci-ensure-runtime-loaded.sh --os-version "$OS_VERSION" --platform "$PLATFORM"

# Create simulator devices for non-preinstalled simulators
# Required for iOS 16.4, iOS 17.5 (on Xcode 15.4), and iOS/tvOS 26.1
Expand Down
25 changes: 18 additions & 7 deletions scripts/ci-ensure-runtime-loaded.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ set -euo pipefail

# Parse named arguments
OS_VERSION=""
PLATFORM=""

usage() {
echo "Usage: $0 --os-version <os_version>"
echo "Usage: $0 --os-version <os_version> --platform <platform>"
echo " OS version: Version to ensure is loaded (e.g., 26.1 for beta, 16.4 for older iOS)"
echo " Example: $0 --os-version 26.1"
echo " Platform: Platform to ensure is loaded (e.g., iOS, tvOS, visionOS)"
echo " Example: $0 --os-version 26.1 --platform iOS"
echo " Example: $0 --os-version 16.4"
exit 1
}
Expand All @@ -24,6 +26,10 @@ while [[ $# -gt 0 ]]; do
OS_VERSION="$2"
shift 2
;;
--platform)
PLATFORM="$2"
shift 2
;;
*)
echo "Unknown argument: $1"
usage
Expand All @@ -36,15 +42,20 @@ if [ -z "$OS_VERSION" ]; then
usage
fi

echo "Ensuring runtime $OS_VERSION is loaded"
if [ -z "$PLATFORM" ]; then
echo "Error: --platform argument is required"
usage
fi

echo "Ensuring runtime $PLATFORM ($OS_VERSION) is loaded"

# Check if the runtime is loaded
if xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION.*unavailable" ; then
if xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION.*unavailable" ; then
echo "Runtime $OS_VERSION is loaded"
exit 0
fi

echo "Runtime $OS_VERSION is not loaded, will try to load it"
echo "Runtime $PLATFORM ($OS_VERSION) is not loaded, will try to load it"

# Unmount simulator volumes once before checking
for dir in /Library/Developer/CoreSimulator/Volumes/*; do
Expand All @@ -58,7 +69,7 @@ sudo pkill -9 com.apple.CoreSimulator.CoreSimulatorService || true
count=0
MAX_ATTEMPTS=60 # 300 seconds (5 minutes) timeout
while [ $count -lt $MAX_ATTEMPTS ]; do
if xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "iOS $OS_VERSION.*unavailable"; then
if xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION" && ! xcrun simctl list runtimes -v | grep -qE "$PLATFORM $OS_VERSION.*unavailable"; then
echo "Runtime $OS_VERSION is loaded after $count attempts"
exit 0
fi
Expand All @@ -67,5 +78,5 @@ while [ $count -lt $MAX_ATTEMPTS ]; do
sleep 5
done

echo "Runtime $OS_VERSION is not loaded after $count attempts"
echo "Runtime $PLATFORM ($OS_VERSION) is not loaded after $count attempts"
exit 1
Loading