mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Centralize test configuration (filters, retries, fail-fast, sequential/parallel scheduling) into nextest profiles, replacing scattered flags across shell scripts. This simplifies the scripts and provides a single source of truth for test behavior. Enable JUnit XML output per profile, giving CI systems structured test results for better reporting. Not all test invocations are converted to profiles yet. Just the ones that are repeated across scripts. Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
35 lines
952 B
Bash
Executable File
35 lines
952 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck disable=SC2048,SC2086,SC2154,SC1094
|
|
set -x
|
|
|
|
# shellcheck source=/dev/null
|
|
source "$HOME"/.cargo/env
|
|
source "$(dirname "${BASH_SOURCE[0]}")/test-util.sh"
|
|
|
|
WORKLOADS_DIR="$HOME/workloads"
|
|
mkdir -p "$WORKLOADS_DIR"
|
|
mkdir -p "$WORKLOADS_DIR/junit"
|
|
|
|
process_common_args "$@"
|
|
|
|
test_features="--features mshv,igvm,sev_snp"
|
|
build_features="mshv,igvm,sev_snp"
|
|
|
|
download_x86_guest_images
|
|
cp scripts/sha1sums-x86_64-common "$WORKLOADS_DIR"
|
|
|
|
pushd "$WORKLOADS_DIR" || exit
|
|
if ! sha1sum sha1sums-x86_64-common --check; then
|
|
echo "sha1sum validation of images failed, remove invalid images to fix the issue."
|
|
exit 1
|
|
fi
|
|
popd || exit
|
|
|
|
cargo build --features $build_features --all --release --target "$BUILD_TARGET"
|
|
|
|
export RUST_BACKTRACE=1
|
|
time cargo nextest run -p cloud-hypervisor $test_features --profile common_cvm --no-tests=pass --test-threads=$(($(nproc) / 4)) "$test_filter" -- ${test_binary_args[*]}
|
|
RES=$?
|
|
|
|
exit $RES
|