Skip to content

Commit

Permalink
container-api.sh: make container-api script work with zephyr-intel (z…
Browse files Browse the repository at this point in the history
…ephyrproject-rtos#14)

Account for the zephyrproject/zephyr-intel vs zephyrproject/zephyr path
to repo checkout.

West needs to run against zephyr-intel dir and the quarantine list is
also located down that path. That's the only difference between zphyr
and zephyr-intel. So a simple check for a zephyrproject/zephyr-intel
directory tells us which flavor we have, and sets a ZEPHYR_DIR var to
use to toggle the path accordingly.

Signed-off-by: Graydon, Connor Jameson <[email protected]>
  • Loading branch information
cjgraydon authored Jan 29, 2022
1 parent ece0db8 commit 1275ff4
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions 1rtos/container-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,38 @@
# <batch#> ($3) = which batch number am I
# <parallel#> ($4) = total number of parallel jobs
# <option-str>($5) = optional twister parameter to pass, typically used for "--integration"


1rtos-ci() {
cd "$2/zephyrproject"
if [ -d zephyr-intel ]; then
# We are doing zephyr-intel"
export ZEPHYR_DIR="zephyr-intel"
else
export ZEPHYR_DIR="zephyr"
fi
if [ ! -d .west ]; then
west init -l zephyr
west init -l $ZEPHYR_DIR
fi
west update

export ZEPHYR_BASE="$2/zephyrproject/zephyr"
# This is same for both zephyr and zephyr-intel
export ZEPHYR_BASE="$2/zephyrproject/zephyr"
cd "$ZEPHYR_BASE"

# quarantine list
if [ -f $2/zephyrproject/$ZEPHYR_DIR/.github/workflows/twister-quarantine-list ]; then
QUARANTINE_FILE=$2/zephyrproject/$ZEPHYR_DIR/.github/workflows/twister-quarantine-list
QUARANTINE_CMD=" --quarantine-list $QUARANTINE_FILE"
fi

# set twister cmdline, injecting $5/option-str
TWISTER_CMD="scripts/twister -M -x=USE_CCACHE=0 -N --inline-logs -v $5"
TWISTER_CMD="scripts/twister -M -x=USE_CCACHE=0 -N --inline-logs -v $5 $QUARANTINE_CMD"

# store all testcases
# store all testcases
$TWISTER_CMD --save-tests testcases
cp testcases testcases.0

# apply twisterSkipList if exists in container
if [ -f /opt/1rtos/twisterSkipList ]; then
. ./opt/1rtos/twisterSkipList
for tc in "${TWISTER_SKIP_LIST[@]}"; do
sed -i "\\#$tc#d" testcases
done
fi

# apply twisterSkipList if exists in repo
if [ -f .github/workflows/twisterSkipList ]; then
. .github/workflows/twisterSkipList
for tc in "${TWISTER_SKIP_LIST[@]}"; do
sed -i "\\#$tc#d" testcases
done
fi

# run twister with our standard options + injected batch/parallel & extra params
$TWISTER_CMD -B $3/$4 --load-tests testcases --retry-failed 3 --retry-interval 60
}
Expand Down

0 comments on commit 1275ff4

Please sign in to comment.