diff --git a/CHANGELOG.md b/CHANGELOG.md index 83530112304..08005fb69f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)). ---------------------------------------------- diff --git a/evergreen/config.yml b/evergreen/config.yml index f2678b8a811..672a1df5f04 100644 --- a/evergreen/config.yml +++ b/evergreen/config.yml @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/src/external/bson/CMakeLists.txt b/src/external/bson/CMakeLists.txt index 8ec2495e001..d0ec97b2aa2 100644 --- a/src/external/bson/CMakeLists.txt +++ b/src/external/bson/CMakeLists.txt @@ -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) diff --git a/tools/run-in-simulator.sh b/tools/run-in-simulator.sh index 72ba90bebdb..da3f65f2181 100755 --- a/tools/run-in-simulator.sh +++ b/tools/run-in-simulator.sh @@ -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