11#! /usr/bin/env bash
22# Copyright (c) Meta Platforms, Inc. and affiliates.
33# All rights reserved.
4+ # Copyright 2025 Arm Limited and/or its affiliates.
45#
56# This source code is licensed under the BSD-style license found in the
67# LICENSE file in the root directory of this source tree.
@@ -10,16 +11,26 @@ SUITE=$1
1011FLOW=$2
1112ARTIFACT_DIR=$3
1213
13- REPORT_FILE=" $ARTIFACT_DIR /test-report-$FLOW -$SUITE .csv "
14+ REPORT_FILE=" $ARTIFACT_DIR /test-report-$FLOW -$SUITE .json "
1415
1516echo " Running backend test job for suite $SUITE , flow $FLOW ."
1617echo " Saving job artifacts to $ARTIFACT_DIR ."
1718
18- # The generic Linux job chooses to use base env, not the one setup by the image
1919eval " $( conda shell.bash hook) "
2020CONDA_ENV=$( conda env list --json | jq -r " .envs | .[-1]" )
2121conda activate " ${CONDA_ENV} "
2222
23+ if [[ " $( uname) " == " Darwin" ]]; then
24+ bash .ci/scripts/setup-conda.sh
25+ eval " $( conda shell.bash hook) "
26+ CONDA_RUN_CMD=" ${CONDA_RUN} --no-capture-output"
27+ ${CONDA_RUN_CMD} pip install awscli==1.37.21
28+ IS_MACOS=1
29+ else
30+ CONDA_RUN_CMD=" "
31+ IS_MACOS=0
32+ fi
33+
2334export PYTHON_EXECUTABLE=python
2435
2536# CMake options to use, in addition to the defaults.
4859if [[ " $FLOW " == * arm* ]]; then
4960 # Setup ARM deps.
5061 .ci/scripts/setup-arm-baremetal-tools.sh
62+ source examples/arm/ethos-u-scratch/setup_path.sh
63+
64+ if [[ " $FLOW " == * ethos_u* ]]; then
65+ # Prepare a test runner binary that can run on the Corstone-3x0 FVPs
66+ backends/arm/scripts/build_executorch.sh
67+ backends/arm/test/setup_testing.sh
68+ fi
5169fi
5270
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
71+ if [[ $IS_MACOS -eq 1 ]]; then
72+ SETUP_SCRIPT=.ci/scripts/setup-macos.sh
73+ else
74+ SETUP_SCRIPT=.ci/scripts/setup-linux.sh
75+ fi
76+ CMAKE_ARGS=" $EXTRA_BUILD_ARGS " ${CONDA_RUN_CMD} $SETUP_SCRIPT --build-tool cmake --build-mode Release --editable true
5577
5678EXIT_CODE=0
57- python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report " $REPORT_FILE " || EXIT_CODE=$?
58-
79+ ${CONDA_RUN_CMD} pytest -c /dev/nul -n auto backends/test/suite/$SUITE / -m flow_$FLOW --json-report --json-report-file=" $REPORT_FILE " || EXIT_CODE=$?
5980# Generate markdown summary.
60- python -m executorch.backends.test.suite.generate_markdown_summary " $REPORT_FILE " > ${GITHUB_STEP_SUMMARY:- " step_summary.md" } --exit-code $EXIT_CODE
81+ ${CONDA_RUN_CMD} python -m executorch.backends.test.suite.generate_markdown_summary_json " $REPORT_FILE " > ${GITHUB_STEP_SUMMARY:- " step_summary.md" } --exit-code $EXIT_CODE
0 commit comments