From ebab53f3c387339d3567d7980f522c1770f4be64 Mon Sep 17 00:00:00 2001 From: mario4tier Date: Wed, 16 Oct 2024 22:28:35 -0400 Subject: [PATCH] Add more Rust and Suibase versioning consistency tests --- scripts/common/__globals.sh | 2 +- scripts/tests/010_unit_test_common/test_globals.sh | 8 ++++++++ .../030_rust_cargo_tests/cargo_test_suibase_common.sh | 4 ++++ .../030_rust_cargo_tests/cargo_test_suibase_daemon.sh | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 scripts/tests/030_rust_cargo_tests/cargo_test_suibase_common.sh diff --git a/scripts/common/__globals.sh b/scripts/common/__globals.sh index e248ef07..96ff45b4 100644 --- a/scripts/common/__globals.sh +++ b/scripts/common/__globals.sh @@ -15,7 +15,7 @@ export SUIBASE_VERSION="0.1.7" # Suibase does not work with version below these. export MIN_SUI_VERSION="sui 0.27.0" -export MIN_RUST_VERSION="rustc 1.65.0" +export MIN_RUST_VERSION="rustc 1.81.0" # Mandatory command line: # $1 : Should be the "$0" of the caller script. diff --git a/scripts/tests/010_unit_test_common/test_globals.sh b/scripts/tests/010_unit_test_common/test_globals.sh index 04eedd17..b341cee3 100755 --- a/scripts/tests/010_unit_test_common/test_globals.sh +++ b/scripts/tests/010_unit_test_common/test_globals.sh @@ -31,6 +31,14 @@ tests() { # apart from the first phase. sleep 1 test_file_newer_than_phase_2 + test_versions_consistency +} + +test_versions_consistency() { + # Check that the hard coded version is mention in the CHANGELOG.md + if ! grep -q "$SUIBASE_VERSION" "$SUIBASE_DIR/CHANGELOG.md"; then + fail "Seems that $SUIBASE_VERSION version is *not* documented in CHANGELOG.md" + fi } test_color() { diff --git a/scripts/tests/030_rust_cargo_tests/cargo_test_suibase_common.sh b/scripts/tests/030_rust_cargo_tests/cargo_test_suibase_common.sh new file mode 100755 index 00000000..d8ad01c1 --- /dev/null +++ b/scripts/tests/030_rust_cargo_tests/cargo_test_suibase_common.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# shellcheck source=SCRIPTDIR/../../tests/030_rust_cargo_tests/__test_common.sh +source "$HOME/suibase/scripts/tests/030_rust_cargo_tests/__test_common.sh" "$HOME/suibase/rust/suibase/common" diff --git a/scripts/tests/030_rust_cargo_tests/cargo_test_suibase_daemon.sh b/scripts/tests/030_rust_cargo_tests/cargo_test_suibase_daemon.sh index ea62a8d9..9b509d76 100755 --- a/scripts/tests/030_rust_cargo_tests/cargo_test_suibase_daemon.sh +++ b/scripts/tests/030_rust_cargo_tests/cargo_test_suibase_daemon.sh @@ -1,4 +1,4 @@ #!/bin/bash # shellcheck source=SCRIPTDIR/../../tests/030_rust_cargo_tests/__test_common.sh -source "$HOME/suibase/scripts/tests/030_rust_cargo_tests/__test_common.sh" "$HOME/suibase/rust/demo-app" +source "$HOME/suibase/scripts/tests/030_rust_cargo_tests/__test_common.sh" "$HOME/suibase/rust/suibase/suibase-daemon"