From 24644b671d245700992e46d1141057ca3d758d6d Mon Sep 17 00:00:00 2001 From: Kate Goldenring Date: Mon, 11 Mar 2024 12:28:20 -0700 Subject: [PATCH] fix(tests): run integration tests with cargo instead of cross Signed-off-by: Kate Goldenring --- .github/workflows/ci.yaml | 5 +++++ Makefile | 4 ++-- scripts/check-bins.sh | 2 +- scripts/workloads.sh | 7 +++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 571ad850..8de38b3d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,6 +42,11 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 + - uses: azure/setup-kubectl@v3 + - name: "Install dependencies" + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler libseccomp-dev - name: Extract containerd-shim-spin-linux-${{ env.ARCH }} run: | mkdir -p ./bin diff --git a/Makefile b/Makefile index 75affbd4..b930cf46 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ workloads: ./scripts/workloads.sh .PHONY: integration-tests -integration-tests: install-cross check-bins move-bins up pod-status-check workloads - cross test --release -- --nocapture +integration-tests: check-bins move-bins up pod-status-check workloads + cargo test -p containerd-shim-spin-tests -- --nocapture .PHONY: tests/clean tests/clean: diff --git a/scripts/check-bins.sh b/scripts/check-bins.sh index 1d72fcd8..e7209336 100755 --- a/scripts/check-bins.sh +++ b/scripts/check-bins.sh @@ -34,7 +34,7 @@ which_binary() { # List of binary names -binaries=("k3d" "cross" "docker" "kubectl") +binaries=("k3d" "docker" "kubectl") for binary in "${binaries[@]}"; do which_binary "$binary" diff --git a/scripts/workloads.sh b/scripts/workloads.sh index 210b9a0e..855cbbfe 100755 --- a/scripts/workloads.sh +++ b/scripts/workloads.sh @@ -2,6 +2,13 @@ set -euo pipefail +# Check if kubectl is installed +if ! command -v kubectl &> /dev/null; then + echo "kubectl is not installed. Installing..." + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl; +fi + # apply the workloads echo ">>> apply workloads" kubectl apply -f tests/workloads