Skip to content

Commit

Permalink
RCORE-1985 Run core tests on ios Simulator in evergreen (#7758)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreams authored Jun 4, 2024
1 parent 0f69c38 commit 3e376d8
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

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

----------------------------------------------

Expand Down
69 changes: 68 additions & 1 deletion evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,42 @@ tasks:
script: |-
${cmake_build_type|Debug}/realm-libfuzz -rss_limit_mb=0 -max_total_time=3600
- name: combined-tests-ios-simulator
tags: [ "for_pull_requests" ]
exec_timeout_secs: 1800
commands:
- command: shell.exec
params:
working_dir: realm-core
shell: bash
script: |-
set -o errexit
set -o verbose
if [ -n "${xcode_developer_dir}" ]; then
export DEVELOPER_DIR="${xcode_developer_dir}"
export SIMCTL_CHILD_DEVELOPER_DIR="${xcode_developer_dir}"
fi
if [[ -n "${verbose_test_output}" ]]; then
TEST_FLAGS="$TEST_FLAGS -VV"
export SIMCTL_CHILD_UNITTEST_THREADS=1
export SIMCTL_CHILD_UNITTEST_LOG_LEVEL="${test_logging_level|debug}"
fi
TEST_RESULTS_FILE="$(./evergreen/abspath.sh ${task_name}_results.json)"
export SIMCTL_CHILD_UNITTEST_EVERGREEN_TEST_RESULTS="$TEST_RESULTS_FILE"
if [[ -f "$TEST_RESULTS_FILE" ]]; then
rm "$TEST_RESULTS_FILE"
fi
export SIMCTL_CHILD_UNITTEST_PROGRESS=1
export SIMCTL_CHILD_UNITTEST_ENCRYPT_ALL="${run_with_encryption|0}"
./tools/run-in-simulator.sh \
./build/test/${cmake_build_type|Debug}-iphonesimulator/realm-combined-tests.app \
'io.realm.CombinedTests' \
$TEST_RESULTS_FILE
- name: generate-sync-corpus
tags: [ "for_nightly_tests" ]
exec_timeout_secs: 1800
Expand Down Expand Up @@ -1317,6 +1353,20 @@ task_groups:
tasks:
- fuzzer

- name: ios-simulator-tests
max_hosts: 1
setup_group_can_fail_task: true
setup_group:
- func: "fetch source"
- func: "fetch binaries"
teardown_task:
- func: "upload test results"
timeout:
- func: "run hang analyzer"
tasks:
- compile
- combined-tests-ios-simulator

- name: compile_only
max_hosts: 1
setup_group_can_fail_task: true
Expand All @@ -1325,7 +1375,6 @@ task_groups:
- func: "fetch binaries"
teardown_task:
- func: "upload test results"
- func: "upload baas artifacts"
timeout:
- func: "run hang analyzer"
tasks:
Expand Down Expand Up @@ -1619,6 +1668,24 @@ buildvariants:
tasks:
- name: compile_test_and_package

- name: ios-simulator
display_name: "iOS Simulator (combined tests w/Xcode 15)"
run_on: macos-14-arm64
expansions:
cmake_bindir: "/opt/homebrew/bin"
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
extra_flags: "-DCMAKE_XCODE_ATTRIBUTE_SDKROOT=iphoneos"
cmake_build_tool_options: "-sdk iphonesimulator -arch arm64"
cmake_generator: Xcode
max_jobs: $(sysctl -n hw.logicalcpu)
xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
build_command_line_tools: Off
disable_tests_against_baas: On
disable_sync: On
target_to_build: CombinedTests
tasks:
- name: ios-simulator-tests

- name: macos-encrypted
display_name: "MacOS 14.0 arm64 (Encryption enabled)"
run_on: macos-14-arm64
Expand Down
6 changes: 5 additions & 1 deletion src/external/bson/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ CHECK_STRUCT_HAS_MEMBER ("struct timespec" tv_sec time.h BSON_HAVE_TIMESPEC)
check_symbol_exists (gmtime_r time.h BSON_HAVE_GMTIME_R)
check_function_exists (rand_r BSON_HAVE_RAND_R)
check_include_file (strings.h BSON_HAVE_STRINGS_H)
check_symbol_exists (strlcpy string.h BSON_HAVE_STRLCPY)
if (NOT APPLE)
check_symbol_exists (strlcpy string.h BSON_HAVE_STRLCPY)
else()
set(BSON_HAVE_STRLCPY Off)
endif()
check_include_file (stdbool.h BSON_HAVE_STDBOOL_H)
check_symbol_exists (clock_gettime time.h BSON_HAVE_CLOCK_GETTIME)
check_symbol_exists (strnlen string.h BSON_HAVE_STRNLEN)
Expand Down
1 change: 1 addition & 0 deletions tools/run-in-simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ appPath="$1"
bundleId="$2"
outputFile="$3"

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

0 comments on commit 3e376d8

Please sign in to comment.