Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[twin] tesuite for twin into own crate #306

Merged
merged 91 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
8f57a44
include rescue and storage in libra cli
Aug 6, 2024
3deaeea
refactor rescue and storage cli to include as subcommand in libra-cli
0o-de-lally Aug 6, 2024
4db089a
fmt
0o-de-lally Aug 6, 2024
a0b0e82
clippy
0o-de-lally Aug 6, 2024
ced6ede
add storage and rescue
0o-de-lally Aug 6, 2024
603e819
format
0o-de-lally Aug 6, 2024
d9aae62
cli text
0o-de-lally Aug 6, 2024
afea441
update fixtures
0o-de-lally Aug 6, 2024
9b69af4
fmt
Aug 6, 2024
3eff1f6
use full db tool
Aug 6, 2024
2f2f4e3
[ci] mainnet.mrb updated to release candidate head.mrb (#301)
0o-de-lally Aug 7, 2024
0f26993
update debugger
Aug 7, 2024
62d8c8b
storage_cli should follow clap pattern of other cli tools
Aug 7, 2024
1127c8c
text
Aug 7, 2024
f65cc5f
fmt
Aug 7, 2024
7bfd4ba
add makefile with example
Aug 7, 2024
be0777e
snapshot restore seems to work
Aug 7, 2024
5114d44
test for restoring using cli string
Aug 7, 2024
ee450df
clippy
0o-de-lally Aug 7, 2024
9a10a7a
fmt
0o-de-lally Aug 7, 2024
511c6cc
patch storage tests
0o-de-lally Aug 7, 2024
1cb0de2
add transactions fixtures
Aug 8, 2024
18379aa
restore seems to work
Aug 8, 2024
3c88498
add transaction fixtures
Aug 8, 2024
fc75ab0
makefile
Aug 8, 2024
5f2d150
Merge branch 'main' into storage-cli
0o-de-lally Aug 8, 2024
f5a138c
init dbtool structs
Aug 8, 2024
1595794
builds
0o-de-lally Aug 9, 2024
0ef394a
tests use the hacky init
0o-de-lally Aug 9, 2024
22f0939
fmt
0o-de-lally Aug 9, 2024
5e3bdb1
restore_bundle, checks files in the restore dir
0o-de-lally Aug 9, 2024
782c55d
restore bundle default uses whatever file is in backup
0o-de-lally Aug 9, 2024
78411a0
helper to do a full restore
0o-de-lally Aug 9, 2024
d28d72d
fmt
0o-de-lally Aug 9, 2024
fc6abd7
creates cli entry point for epoch-restore
0o-de-lally Aug 9, 2024
f5a6e52
fmt
0o-de-lally Aug 9, 2024
43e7614
dbtool init scaffold
0o-de-lally Aug 9, 2024
b03eab9
tidy up some toml files
0o-de-lally Aug 9, 2024
9d25dc5
reconstruct backup controllers. builds
0o-de-lally Aug 9, 2024
47d81fb
transaction mode
0o-de-lally Aug 9, 2024
bdf2099
cleanup cargo.toml
0o-de-lally Aug 9, 2024
6ad3cfd
replace init_hack. remove deprecated tests
0o-de-lally Aug 9, 2024
25ef657
fmt
0o-de-lally Aug 9, 2024
8ded710
clippy
0o-de-lally Aug 9, 2024
56d4cce
clean up ui
0o-de-lally Aug 9, 2024
0065d21
patch fixture
0o-de-lally Aug 9, 2024
cf050df
create separate twin-test crate
0o-de-lally Aug 8, 2024
8042496
builds
0o-de-lally Aug 8, 2024
a5b2b40
fmt
0o-de-lally Aug 8, 2024
c318ba5
remove unused deps
0o-de-lally Aug 8, 2024
961dd9a
refactor twin cli
0o-de-lally Aug 11, 2024
3f14c7c
don't use diem proxy. Make sure you have the node built at correct lo…
0o-de-lally Aug 12, 2024
56e4f0f
backport libra-cli to have same api as diem-node, for use in smoketests
0o-de-lally Aug 12, 2024
f26b81e
remove diem-proxy
0o-de-lally Aug 12, 2024
bee3957
fmt
0o-de-lally Aug 12, 2024
baaeaf4
lmk swarm was successful
0o-de-lally Aug 12, 2024
f6bdc25
framework release to use runtime path not compile time
0o-de-lally Aug 12, 2024
26af3c5
clean
0o-de-lally Aug 12, 2024
f252300
deprecated tests
0o-de-lally Aug 12, 2024
4f18747
refactor e2e into methods
0o-de-lally Aug 12, 2024
4feaeee
transactions
0o-de-lally Aug 12, 2024
3d4575e
gmt
0o-de-lally Aug 12, 2024
f5f2de0
clippy
0o-de-lally Aug 12, 2024
a7c1a18
patch setup to use identity files
0o-de-lally Aug 12, 2024
1270a6d
sanity check twin with no-op db swap
0o-de-lally Aug 13, 2024
18a456e
fmt
0o-de-lally Aug 13, 2024
5003300
clippy
0o-de-lally Aug 13, 2024
d3bf96f
remove debug mode.
0o-de-lally Aug 13, 2024
2a340db
dialoguer for swarm
0o-de-lally Aug 13, 2024
539315f
refactoring api to allow noop tests
0o-de-lally Aug 13, 2024
a55c1d9
test that twin can start with dummy db
0o-de-lally Aug 13, 2024
be540af
fmt
0o-de-lally Aug 13, 2024
49ab258
add ci for twin
0o-de-lally Aug 13, 2024
a075bc4
refactor upgrade tests so we can plug in a Twin modified swarm
0o-de-lally Aug 13, 2024
c261182
start integrating Twin into upgrade tests
0o-de-lally Aug 13, 2024
9511d9a
fmt
0o-de-lally Aug 13, 2024
038f8de
save upgrade fixtures to repo, but force rebuild on ci
0o-de-lally Aug 13, 2024
1c028db
fucntion to load db
0o-de-lally Aug 13, 2024
1456c41
scaffold upgrade test from snapshot
0o-de-lally Aug 13, 2024
23c0a90
Merge branch 'main' into twin-from-snapshot
0o-de-lally Aug 13, 2024
28e80cb
framework build
0o-de-lally Aug 13, 2024
5b8c223
fmt
0o-de-lally Aug 13, 2024
05f08d1
get actual proposal_id from chain
0o-de-lally Aug 14, 2024
db3fc79
can run simple upgrade!
0o-de-lally Aug 14, 2024
3c4eabe
can run full upgrade test on a snapshot db
0o-de-lally Aug 14, 2024
a7e396d
clippy
0o-de-lally Aug 14, 2024
912b9b7
ignore tests that need setup
0o-de-lally Aug 14, 2024
5fa084f
remove twin functionality from rescue crate
0o-de-lally Aug 14, 2024
69f1c40
ignore e2e rescue tests
0o-de-lally Aug 14, 2024
7681af6
Merge branch 'main' into twin-from-snapshot
0o-de-lally Aug 14, 2024
98a19f9
Merge branch 'main' into twin-from-snapshot
0o-de-lally Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[env]
# set coin name for diem dependencies
RUST_DIEM_COIN_MODULE = "gas_coin"
RUST_DIEM_COIN_NAME = "LibraCoin"
RUST_DIEM_COIN_MODULE="libra_coin"
RUST_DIEM_COIN_NAME="LibraCoin"

[target.'cfg(target_os = "linux")']
# Dramatically increases the link performance for the eventbus
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ jobs:
run: |
echo "Main last commit has [breaking]: ${{ env.hasBreakingCommit }}"
- name: delete fixtures and force rebuild
working-directory: ./framework/src/upgrade_fixtures/fixtures
run: |
rm -rf upgrade-*
RUST_MIN_STACK=104857600 cargo t -- make_the_upgrade_fixtures --include-ignored
- name: upgrade - check workflow
if: always()
working-directory: ./upgrade-tests
Expand Down Expand Up @@ -289,3 +295,20 @@ jobs:
working-directory: ./tools/storage
# TODO: not testing the V6 file parsing
run: cargo test --no-fail-fast e2e_

twin-testsuite:
timeout-minutes: 60
needs: [build-framework]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup env
uses: ./.github/actions/build_env

- uses: Swatinem/[email protected]
with:
shared-key: "libra-framework"
cache-all-crates: true
- name: twin
working-directory: ./testsuites/twin
run: cargo test --no-fail-fast
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Cargo.lock
**/build
**/doc
**/framework_upgrade
# upgrade fixtures
**/framework/src/upgrade_fixtures/fixtures/upgrade*
# # upgrade fixtures
# **/framework/src/upgrade_fixtures/fixtures/upgrade*

sccache.log

Expand All @@ -28,4 +28,4 @@ diem/

# exclude move coverage
.coverage_map.mvcov
.trace
.trace
34 changes: 34 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"framework",
"framework/cached-packages",
"smoke-tests",
"testsuites/twin",
"tools/cli",
"tools/config",
"tools/genesis",
Expand Down Expand Up @@ -41,6 +42,7 @@ libra-rescue = { path = "tools/rescue" }
libra-storage = { path = "tools/storage" }
libra-smoke-tests = { path = "smoke-tests" }
libra-tower = { path = "tools/tower" }
libra-twin-tests = { path = "testsuites/twin" }
libra-types = { path = "types" }
libra-txs = { path = "tools/txs" }
libra-wallet = { path = "tools/wallet" }
Expand Down
5 changes: 0 additions & 5 deletions framework/libra-framework/sources/diem_governance.move
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,6 @@ module diem_framework::diem_governance {

// COMMIT NOTE: trigger_epoch() should now work on Stage as well.

// /// Return the voting power
// fun get_voting_power(_pool_address: address): u64 {
// 1
// }

#[view]
public fun get_next_governance_proposal_id():u64 {
voting::get_next_proposal_id<GovernanceProposal>(@diem_framework)
Expand Down
23 changes: 18 additions & 5 deletions framework/src/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use diem_framework::{
};
use move_command_line_common::address::NumericalAddress;
use once_cell::sync::Lazy;
use std::{collections::BTreeMap, fmt::Display, path::PathBuf, str::FromStr};
use std::{collections::BTreeMap, env, fmt::Display, path::PathBuf, str::FromStr};

use crate::BYTECODE_VERSION;

Expand Down Expand Up @@ -90,13 +90,26 @@ impl ReleaseTarget {
}

pub fn create_release_options(self, dev_mode: bool, out: Option<PathBuf>) -> ReleaseOptions {
let crate_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
// Get the path to source. If we are running tests in cargo we
// can assume cargo manifest dir.
// Otherwise we assume the tool is being run in the source path

let source_path = if let Ok(p) = env::var("CARGO_MANIFEST_DIR") {
println!("using Cargo project path: {}", &p);
PathBuf::from(p)
} else {
env::current_dir().expect("could not get local current_dir")
};

// let crate_dir = crate_dir.parent().unwrap().to_path_buf();
let packages = self
.packages()
.into_iter()
.map(|(path, binding_path)| {
(crate_dir.join(path), binding_path.unwrap_or("").to_owned())
(
source_path.join(path),
binding_path.unwrap_or("").to_owned(),
)
})
.collect::<Vec<_>>();
ReleaseOptions {
Expand Down Expand Up @@ -126,7 +139,7 @@ impl ReleaseTarget {
.into_iter()
.map(|(_, binding)| {
if !binding.is_empty() {
crate_dir.join(binding).display().to_string()
source_path.join(binding).display().to_string()
} else {
binding
}
Expand All @@ -136,7 +149,7 @@ impl ReleaseTarget {
path
} else {
// Place in release directory //////// 0L ////////
crate_dir.join("releases/head.mrb")
source_path.join("releases/head.mrb")
},
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = 'upgrade_scripts'
version = '1.0.0'
authors = []
license = ''

[addresses]

[dev-addresses]
[dependencies.LibraFramework]
local = '/Users/lucas/code/rust/libra-framework/framework/libra-framework'

[dev-dependencies]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b7ed52a7612abd9bd633cb8c2f307b1316c39454f6753d3f8fe40f4f2f8bbdf9
Loading
Loading