Преглед изворни кода

ci: improve frozen abi test (#9044)

* ci: improve test-abi script

* rename ci/test-abi.sh -> ci/test-frozen-abi.sh

* add solana-vote-interface/frozen-abi to vote/Cargo.toml

* Update ci/test-frozen-abi.sh

Co-authored-by: Mykola Dzham <i@levsha.me>

* extract the same command

---------

Co-authored-by: Mykola Dzham <i@levsha.me>
Yihau Chen пре 5 дана
родитељ
комит
89ae1969d5
4 измењених фајлова са 23 додато и 12 уклоњено
  1. 1 1
      ci/buildkite-pipeline.sh
  2. 0 10
      ci/test-abi.sh
  3. 17 0
      ci/test-frozen-abi.sh
  4. 5 1
      vote/Cargo.toml

+ 1 - 1
ci/buildkite-pipeline.sh

@@ -185,7 +185,7 @@ all_test_steps() {
   command_step dcou-2-of-3 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh --partition 2/3" 20 check
   command_step dcou-3-of-3 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh --partition 3/3" 20 check
   command_step miri "ci/docker-run-default-image.sh ci/test-miri.sh" 5 check
-  command_step frozen-abi "ci/docker-run-default-image.sh ci/test-abi.sh" 15 check
+  command_step frozen-abi "ci/docker-run-default-image.sh ci/test-frozen-abi.sh" 30 check
   wait_step
 
   # Full test suite

+ 0 - 10
ci/test-abi.sh

@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-#
-# Easily run the ABI tests for the entire repo or a subset
-#
-
-here="$(dirname "$0")"
-cargo="$(readlink -f "${here}/../cargo")"
-
-set -x
-exec "$cargo" nightly test --features frozen-abi --lib -- test_abi_ --nocapture

+ 17 - 0
ci/test-frozen-abi.sh

@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+#
+# Easily run the ABI tests for the entire repo or a subset
+#
+
+set -euo pipefail
+here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
+
+# shellcheck source=ci/rust-version.sh
+source "$here/rust-version.sh" nightly
+
+packages=$(cargo +"$rust_nightly" metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.features | has("frozen-abi")) | .name')
+for package in $packages; do
+  cmd="cargo +$rust_nightly test -p $package --features frozen-abi --lib -- test_abi_ --nocapture"
+  echo "--- $cmd"
+  $cmd
+done

+ 5 - 1
vote/Cargo.toml

@@ -19,7 +19,11 @@ name = "solana_vote"
 [features]
 agave-unstable-api = []
 dev-context-only-utils = ["dep:rand", "dep:bincode"]
-frozen-abi = ["dep:solana-frozen-abi", "dep:solana-frozen-abi-macro"]
+frozen-abi = [
+    "dep:solana-frozen-abi",
+    "dep:solana-frozen-abi-macro",
+    "solana-vote-interface/frozen-abi",
+]
 
 [dependencies]
 bincode = { workspace = true, optional = true }