diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7dfafa7c6..3f4941b47 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -90,16 +90,23 @@ jobs: fail-fast: false matrix: include: + # wrapper-lifetime-pass: ":" to run the suite a second + # time, on the same build, under that wrapper lifetime mode. - name: Test xcodebuild-args: "" artifact-suffix: "" cache-variant: default + wrapper-lifetime-pass: "canary:all" # Only code compiled here is instrumented: the runtime and the test # fixtures, not the prebuilt V8 archives. - name: Test (ASan) xcodebuild-args: "-enableAddressSanitizer YES" artifact-suffix: "-asan" cache-variant: asan + wrapper-lifetime-pass: "" + env: + # Must match the simulator named in "Wait for the test simulator". + TEST_DESTINATION: "platform=iOS Simulator,OS=latest,name=iPhone 16 Pro" steps: - uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0 with: @@ -133,25 +140,30 @@ jobs: run: | mkdir -p dist-test echo TEST_FOLDER=$(pwd)/dist-test >> $GITHUB_ENV - # Must match the simulator named in the Xcode Tests -destination. + # Must match the simulator named in TEST_DESTINATION. + # --boot leaves the simulator booting in the background, so the boot + # overlaps build-for-testing instead of delaying the first test run. - name: Wait for the test simulator - run: ./scripts/wait-for-simulator.sh --name "iPhone 16 Pro" + run: ./scripts/wait-for-simulator.sh --name "iPhone 16 Pro" --boot + - name: Build for testing + id: build-for-testing + run: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -destination "$TEST_DESTINATION" ${{ matrix.xcodebuild-args }} build-for-testing | xcpretty - name: Xcode Tests uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 # try to run the tests with xcpretty. If it fails then try again without xcpretty twice for better log output # the xcode tests are a bit flaky and they should never fail on this step, as this step only collects the JS test results as junit xml with: - # Build (~10m) + the runtime suite's report-wait (up to 10m, see - # TestRunnerTests.swift) need more than 20m headroom per attempt. - timeout_minutes: 40 + # The runtime suite's report-wait alone can take 10m (see + # TestRunnerTests.swift), plus app install and launch. + timeout_minutes: 25 max_attempts: 2 - command: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination platform\=iOS\ Simulator,OS\=latest,name\=iPhone\ 16\ Pro ${{ matrix.xcodebuild-args }} test | xcpretty + command: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination "$TEST_DESTINATION" ${{ matrix.xcodebuild-args }} test-without-building | xcpretty # Keep the failed attempt's bundle — it holds the diagnostics of the # failure being retried. Everything else at the result path must go # (including extensionless staging leftovers), or the retry dies with # "Existing file at -resultBundlePath". on_retry_command: rm -rf $TEST_FOLDER/test_results_attempt1.xcresult; mv $TEST_FOLDER/test_results.xcresult $TEST_FOLDER/test_results_attempt1.xcresult 2>/dev/null; for f in $TEST_FOLDER/test_results*; do [ "$f" = "$TEST_FOLDER/test_results_attempt1.xcresult" ] || rm -rf "$f"; done; xcrun simctl shutdown all - new_command_on_retry: xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination platform\=iOS\ Simulator,OS\=latest,name\=iPhone\ 16\ Pro ${{ matrix.xcodebuild-args }} test + new_command_on_retry: xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination "$TEST_DESTINATION" ${{ matrix.xcodebuild-args }} test-without-building - name: Xcode compilation cache size if: ${{ !cancelled() }} run: du -sh "$NS_COMPILATION_CACHE_DIR" || true @@ -179,6 +191,56 @@ jobs: ls "$TEST_FOLDER"/test-out/*junit*.xml > /dev/null 2>&1 || { echo "::error::No JUnit report in $TEST_FOLDER/test-out"; exit 1; } find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx junit-cli-report-viewer find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml + # Second pass: the same build with "wrapperLifetime" set in the built + # app's package.json. It runs whatever the first pass's outcome, so a + # default-mode failure still yields this pass's results and diagnostics. + # test-without-building runs no build phases, so the rewrite stands. + - name: Configure the built app for the wrapper lifetime pass + id: wrapper-lifetime-app + if: ${{ !cancelled() && matrix.wrapper-lifetime-pass != '' && steps.build-for-testing.outcome == 'success' }} + env: + WRAPPER_LIFETIME: ${{ matrix.wrapper-lifetime-pass }} + run: | + APP="$(find build -maxdepth 2 -type d -path 'build/*-iphonesimulator/TestRunner.app')" + [ -n "$APP" ] && [ "$(printf '%s\n' "$APP" | wc -l)" -eq 1 ] || { echo "::error::Expected one built TestRunner.app under build/, found: ${APP:-none}"; exit 1; } + node tools/apply-test-app-config.mjs --source TestRunner/app/package.json --out "$APP/app/package.json" --wrapper-lifetime "$WRAPPER_LIFETIME" + # Rewriting a resource breaks the bundle's seal; re-seal it ad hoc, + # keeping the build's entitlements. + codesign --force --sign - --timestamp=none --preserve-metadata=entitlements "$APP" + echo "WL_TEST_FOLDER=$TEST_FOLDER/wrapper-lifetime" >> "$GITHUB_ENV" + mkdir -p "$TEST_FOLDER/wrapper-lifetime" + - name: Xcode Tests (wrapper lifetime ${{ matrix.wrapper-lifetime-pass }}) + if: ${{ !cancelled() && steps.wrapper-lifetime-app.outcome == 'success' }} + uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 + with: + timeout_minutes: 25 + max_attempts: 2 + command: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $WL_TEST_FOLDER/test_results -destination "$TEST_DESTINATION" ${{ matrix.xcodebuild-args }} test-without-building | xcpretty + on_retry_command: rm -rf $WL_TEST_FOLDER/test_results_attempt1.xcresult; mv $WL_TEST_FOLDER/test_results.xcresult $WL_TEST_FOLDER/test_results_attempt1.xcresult 2>/dev/null; for f in $WL_TEST_FOLDER/test_results*; do [ "$f" = "$WL_TEST_FOLDER/test_results_attempt1.xcresult" ] || rm -rf "$f"; done; xcrun simctl shutdown all + new_command_on_retry: xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $WL_TEST_FOLDER/test_results -destination "$TEST_DESTINATION" ${{ matrix.xcodebuild-args }} test-without-building + - name: Extract test results (wrapper lifetime) + if: ${{ !cancelled() && steps.wrapper-lifetime-app.outcome == 'success' }} + run: | + if [ -d "$WL_TEST_FOLDER/test_results.xcresult" ]; then + ./scripts/export-test-attachments.sh --result "$WL_TEST_FOLDER/test_results.xcresult" --output "$WL_TEST_FOLDER/test-out" + fi + - name: Test report summary (wrapper lifetime) + if: ${{ !cancelled() && steps.wrapper-lifetime-app.outcome == 'success' }} + uses: mikepenz/action-junit-report@6ef3fdcfcd5f0b5d14df3e659ef19b8c6820f93d # v6.6.1 + with: + check_name: JUnit Test Report (wrapper lifetime ${{ matrix.wrapper-lifetime-pass }}) + report_paths: dist-test/wrapper-lifetime/test-out/*junit*.xml + annotate_only: true + detailed_summary: true + - name: Validate Test Results (wrapper lifetime) + if: ${{ !cancelled() && steps.wrapper-lifetime-app.outcome == 'success' }} + env: + WRAPPER_LIFETIME: ${{ matrix.wrapper-lifetime-pass }} + run: | + ls "$WL_TEST_FOLDER"/test-out/*junit*.xml > /dev/null 2>&1 || { echo "::error::No JUnit report in $WL_TEST_FOLDER/test-out"; exit 1; } + find $WL_TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx junit-cli-report-viewer + find $WL_TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml + ./scripts/check-wrapper-lifetime-report.sh --reports "$WL_TEST_FOLDER/test-out" --expect "$(printf '%s' "$WRAPPER_LIFETIME" | tr ':' '/')" - name: Collect test diagnostics if: failure() uses: ./.github/actions/collect-test-diagnostics @@ -193,6 +255,8 @@ jobs: path: | ${{env.TEST_FOLDER}}/test_results.xcresult ${{env.TEST_FOLDER}}/test_results_attempt1.xcresult + ${{env.TEST_FOLDER}}/wrapper-lifetime/test_results.xcresult + ${{env.TEST_FOLDER}}/wrapper-lifetime/test_results_attempt1.xcresult test-catalyst: name: Test (Mac Catalyst) runs-on: macos-15 diff --git a/README.md b/README.md index 58990240d..a3d481d70 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,14 @@ Runtime initialization took 55ms If all tests pass, everything is good! At this point you can make changes to the runtime, add breakpoints and step through with the debugger. In the next section we'll see how to attach the runtime to an existing NativeScript application allowing us to debug runtime issues in actual apps. +## Running the suite from the command line + +`./run_tests.sh` builds TestRunner, runs the suite on a simulator and leaves the results in `build/tests/`. `./run_tests.sh --help` lists every option; the common ones: + +- `--temp-sim` runs on a throwaway simulator that is deleted afterwards; `--keep-sim` creates (once) and reuses a simulator named after the checkout. +- `-a` / `--asan` runs under AddressSanitizer. +- `--wrapper-lifetime [:]` runs the suite under a wrapper lifetime mode (`resurrecting`, `rooted` or `canary`; scope `extended` or `all`, default `extended`), e.g. `./run_tests.sh --temp-sim --wrapper-lifetime canary:all`. It sets `"wrapperLifetime"` in the built app's `package.json` only; `TestRunner/app/package.json` is left untouched. From `xcodebuild`, pass the build setting `NS_TEST_WRAPPER_LIFETIME=:` instead. + ## Node.js in Xcode builds Building the `NativeScript` target generates the runtime JS builtins with `tools/js2c.mjs`, and building the `TestRunner` target copies jasmine-core from `node_modules` into the test app with `tools/stage-test-runner-deps.mjs`; both need Node.js. Xcode runs build phases with a minimal `PATH` and never reads your shell profile, so a node managed by nvm/fnm/volta/asdf is invisible to it. The build phase instead sources two files from the repo root: diff --git a/run_tests.sh b/run_tests.sh index 51bf0642f..48fb67052 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -295,6 +295,13 @@ Simulator options: Run options: -a, --asan Run under AddressSanitizer (-enableAddressSanitizer YES) + --wrapper-lifetime [:] + Run the suite under a wrapper lifetime mode: the built app's + package.json gets "wrapperLifetime": { mode, scope } (the + source TestRunner/app/package.json is not modified), and the + run fails unless the suite reports that mode. + mode: resurrecting | rooted | canary + scope: extended | all (default: extended) -t, --temp-folder Write results to a random temp folder instead of build/tests/ -h, --help Show this help @@ -320,6 +327,7 @@ SIM_RUNTIME="" DELETE_TARGET="" TEST_FOLDER="" CATALYST=0 +WRAPPER_LIFETIME="" set_sim_mode() { if [ -n "$SIM_MODE" ] && [ "$SIM_MODE" != "$1" ]; then @@ -367,6 +375,8 @@ while [ $# -gt 0 ]; do --list-sims) set_sim_mode "list-sims"; shift ;; --delete-sims) set_sim_mode "delete-sims"; shift ;; --catalyst) CATALYST=1; shift ;; + --wrapper-lifetime|--wrapper-lifetime=*) + take_value "--wrapper-lifetime" "$1" "${2:-}" "$has_next"; WRAPPER_LIFETIME="$OPT_VALUE"; shift "$OPT_SHIFT" ;; -a|--asan) ASAN=1; shift ;; -t|--temp-folder) TEMP_FOLDER=1; shift ;; -h|--help) usage; exit 0 ;; @@ -407,10 +417,23 @@ if { [ -n "$SIM_DEVICE_TYPE" ] || [ -n "$SIM_RUNTIME" ]; } && [ "$CREATES_SIM" - die_usage "--device-type and --runtime only apply when a simulator may be created." fi if [ -n "$SIM_MODE" ] && [ "$SIM_MODE" != "temp-sim" ] && [ "$SIM_MODE" != "keep-sim" ]; then - if [ "$ASAN" -eq 1 ] || [ "$TEMP_FOLDER" -eq 1 ]; then - die_usage "--asan and --temp-folder do not apply to --$SIM_MODE." + if [ "$ASAN" -eq 1 ] || [ "$TEMP_FOLDER" -eq 1 ] || [ -n "$WRAPPER_LIFETIME" ]; then + die_usage "--asan, --temp-folder and --wrapper-lifetime do not apply to --$SIM_MODE." fi fi +if [ -n "$WRAPPER_LIFETIME" ]; then + WL_MODE="${WRAPPER_LIFETIME%%:*}" + WL_SCOPE="extended" + [[ "$WRAPPER_LIFETIME" == *:* ]] && WL_SCOPE="${WRAPPER_LIFETIME#*:}" + case "$WL_MODE" in + resurrecting|rooted|canary) ;; + *) die_usage "--wrapper-lifetime: unknown mode '$WL_MODE' (resurrecting, rooted or canary)." ;; + esac + case "$WL_SCOPE" in + extended|all) ;; + *) die_usage "--wrapper-lifetime: unknown scope '$WL_SCOPE' (extended or all)." ;; + esac +fi sim_label() { local name @@ -562,6 +585,11 @@ if [ "$ASAN" -eq 1 ]; then echo "AddressSanitizer: enabled" XCODEBUILD_ARGS+=(-enableAddressSanitizer YES) fi +if [ -n "$WRAPPER_LIFETIME" ]; then + echo "Wrapper lifetime: $WL_MODE/$WL_SCOPE" + # Read by the TestRunner target's "Apply Test App Config" build phase. + XCODEBUILD_ARGS+=("NS_TEST_WRAPPER_LIFETIME=$WL_MODE:$WL_SCOPE") +fi set -o pipefail xcodebuild -project "$SCRIPT_DIR/v8ios.xcodeproj" -scheme TestRunner \ @@ -582,4 +610,15 @@ if command -v xcparse &>/dev/null; then find "$TEST_FOLDER/test-out" -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml fi +if [ -n "$WRAPPER_LIFETIME" ]; then + if ! ls "$TEST_FOLDER"/test-out/*junit*.xml >/dev/null 2>&1 && [ -d "$TEST_FOLDER/test_results.xcresult" ]; then + "$SCRIPT_DIR/scripts/export-test-attachments.sh" --result "$TEST_FOLDER/test_results.xcresult" \ + --output "$TEST_FOLDER/test-out" >/dev/null + fi + if ! "$SCRIPT_DIR/scripts/check-wrapper-lifetime-report.sh" --reports "$TEST_FOLDER/test-out" \ + --expect "$WL_MODE/$WL_SCOPE"; then + [ $TEST_EXIT -ne 0 ] || TEST_EXIT=1 + fi +fi + exit $TEST_EXIT diff --git a/scripts/check-wrapper-lifetime-report.sh b/scripts/check-wrapper-lifetime-report.sh new file mode 100755 index 000000000..d8d4888f1 --- /dev/null +++ b/scripts/check-wrapper-lifetime-report.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Fails unless the JS suite's junit reports show it ran under the expected +# wrapper lifetime mode and scope. The mode reaches the app through a build +# phase, so a passing suite alone does not prove which mode it exercised; the +# "Wrapper lifetime modes" suite names a spec after the mode the runtime read. +set -euo pipefail + +usage() { + echo "Usage: ./scripts/check-wrapper-lifetime-report.sh --reports --expect /" + echo "" + echo " --reports directory holding the suite's *junit*.xml reports" + echo " --expect / mode and scope the suite must report, e.g. canary/all" + echo " -h, --help show this help" +} + +REPORTS="" +EXPECT="" +while [ $# -gt 0 ]; do + case "$1" in + --reports) + [ $# -ge 2 ] || { echo "--reports needs a value" >&2; usage >&2; exit 1; } + REPORTS="$2" + shift 2 + ;; + --reports=*) REPORTS="${1#*=}"; shift ;; + --expect) + [ $# -ge 2 ] || { echo "--expect needs a value" >&2; usage >&2; exit 1; } + EXPECT="$2" + shift 2 + ;; + --expect=*) EXPECT="${1#*=}"; shift ;; + -h|--help) + usage + exit 0 + ;; + *) + echo "Unknown argument: $1" >&2 + usage >&2 + exit 1 + ;; + esac +done + +if [ -z "$REPORTS" ] || [ -z "$EXPECT" ]; then + echo "--reports and --expect are required" >&2 + usage >&2 + exit 1 +fi + +REPORT_FILES=() +while IFS= read -r -d '' f; do + REPORT_FILES+=("$f") +done < <(find "$REPORTS" -maxdepth 1 -name "*junit*.xml" -print0 2>/dev/null) + +if [ "${#REPORT_FILES[@]}" -eq 0 ]; then + echo "error: no *junit*.xml report in $REPORTS" >&2 + exit 1 +fi + +# Must match the spec title in TestRunner/app/tests/WrapperLifetimeModesTests.js. +NEEDLE="reports the configured mode and scope ($EXPECT)" +if grep -qF "$NEEDLE" "${REPORT_FILES[@]}"; then + echo "Wrapper lifetime: suite ran under $EXPECT" + exit 0 +fi + +echo "error: the suite did not report wrapper lifetime $EXPECT" >&2 +FOUND=$(grep -ohE 'reports the configured mode and scope \([a-z]+/[a-z]+\)' "${REPORT_FILES[@]}" | sort -u || true) +echo " reported: ${FOUND:-no wrapper lifetime mode spec in the reports}" >&2 +exit 1 diff --git a/scripts/wait-for-simulator.sh b/scripts/wait-for-simulator.sh index a575913fa..5cec7a983 100755 --- a/scripts/wait-for-simulator.sh +++ b/scripts/wait-for-simulator.sh @@ -7,15 +7,17 @@ set -euo pipefail usage() { - echo "Usage: ./scripts/wait-for-simulator.sh --name [--timeout ]" + echo "Usage: ./scripts/wait-for-simulator.sh --name [--timeout ] [--boot]" echo "" echo " --name simulator device name, e.g. \"iPhone 16 Pro\"" echo " --timeout give up after this long (default: 300)" + echo " --boot once found, start booting it in the background and return" echo " -h, --help show this help" } NAME="" TIMEOUT=300 +BOOT=0 while [ $# -gt 0 ]; do case "$1" in --name) @@ -36,6 +38,10 @@ while [ $# -gt 0 ]; do TIMEOUT="${1#--timeout=}" shift ;; + --boot) + BOOT=1 + shift + ;; -h|--help) usage exit 0 @@ -79,6 +85,12 @@ while :; do found="$(find_device || true)" if [ -n "$found" ]; then echo "Found simulator \"$NAME\": $found (after ${SECONDS}s)" + if [ "$BOOT" -eq 1 ]; then + # Detached so later steps (the build) run while it boots; xcodebuild + # waits for a booting device on its own. + nohup xcrun simctl bootstatus "${found%% *}" -b > /dev/null 2>&1 & + echo "Booting ${found%% *} in the background" + fi exit 0 fi if [ "$SECONDS" -ge "$deadline" ]; then diff --git a/tools/apply-test-app-config.mjs b/tools/apply-test-app-config.mjs new file mode 100644 index 000000000..8a5e17d5f --- /dev/null +++ b/tools/apply-test-app-config.mjs @@ -0,0 +1,75 @@ +#!/usr/bin/env node +// Writes the TestRunner app's package.json into the built app bundle, with +// per-run overrides applied. Invoked by the TestRunner target's "Apply Test App +// Config" phase, which runs after Copy Bundle Resources. + +import { readFileSync, writeFileSync } from "node:fs"; +import { parseArgs } from "node:util"; + +const MODES = ["resurrecting", "rooted", "canary"]; +const SCOPES = ["extended", "all"]; + +const usage = `Usage: node tools/apply-test-app-config.mjs --source --out [options] + +Writes to , applying the given overrides. + + --source the app's package.json in the source tree + --out the package.json inside the built app bundle + --wrapper-lifetime [:] + set "wrapperLifetime": { mode, scope } + mode: ${MODES.join(" | ")} + scope: ${SCOPES.join(" | ")} (default: extended) + -h, --help show this help`; + +function fail(message) { + console.error(`error: ${message}\n\n${usage}`); + process.exit(1); +} + +let values; +try { + ({ values } = parseArgs({ + options: { + source: { type: "string" }, + out: { type: "string" }, + "wrapper-lifetime": { type: "string" }, + help: { type: "boolean", short: "h" }, + }, + strict: true, + })); +} catch (e) { + fail(e.message); +} +if (values.help) { + console.log(usage); + process.exit(0); +} +if (!values.source || !values.out) { + fail("--source and --out are required"); +} + +const source = readFileSync(values.source, "utf8"); +let output = source; + +const lifetime = values["wrapper-lifetime"]; +if (lifetime !== undefined) { + const [mode, scope = "extended", ...rest] = lifetime.split(":"); + if (rest.length || !MODES.includes(mode) || !SCOPES.includes(scope)) { + fail(`invalid --wrapper-lifetime '${lifetime}'`); + } + const config = JSON.parse(source); + config.wrapperLifetime = { ...config.wrapperLifetime, mode, scope }; + output = `${JSON.stringify(config, null, 4)}\n`; + console.log(`wrapperLifetime: ${mode}/${scope}`); +} + +// The bundle copy is rewritten on every build, override or not: Xcode skips +// re-copying an unchanged app folder, so an override from an earlier build +// would otherwise survive into the next one. +let current = null; +try { + current = readFileSync(values.out, "utf8"); +} catch {} +if (current !== output) { + writeFileSync(values.out, output); +} diff --git a/v8ios.xcodeproj/project.pbxproj b/v8ios.xcodeproj/project.pbxproj index dca5caf46..22c6a2431 100644 --- a/v8ios.xcodeproj/project.pbxproj +++ b/v8ios.xcodeproj/project.pbxproj @@ -1908,6 +1908,7 @@ C2DDEB13229EA89000345BFE /* Frameworks */, 7A51E7C02F00000000000001 /* Stage Test Runner Dependencies */, C2DDEB14229EA89000345BFE /* Resources */, + 7A51E7C02F00000000000002 /* Apply Test App Config */, C2C8EE7722CE54EE001F8CEC /* Embed Frameworks */, ); buildRules = ( @@ -2188,6 +2189,27 @@ shellPath = /bin/sh; shellScript = "set -e\ncd \"${SRCROOT}\"\n[ -f .xcode.env ] && . ./.xcode.env\n[ -f .xcode.env.local ] && . ./.xcode.env.local\nif [ -z \"${NODE_BINARY:-}\" ] || [ ! -x \"${NODE_BINARY:-}\" ]; then\n echo \"error: no usable node for tools/stage-test-runner-deps.mjs (NODE_BINARY='${NODE_BINARY:-}'). Run 'npm run setup-xcode-env' in the runtime repo to record your node in .xcode.env.local\" >&2\n exit 1\nfi\n\"$NODE_BINARY\" tools/stage-test-runner-deps.mjs --out-dir TestRunner/app/Infrastructure/Jasmine/vendor\n"; }; + 7A51E7C02F00000000000002 /* Apply Test App Config */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "$(SRCROOT)/TestRunner/app/package.json", + ); + name = "Apply Test App Config"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/app/package.json", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\ncd \"${SRCROOT}\"\n[ -f .xcode.env ] && . ./.xcode.env\n[ -f .xcode.env.local ] && . ./.xcode.env.local\nif [ -z \"${NODE_BINARY:-}\" ] || [ ! -x \"${NODE_BINARY:-}\" ]; then\n echo \"error: no usable node for tools/apply-test-app-config.mjs (NODE_BINARY='${NODE_BINARY:-}'). Run 'npm run setup-xcode-env' in the runtime repo to record your node in .xcode.env.local\" >&2\n exit 1\nfi\nset -- --source TestRunner/app/package.json --out \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/app/package.json\"\n# NS_TEST_WRAPPER_LIFETIME=[:] on the xcodebuild command line (run_tests.sh --wrapper-lifetime).\nif [ -n \"${NS_TEST_WRAPPER_LIFETIME:-}\" ]; then\n set -- \"$@\" --wrapper-lifetime \"${NS_TEST_WRAPPER_LIFETIME}\"\nfi\n\"$NODE_BINARY\" tools/apply-test-app-config.mjs \"$@\"\n"; + }; C27E5DB322F31FF800498ED0 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647;