Skip to content

Commit

Permalink
[move] Fix artifact generation and test for pure Move development (ap…
Browse files Browse the repository at this point in the history
…tos-labs#5297)

This moves the test for whether artifacts are up-to-date out of framework into its own crate. This is necessary so the test is not contaminated with dependencies to `cached-packages`. Moreover, `cached-packages` is introduced as a pseudo dev-dependency to framework. This ensures that artifacts are updated if tests are called on the framework. Overall, this should smoothen out the flow for folks which only change Move code. (Albeit, extra compile time for artifacts on `cargo test -p framework`, but that is unavoidable.)
  • Loading branch information
wrwg authored Oct 26, 2022
1 parent 5ea5e19 commit 214a98c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 8 deletions.
14 changes: 11 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ members = [
"aptos-move/e2e-tests",
"aptos-move/e2e-testsuite",
"aptos-move/framework",
"aptos-move/framework/artifacts-test",
"aptos-move/framework/cached-packages",
"aptos-move/gas-algebra-ext",
"aptos-move/move-examples",
Expand Down
7 changes: 3 additions & 4 deletions aptos-move/framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ move-vm-types ={ workspace = true }
rand_core = "0.5.1"

[dev-dependencies]
claims = "0.7"
dir-diff = "0.3.2"
fs_extra = "1.2.0"

aptos-gas = { path = "../../aptos-move/aptos-gas" }
aptos-vm = { path = "../../aptos-move/aptos-vm", features = ["testing"] }
claims = "0.7"

cached-packages = { path = "cached-packages" } # keep to ensure build of artifacts
move-cli = { workspace = true }
move-prover = { workspace = true }

Expand Down
18 changes: 18 additions & 0 deletions aptos-move/framework/artifacts-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "artifacts-test"
version = "0.1.0"
edition = "2021"
authors = ["Aptos Labs <[email protected]>"]
repository = "https://github.com/aptos-labs/aptos-core"
homepage = "https://aptoslabs.com"
license = "Apache-2.0"
publish = false

[dependencies]
dir-diff = "0.3.2"
framework = { path = ".." }
fs_extra = "1.2.0"
tempfile = "3.3.0"

[lib]
doctest = false
5 changes: 5 additions & 0 deletions aptos-move/framework/artifacts-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This crate contains a single test for CI to check whether someone has pulled
a build dependency on `cached-packages` and therefore generated
artifacts are up-to-date. The test must be standalone in its
own crate to ensure running it does not itself request build of
`cached-packages`.
File renamed without changes.
5 changes: 5 additions & 0 deletions aptos-move/framework/artifacts-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0

#[cfg(test)]
mod artifact_test;
1 change: 0 additions & 1 deletion aptos-move/framework/cached-packages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ include_dir = { version = "0.7.2", features = ["glob"] }
once_cell = "1.10.0"
proptest = { version = "1.0.0", optional = true }
proptest-derive = { version = "0.3.0", optional = true }
tempfile = "3.3.0"

move-core-types = { workspace = true }

Expand Down

0 comments on commit 214a98c

Please sign in to comment.