From 1ba810df58f2ffecc657d3435fdfa1cb394fd0a5 Mon Sep 17 00:00:00 2001 From: Dominik Lau Date: Tue, 7 Jan 2025 15:57:24 +0100 Subject: [PATCH] [#70544] [#71243] regression tests for uboot, refactor config mechanism --- .ci.yml | 24 ++++++++++++++++---- ci/get_dashboard_replkit.sh | 39 ++++++++++++++++++++++---------- ci/test.sh | 44 +++++++++++++++++++++++++++---------- 3 files changed, 80 insertions(+), 27 deletions(-) diff --git a/.ci.yml b/.ci.yml index cd809be..3f712fb 100644 --- a/.ci.yml +++ b/.ci.yml @@ -42,7 +42,7 @@ Test Static release: - test.repl - test2.repl -Compare repls: +.compare_repls: &compare_repls stage: Test image: debian:bullseye variables: @@ -60,8 +60,24 @@ Compare repls: - apt -qqy install automake autoconf cmake libtool g++ coreutils policykit-1 libgtk2.0-dev uml-utilities gtk-sharp2 wget jq git curl python3 python3-pip parallel xz-utils rename &> /dev/null - apt -qqy install mono-complete &> /dev/null - mono --version - before_script: - - ./ci/prepare.sh + before_script: + - ./ci/prepare.sh # uses DASHBOARD_VARIANT script: - - ./ci/test.sh + - ./ci/test.sh # uses DASHBOARD_VARIANT - ./ci/process_test_results.sh + +Compare repls uboot: + <<: *compare_repls + variables: + RENODE_VERSION: "latest" + DEBIAN_FRONTEND: "noninteractive" + GET_CUSTOM_RENODE_REVISION: "" + DASHBOARD_VARIANT: "uboot" + +Compare repls zephyr: + <<: *compare_repls + variables: + RENODE_VERSION: "latest" + DEBIAN_FRONTEND: "noninteractive" + GET_CUSTOM_RENODE_REVISION: "" + DASHBOARD_VARIANT: "zephyr" diff --git a/ci/get_dashboard_replkit.sh b/ci/get_dashboard_replkit.sh index 4689ab2..2100d32 100755 --- a/ci/get_dashboard_replkit.sh +++ b/ci/get_dashboard_replkit.sh @@ -1,25 +1,40 @@ #!/bin/bash set -euo pipefail -GCP_SIM_BASE="https://zephyr-dashboard.renode.io/zephyr_sim" -LATEST_ZEPHYR=$(curl --fail -sS -G "$GCP_SIM_BASE"/latest) -LATEST_RENODE=$(curl --fail -sS -G "$GCP_SIM_BASE"/"$LATEST_ZEPHYR"/latest) +if [[ "$DASHBOARD_VARIANT" == "zephyr" ]]; then + GCP_SIM_BASE="https://zephyr-dashboard.renode.io/zephyr_sim" + export DEMO_NAME=hello_world +elif [[ "$DASHBOARD_VARIANT" == "uboot" ]]; then + GCP_SIM_BASE="https://u-boot-dashboard.renode.io/uboot_sim" + export DEMO_NAME=uboot +else + exit 1 +fi + +LATEST_SIM=$(curl --fail -sS -G "$GCP_SIM_BASE"/latest) +LATEST_RENODE=$(curl --fail -sS -G "$GCP_SIM_BASE"/"$LATEST_SIM"/latest) +wget "$GCP_SIM_BASE"/"$LATEST_SIM"/"$LATEST_RENODE"/replkit.tar.xz -wget "$GCP_SIM_BASE"/"$LATEST_ZEPHYR"/"$LATEST_RENODE"/replkit.tar.xz mkdir replkit tar xf replkit.tar.xz -C replkit >/dev/null -# Grab only the hello_world repls, configs and dtses + +# Grab only the DEMO_NAME repls, configs and dtses # We assume they will be the same as for other samples -rename -E 's:replkit/:dts/:' -E 's:-hello_world.dts:.dts:' replkit/*-hello_world.dts -rename -E 's:replkit/:repls/dashboard/:' -E 's:-hello_world.repl:.repl:' replkit/*-hello_world.repl -rename -E 's:replkit/:repls/dashboard/:' -E 's:-hello_world-config.json:-config.json:' replkit/*-hello_world-config.json -# Remove the leftovers (dts/repl/json from other samples) -rm replkit/*.repl -rm replkit/*.json -rm replkit/*.dts +rename -E 's:replkit/:dts/:' -E "s:-${DEMO_NAME}.dts:.dts:" replkit/*-${DEMO_NAME}.dts +rename -E 's:replkit/:repls/dashboard/:' -E "s:-${DEMO_NAME}.repl:.repl:" replkit/*-${DEMO_NAME}.repl + +if ls replkit/*-"$DEMO_NAME"-config.json 1> /dev/null 2>&1; then + rename -E 's:replkit/:repls/dashboard/:' -E "s:-${DEMO_NAME}-config.json:-config.json:" replkit/*-${DEMO_NAME}-config.json + rm replkit/*.json +fi + # Grab the versions mv replkit/*.version . +# Remove the leftovers +rm replkit/*.repl +rm replkit/*.dts + rmdir replkit 2>/dev/null || { echo replkit had unexpected files: ls -l replkit diff --git a/ci/test.sh b/ci/test.sh index 6db2cc7..220cca9 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -1,5 +1,6 @@ #!/bin/bash -set -euxo pipefail +set -exuo pipefail + # Print which dts2repl commits are being compared OLD_COMMIT="$( "{}.diff" && rm "{}.diff" || true' popd