Skip to content

Commit

Permalink
Refactor tests to always get latest driver version
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA committed Dec 6, 2024
1 parent 8c6eed5 commit 2a02781
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
10 changes: 0 additions & 10 deletions ci/image-name/deserialize.test

This file was deleted.

36 changes: 34 additions & 2 deletions ci/image-name/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@
set -euo pipefail

MATRIX="$(yq -o json matrix.yaml)"
MATRIX="${MATRIX}" jq --run-tests ci/image-name/deserialize.test
LATEST_DRIVER_VERSION="$(echo "${MATRIX}" | jq -r '.DRIVER_VERSION[-1]')"

ci/image-name/deserialize.sh linux-gpu-565-open-amd64-pr-1234 | jq -e '. == {"os": "linux", "variant": "gpu", "driver_version": "565", "driver_flavor": "open", "arch": "amd64", "branch_name": "pr-1234"}'
ci/image-name/deserialize.sh "linux-gpu-${LATEST_DRIVER_VERSION}-open-arm64-main" | \
LATEST_DRIVER_VERSION="${LATEST_DRIVER_VERSION}" \
jq -e ". == {
\"os\": \"linux\",
\"variant\": \"gpu\",
\"driver_version\": env.LATEST_DRIVER_VERSION,
\"driver_flavor\": \"open\",
\"arch\": \"arm64\",
\"branch_name\": \"main\"
}"
ci/image-name/deserialize.sh "windows-cpu-amd64-pr-1234" | \
jq -e ". == {
\"os\": \"windows\",
\"variant\": \"cpu\",
\"driver_version\": null,
\"driver_flavor\": null,
\"arch\": \"amd64\",
\"branch_name\": \"pr-1234\"
}"
ci/image-name/deserialize.sh "linux-gpu-${LATEST_DRIVER_VERSION}-open-arm64" | \
LATEST_DRIVER_VERSION="${LATEST_DRIVER_VERSION}" \
jq -e ". == {
\"os\": \"linux\",
\"variant\": \"gpu\",
\"driver_version\": env.LATEST_DRIVER_VERSION,
\"driver_flavor\": \"open\",
\"arch\": \"arm64\",
\"branch_name\": null
}"

! ci/image-name/deserialize.sh "linux-${LATEST_DRIVER_VERSION}-arm64-main"
! ci/image-name/deserialize.sh "gpu-${LATEST_DRIVER_VERSION}-arm64-main"
! ci/image-name/deserialize.sh "linux-gpu-${LATEST_DRIVER_VERSION}-main"

0 comments on commit 2a02781

Please sign in to comment.