Skip to content

Commit fe93dab

Browse files
committed
Update
[ghstack-poisoned]
1 parent 32f66ca commit fe93dab

File tree

3 files changed

+17
-38
lines changed

3 files changed

+17
-38
lines changed

.ci/scripts/test_backend_linux.sh renamed to .ci/scripts/test_backend.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ REPORT_FILE="$ARTIFACT_DIR/test-report-$FLOW-$SUITE.json"
1515
echo "Running backend test job for suite $SUITE, flow $FLOW."
1616
echo "Saving job artifacts to $ARTIFACT_DIR."
1717

18-
# The generic Linux job chooses to use base env, not the one setup by the image
1918
eval "$(conda shell.bash hook)"
2019
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
2120
conda activate "${CONDA_ENV}"
2221

22+
if [[ "$(uname)" == "Darwin" ]]; then
23+
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
24+
IS_MACOS=1
25+
else
26+
IS_MACOS=0
27+
fi
28+
2329
export PYTHON_EXECUTABLE=python
2430

2531
# CMake options to use, in addition to the defaults.
@@ -50,11 +56,14 @@ if [[ "$FLOW" == *arm* ]]; then
5056
.ci/scripts/setup-arm-baremetal-tools.sh
5157
fi
5258

53-
# We need the runner to test the built library.
54-
PYTHON_EXECUTABLE=python CMAKE_ARGS="$EXTRA_BUILD_ARGS" .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release --editable true
59+
if [[ $IS_MACOS -eq 1 ]]; then
60+
$SETUP_SCRIPT=.ci/scripts/setup-macos.sh
61+
else;
62+
$SETUP_SCRIPT=.ci/scripts/setup-linux.sh
63+
fi
64+
${CONDA_RUN} --no-capture-output CMAKE_ARGS="$EXTRA_BUILD_ARGS" $SETUP_SCRIPT --build-tool cmake --build-mode Release --editable true
5565

5666
EXIT_CODE=0
57-
pytest -c /dev/nul -n auto backends/test/suite/$SUITE/ -m flow_$FLOW --json-report --json-report-file="$REPORT_FILE" || EXIT_CODE=$?
58-
67+
${CONDA_RUN} --no-capture-output pytest -c /dev/nul -n auto backends/test/suite/$SUITE/ -m flow_$FLOW --json-report --json-report-file="$REPORT_FILE" || EXIT_CODE=$?
5968
# Generate markdown summary.
60-
python -m executorch.backends.test.suite.generate_markdown_summary_json "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE
69+
${CONDA_RUN} --no-capture-output python -m executorch.backends.test.suite.generate_markdown_summary_json "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE

.ci/scripts/test_backend_macos.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/_test_backend.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
script: |
5858
set -eux
5959
60-
source .ci/scripts/test_backend_linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
60+
source .ci/scripts/test_backend.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
6161
6262
test-backend-macos:
6363
if: ${{ inputs.run-macos }}
@@ -81,4 +81,4 @@ jobs:
8181
# This is needed to get the prebuilt PyTorch wheel from S3
8282
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
8383
84-
source .ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
84+
source .ci/scripts/test_backend.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"

0 commit comments

Comments
 (0)