Skip to content

Commit

Permalink
remove unneeded changes to move_pr.sh script, leaving more sturdy v2 …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
brmataptos committed Jul 1, 2024
1 parent c1702a2 commit c9ed68a
Showing 1 changed file with 64 additions and 61 deletions.
125 changes: 64 additions & 61 deletions third_party/move/scripts/move_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
set -e

MOVE_PR_PROFILE="${MOVE_PR_PROFILE:-ci}"
MOVE_PR_NEXTEST_PROFILE="${MOVE_PR_NEXTEST_PROFILE:-ci}"
MOVE_PR_NEXTEST_PROFILE="${MOVE_PR_NEXTEST_PROFILE:-smoke-test}"

BASE=$(git rev-parse --show-toplevel)

Expand Down Expand Up @@ -69,10 +69,8 @@ EOF
GIT_CHECKS=1
;;
a)
TEST=1
INTEGRATION_TEST=1
COMPILER_V2_TEST=1
CHECK=1
GEN_ARTIFACTS=1
GIT_CHECKS=1
esac
Expand All @@ -90,52 +88,52 @@ ARTIFACT_CRATE_PATHS="\

# This is a partial list of Move crates, to keep this script fast.
# May be extended as needed but should be kept minimal.
MOVE_CRATES="
-p move-stackless-bytecode
-p move-stdlib
-p move-bytecode-verifier
-p move-binary-format
-p move-compiler
-p move-compiler-v2
-p move-compiler-v2-transactional-tests
-p move-prover-boogie-backend
-p move-prover
-p move-transactional-test-runner
-p move-vm-runtime
-p move-vm-types
MOVE_CRATES="\
-p move-stackless-bytecode\
-p move-stdlib\
-p move-bytecode-verifier\
-p move-binary-format\
-p move-compiler\
-p move-compiler-v2\
-p move-compiler-v2-transactional-tests\
-p move-prover-boogie-backend\
-p move-prover\
-p move-transactional-test-runner\
-p move-vm-runtime\
-p move-vm-types\
"

# This is a list of crates for integration testing which depends on the
# MOVE_COMPILER_V2 env var.
MOVE_CRATES_V2_ENV_DEPENDENT="
-p aptos-transactional-test-harness
-p bytecode-verifier-transactional-tests
-p move-async-vm
-p move-cli
-p move-model
-p move-package
-p move-prover-bytecode-pipeline
-p move-stackless-bytecode
-p move-to-yul
-p move-transactional-test-runner
-p move-unit-test
-p move-vm-transactional-tests
-p aptos-move-stdlib
-p move-abigen
-p move-docgen
-p move-stdlib
-p move-table-extension
-p move-vm-integration-tests
-p aptos-move-examples
-p e2e-move-tests
-p aptos-framework
MOVE_CRATES_V2_ENV_DEPENDENT="\
-p aptos-transactional-test-harness \
-p bytecode-verifier-transactional-tests \
-p move-async-vm \
-p move-cli \
-p move-model \
-p move-package \
-p move-prover-bytecode-pipeline \
-p move-stackless-bytecode \
-p move-to-yul \
-p move-transactional-test-runner \
-p move-unit-test \
-p move-vm-transactional-tests \
-p aptos-move-stdlib\
-p move-abigen\
-p move-docgen\
-p move-stdlib\
-p move-table-extension\
-p move-vm-integration-tests\
-p aptos-move-examples\
-p e2e-move-tests\
-p aptos-framework\
"

# Crates which do depend on compiler env but currently
# do not maintain separate v2 baseline files. Those
# are listed here for documentation and later fixing.
MOVE_CRATES_V2_ENV_DEPENDENT_FAILURES="
-p aptos-api
MOVE_CRATES_V2_ENV_DEPENDENT_FAILURES="\
-p aptos-api\
"

if [ ! -z "$CHECK" ]; then
Expand All @@ -148,23 +146,24 @@ if [ ! -z "$CHECK" ]; then
)
fi

CARGO_OP_PARAMS="--locked --profile $MOVE_PR_PROFILE"
CARGO_NEXTEST_PARAMS="--locked --profile $MOVE_PR_NEXTEST_PROFILE --cargo-profile $MOVE_PR_PROFILE"
CARGO_OP_PARAMS="--profile $MOVE_PR_PROFILE"
CARGO_NEXTEST_PARAMS="--profile $MOVE_PR_NEXTEST_PROFILE --cargo-profile $MOVE_PR_PROFILE"

# Artifact generation needs to be run before testing as tests may depend on its result
if [ ! -z "$GEN_ARTIFACTS" ]; then
for dir in $ARTIFACT_CRATE_PATHS; do
echo "*************** [move-pr] Generating artifacts for crate $dir"
for dir in $ARTIFACT_CRATE_PATHS; do
echo "*************** [move-pr] Generating artifacts for crate $dir"
(
cd $MOVE_BASE/$dir
cargo run $CARGO_OP_PARAMS
)
done

# Add hoc treatment
(
cd $MOVE_BASE/$dir
cargo run $CARGO_OP_PARAMS
cd $BASE
cargo build $CARGO_OP_PARAMS -p aptos-cached-packages
)
done
# Add hoc treatment
(
cd $BASE
cargo build $CARGO_OP_PARAMS -p aptos-cached-packages
)
fi

if [ ! -z "$TEST" ]; then
Expand All @@ -178,22 +177,26 @@ if [ ! -z "$TEST" ]; then
)
fi

if [ ! -z "$COMPILER_V2_TEST" ]; then
echo "*************** [move-pr] Running integration tests with compiler v2"
if [ ! -z "$INTEGRATION_TEST" ]; then
echo "*************** [move-pr] Running integration tests"
(
cd $BASE
MVC_DOCGEN_OUTPUT_DIR=tests/compiler-v2-doc \
MOVE_COMPILER_V2=true cargo nextest run $CARGO_NEXTEST_PARAMS \
$MOVE_CRATES_V2_ENV_DEPENDENT
MOVE_COMPILER_V2=false cargo build $CARGO_OP_PARAMS \
$MOVE_CRATES $MOVE_CRATES_V2_ENV_DEPENDENT
MOVE_COMPILER_V2=false cargo nextest run $CARGO_NEXTEST_PARAMS \
$MOVE_CRATES $MOVE_CRATES_V2_ENV_DEPENDENT
)
fi

if [ ! -z "$INTEGRATION_TEST" ]; then
echo "*************** [move-pr] Running integration tests"
if [ ! -z "$COMPILER_V2_TEST" ]; then
echo "*************** [move-pr] Running integration tests with compiler v2"
(
cd $BASE
MOVE_COMPILER_V2=false cargo nextest run $CARGO_NEXTEST_PARAMS \
$MOVE_CRATES $MOVE_CRATES_V2_ENV_DEPENDENT
MVC_DOCGEN_OUTPUT_DIR=tests/compiler-v2-doc MOVE_COMPILER_V2=true cargo build $CARGO_OP_PARAMS \
$MOVE_CRATES_V2_ENV_DEPENDENT
MVC_DOCGEN_OUTPUT_DIR=tests/compiler-v2-doc \
MOVE_COMPILER_V2=true cargo nextest run $CARGO_NEXTEST_PARAMS \
$MOVE_CRATES_V2_ENV_DEPENDENT
)
fi

Expand Down

0 comments on commit c9ed68a

Please sign in to comment.