Skip to content

Commit 3e376d8

Browse files
authored
RCORE-1985 Run core tests on ios Simulator in evergreen (#7758)
1 parent 0f69c38 commit 3e376d8

File tree

4 files changed

+75
-2
lines changed

4 files changed

+75
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
### Internals
2020
* Removed references to `stitch_` fields in access tokens in sync unit tests ([PR #7769](https://github.com/realm/realm-core/pull/7769)).
21+
* Added back iOS simulator testing to evergreen after Jenkins went away ([PR #7758](https://github.com/realm/realm-core/pull/7758)).
2122

2223
----------------------------------------------
2324

evergreen/config.yml

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,42 @@ tasks:
11311131
script: |-
11321132
${cmake_build_type|Debug}/realm-libfuzz -rss_limit_mb=0 -max_total_time=3600
11331133
1134+
- name: combined-tests-ios-simulator
1135+
tags: [ "for_pull_requests" ]
1136+
exec_timeout_secs: 1800
1137+
commands:
1138+
- command: shell.exec
1139+
params:
1140+
working_dir: realm-core
1141+
shell: bash
1142+
script: |-
1143+
set -o errexit
1144+
set -o verbose
1145+
1146+
if [ -n "${xcode_developer_dir}" ]; then
1147+
export DEVELOPER_DIR="${xcode_developer_dir}"
1148+
export SIMCTL_CHILD_DEVELOPER_DIR="${xcode_developer_dir}"
1149+
fi
1150+
1151+
if [[ -n "${verbose_test_output}" ]]; then
1152+
TEST_FLAGS="$TEST_FLAGS -VV"
1153+
export SIMCTL_CHILD_UNITTEST_THREADS=1
1154+
export SIMCTL_CHILD_UNITTEST_LOG_LEVEL="${test_logging_level|debug}"
1155+
fi
1156+
1157+
TEST_RESULTS_FILE="$(./evergreen/abspath.sh ${task_name}_results.json)"
1158+
export SIMCTL_CHILD_UNITTEST_EVERGREEN_TEST_RESULTS="$TEST_RESULTS_FILE"
1159+
if [[ -f "$TEST_RESULTS_FILE" ]]; then
1160+
rm "$TEST_RESULTS_FILE"
1161+
fi
1162+
export SIMCTL_CHILD_UNITTEST_PROGRESS=1
1163+
export SIMCTL_CHILD_UNITTEST_ENCRYPT_ALL="${run_with_encryption|0}"
1164+
1165+
./tools/run-in-simulator.sh \
1166+
./build/test/${cmake_build_type|Debug}-iphonesimulator/realm-combined-tests.app \
1167+
'io.realm.CombinedTests' \
1168+
$TEST_RESULTS_FILE
1169+
11341170
- name: generate-sync-corpus
11351171
tags: [ "for_nightly_tests" ]
11361172
exec_timeout_secs: 1800
@@ -1317,6 +1353,20 @@ task_groups:
13171353
tasks:
13181354
- fuzzer
13191355

1356+
- name: ios-simulator-tests
1357+
max_hosts: 1
1358+
setup_group_can_fail_task: true
1359+
setup_group:
1360+
- func: "fetch source"
1361+
- func: "fetch binaries"
1362+
teardown_task:
1363+
- func: "upload test results"
1364+
timeout:
1365+
- func: "run hang analyzer"
1366+
tasks:
1367+
- compile
1368+
- combined-tests-ios-simulator
1369+
13201370
- name: compile_only
13211371
max_hosts: 1
13221372
setup_group_can_fail_task: true
@@ -1325,7 +1375,6 @@ task_groups:
13251375
- func: "fetch binaries"
13261376
teardown_task:
13271377
- func: "upload test results"
1328-
- func: "upload baas artifacts"
13291378
timeout:
13301379
- func: "run hang analyzer"
13311380
tasks:
@@ -1619,6 +1668,24 @@ buildvariants:
16191668
tasks:
16201669
- name: compile_test_and_package
16211670

1671+
- name: ios-simulator
1672+
display_name: "iOS Simulator (combined tests w/Xcode 15)"
1673+
run_on: macos-14-arm64
1674+
expansions:
1675+
cmake_bindir: "/opt/homebrew/bin"
1676+
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
1677+
extra_flags: "-DCMAKE_XCODE_ATTRIBUTE_SDKROOT=iphoneos"
1678+
cmake_build_tool_options: "-sdk iphonesimulator -arch arm64"
1679+
cmake_generator: Xcode
1680+
max_jobs: $(sysctl -n hw.logicalcpu)
1681+
xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
1682+
build_command_line_tools: Off
1683+
disable_tests_against_baas: On
1684+
disable_sync: On
1685+
target_to_build: CombinedTests
1686+
tasks:
1687+
- name: ios-simulator-tests
1688+
16221689
- name: macos-encrypted
16231690
display_name: "MacOS 14.0 arm64 (Encryption enabled)"
16241691
run_on: macos-14-arm64

src/external/bson/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ CHECK_STRUCT_HAS_MEMBER ("struct timespec" tv_sec time.h BSON_HAVE_TIMESPEC)
3535
check_symbol_exists (gmtime_r time.h BSON_HAVE_GMTIME_R)
3636
check_function_exists (rand_r BSON_HAVE_RAND_R)
3737
check_include_file (strings.h BSON_HAVE_STRINGS_H)
38-
check_symbol_exists (strlcpy string.h BSON_HAVE_STRLCPY)
38+
if (NOT APPLE)
39+
check_symbol_exists (strlcpy string.h BSON_HAVE_STRLCPY)
40+
else()
41+
set(BSON_HAVE_STRLCPY Off)
42+
endif()
3943
check_include_file (stdbool.h BSON_HAVE_STDBOOL_H)
4044
check_symbol_exists (clock_gettime time.h BSON_HAVE_CLOCK_GETTIME)
4145
check_symbol_exists (strnlen string.h BSON_HAVE_STRNLEN)

tools/run-in-simulator.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ appPath="$1"
66
bundleId="$2"
77
outputFile="$3"
88

9+
xcrun simctl list runtimes
910
id="$(echo $RANDOM | shasum | cut -f 1 -d ' ')"
1011
# Sample output: "iOS 15.5 (15.5 - 19F70) - com.apple.CoreSimulator.SimRuntime.iOS-15-5"
1112
# We're extracting the part starting with com.apple, looking for a runtime that's iOS 13 or newer

0 commit comments

Comments
 (0)