Skip to content

Commit

Permalink
test blocking v1
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 committed Jan 9, 2025
1 parent 69efdb2 commit 2ad1a64
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/actions/rust-targeted-unit-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ runs:
run: |
cargo x targeted-unit-tests -vvv --profile ci --cargo-profile ci --locked --no-fail-fast --retries 3
shell: bash
env:
MVC_BLOCK_V1: "true"
INDEXER_DATABASE_URL: postgresql://postgres@localhost/postgres
RUST_MIN_STACK: "4297152"
MVP_TEST_ON_CI: "true"
SOLC_EXE: /home/runner/bin/solc
Z3_EXE: /home/runner/bin/z3
CVC5_EXE: /home/runner/bin/cvc5
DOTNET_ROOT: /home/runner/.dotnet
BOOGIE_EXE: /home/runner/.dotnet/tools/boogie

- name: Run only the targeted unit tests for compiler v1
run: |
cargo x targeted-compiler-unit-tests -vvv --profile ci --cargo-profile ci --locked --no-fail-fast --retries 3
shell: bash
env:
INDEXER_DATABASE_URL: postgresql://postgres@localhost/postgres
RUST_MIN_STACK: "4297152"
Expand Down
51 changes: 50 additions & 1 deletion devtools/aptos-cargo-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ const RELEVANT_FILE_PATHS_FOR_COMPILER_V2: [&str; 7] = [
"aptos-move/move-examples",
"third_party/move",
];
const NO_MVC_BLOCK_V1_PACKAGES: [&str; 11] = [
"e2e-move-tests", // no block v1 because the meta data test requires using v1
"move-prover",
"move-prover-bytecode-pipeline",
"move-compiler",
"move-compiler-transactional-tests",
"move-compiler-v2-transactional-tests",
"move-to-yul",
"move-vm-integration-tests",
"move-model",
"move-stackless-bytecode-test-utils",
"move-stackless-bytecode",
];
const RELEVANT_FILE_PATHS_FOR_EXECUTION_PERFORMANCE_TESTS: [&str; 5] = [
".github/workflows/execution-performance.yaml",
".github/workflows/workflow-run-execution-performance.yaml",
Expand Down Expand Up @@ -84,6 +97,7 @@ pub enum AptosCargoCommand {
TargetedExecutionPerformanceTests(CommonArgs),
TargetedFrameworkUpgradeTests(CommonArgs),
TargetedUnitTests(CommonArgs),
TargetedCompilerUnitTests(CommonArgs),
Test(CommonArgs),
}

Expand Down Expand Up @@ -113,6 +127,7 @@ impl AptosCargoCommand {
AptosCargoCommand::TargetedExecutionPerformanceTests(args) => args,
AptosCargoCommand::TargetedFrameworkUpgradeTests(args) => args,
AptosCargoCommand::TargetedUnitTests(args) => args,
AptosCargoCommand::TargetedCompilerUnitTests(args) => args,
AptosCargoCommand::Test(args) => args,
}
}
Expand Down Expand Up @@ -292,7 +307,9 @@ impl AptosCargoCommand {
let package_name = get_package_name_from_path(&package_path);

// Only add the package if it is not in the ignore list
if TARGETED_UNIT_TEST_PACKAGES_TO_IGNORE.contains(&package_name.as_str()) {
if TARGETED_UNIT_TEST_PACKAGES_TO_IGNORE.contains(&package_name.as_str())
|| NO_MVC_BLOCK_V1_PACKAGES.contains(&package_name.as_str())
{
debug!(
"Ignoring package when running targeted-unit-tests: {:?}",
package_name
Expand All @@ -316,6 +333,38 @@ impl AptosCargoCommand {
println!("Skipping targeted unit tests because no test packages were affected!");
Ok(())
},
AptosCargoCommand::TargetedCompilerUnitTests(_) => {
// Run the targeted unit tests (if necessary).
// Start by calculating the affected packages.
let (direct_args, push_through_args, affected_package_paths) =
self.get_args_and_affected_packages(package_args)?;

// Filter out the ignored packages
let mut packages_to_test = vec![];
for package_path in affected_package_paths {
// Extract the package name from the full path
let package_name = get_package_name_from_path(&package_path);

// Only add the packages for v1 tests
if NO_MVC_BLOCK_V1_PACKAGES.contains(&package_name.as_str()) {
packages_to_test.push(package_path); // Add the package to the list
}
}

// Create and run the command if we found packages to test
if !packages_to_test.is_empty() {
println!("Running the targeted unit tests...");
return run_targeted_unit_tests(
packages_to_test,
direct_args,
push_through_args,
);
}

// Otherwise, skip the targeted unit tests
println!("Skipping targeted unit tests because no test packages were affected!");
Ok(())
},
_ => {
// Otherwise, we need to parse and run the command.
// Start by fetching the arguments and affected packages.
Expand Down
2 changes: 1 addition & 1 deletion third_party/move/move-prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub mod cli;

pub fn run_move_prover_errors_to_stderr(options: Options) -> anyhow::Result<()> {
let mut error_writer = StandardStream::stderr(ColorChoice::Auto);
run_move_prover(&mut error_writer, options)
run_move_prover_v2(&mut error_writer, options)
}

pub fn run_move_prover<W: WriteColor>(
Expand Down

0 comments on commit 2ad1a64

Please sign in to comment.