1*da0073e9SAndroid Build Coastguard Worker#!/bin/bash 2*da0073e9SAndroid Build Coastguard Worker 3*da0073e9SAndroid Build Coastguard Workerset -ex 4*da0073e9SAndroid Build Coastguard Worker 5*da0073e9SAndroid Build Coastguard Workersource "$(dirname "${BASH_SOURCE[0]}")/../pytorch/common_utils.sh" 6*da0073e9SAndroid Build Coastguard Worker 7*da0073e9SAndroid Build Coastguard WorkerLOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 8*da0073e9SAndroid Build Coastguard WorkerROOT_DIR=$(cd "$LOCAL_DIR"/../.. && pwd) 9*da0073e9SAndroid Build Coastguard WorkerTEST_DIR="$ROOT_DIR/test" 10*da0073e9SAndroid Build Coastguard Workerpytest_reports_dir="${TEST_DIR}/test-reports/python" 11*da0073e9SAndroid Build Coastguard Worker 12*da0073e9SAndroid Build Coastguard Worker# Figure out which Python to use 13*da0073e9SAndroid Build Coastguard WorkerPYTHON="$(which python)" 14*da0073e9SAndroid Build Coastguard Workerif [[ "${BUILD_ENVIRONMENT}" =~ py((2|3)\.?[0-9]?\.?[0-9]?) ]]; then 15*da0073e9SAndroid Build Coastguard Worker PYTHON=$(which "python${BASH_REMATCH[1]}") 16*da0073e9SAndroid Build Coastguard Workerfi 17*da0073e9SAndroid Build Coastguard Worker 18*da0073e9SAndroid Build Coastguard Workerif [[ "${BUILD_ENVIRONMENT}" == *rocm* ]]; then 19*da0073e9SAndroid Build Coastguard Worker # HIP_PLATFORM is auto-detected by hipcc; unset to avoid build errors 20*da0073e9SAndroid Build Coastguard Worker unset HIP_PLATFORM 21*da0073e9SAndroid Build Coastguard Workerfi 22*da0073e9SAndroid Build Coastguard Worker 23*da0073e9SAndroid Build Coastguard Workermkdir -p "$pytest_reports_dir" || true 24