Cotton code
24 lines · 1.5 KB · ShellRaw
#!/usr/bin/env bash# Cotton Data Dev walked on a simulator by its UI tests (apps/cotton/UITests/Data), against the dev server only.##   DATA_TEST=<Class[/method]> bash scripts/data-walk.sh <simulator udid> [derived data]## A walk that signs in reads the invented account from the environment: WALK_COTTON_PHONE, and the files named by# WALK_COTTON_CODE_FILE (its sign-in code) and WALK_COTTON_RECOVERY_FILE (its recovery code). The codes go to the# test runner's environment only, never to the log or a picture.set -euo pipefailROOT="$(cd "$(dirname "$0")/.." && pwd)"UDID=${1:?simulator udid}DERIVED=${2:-$ROOT/.derived-data-walk}export COTTON_FLAVOR=devif [ -n "${WALK_COTTON_PHONE:-}" ]; then export TEST_RUNNER_WALK_COTTON_PHONE="$WALK_COTTON_PHONE"; fiif [ -n "${WALK_COTTON_CODE_FILE:-}" ]; then TEST_RUNNER_WALK_COTTON_CODE="$(tr -d '[:space:]' < "$WALK_COTTON_CODE_FILE")"; export TEST_RUNNER_WALK_COTTON_CODE; fiif [ -n "${WALK_COTTON_RECOVERY_FILE:-}" ]; then TEST_RUNNER_WALK_COTTON_RECOVERY="$(tr -d '\n' < "$WALK_COTTON_RECOVERY_FILE")"; export TEST_RUNNER_WALK_COTTON_RECOVERY; fibash "$ROOT/scripts/gen-ios-ui-tests.sh"xcrun simctl bootstatus "$UDID" -b >/dev/nullcd "$ROOT/apps/cotton"xcodebuild test -project UITests.xcodeproj -scheme data-ui \  -destination "platform=iOS Simulator,id=$UDID" -derivedDataPath "$DERIVED" \  -only-testing:"DataUITests/${DATA_TEST:-DataOpenTests}" COTTON_FLAVOR=dev ARCHS=arm64 ONLY_ACTIVE_ARCH=YES \  -resultBundlePath "$DERIVED/data-walk-$(date +%s).xcresult"