From 3404a5bcbae21fdf89942f83f521b8adae3c6220 Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Tue, 27 Aug 2024 12:35:58 -0400 Subject: [PATCH 1/3] fix benchmark_dissolve_network --- pallets/subtensor/src/benchmarks.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 4af039ad65..160474e794 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -312,7 +312,8 @@ benchmarks! { let amount_to_be_staked = 100_000_000_000_000u64; Subtensor::::add_balance_to_coldkey_account(&coldkey.clone(), amount_to_be_staked); assert_ok!(Subtensor::::register_network(RawOrigin::Signed(coldkey.clone()).into(), None)); - }: dissolve_network(RawOrigin::Signed(coldkey), 1) + let c1 = coldkey.clone(); + }: dissolve_network(RawOrigin::Signed(c1), coldkey, 1) // swap_hotkey { From 26bb8f6bac9e4e02908dc0ecd139a12466437134 Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Tue, 27 Aug 2024 12:54:41 -0400 Subject: [PATCH 2/3] fix test_user_ad_network_with_identify_fields_ok() --- pallets/subtensor/tests/root.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pallets/subtensor/tests/root.rs b/pallets/subtensor/tests/root.rs index 0c621739b7..e7e948ddc8 100644 --- a/pallets/subtensor/tests/root.rs +++ b/pallets/subtensor/tests/root.rs @@ -1052,10 +1052,7 @@ fn test_user_add_network_with_identity_fields_ok() { assert_eq!(stored_identity_2.subnet_contact, subnet_contact_2); // Now remove the first network. - assert_ok!(SubtensorModule::user_remove_network( - RuntimeOrigin::signed(coldkey_1), - 1 - )); + assert_ok!(SubtensorModule::user_remove_network(coldkey_1, 1)); // Verify that the first network and identity have been removed. assert!(SubnetIdentities::::get(1).is_none()); From 8176f57f70ffbadd97b0a895cd9c2ecebd5034aa Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Tue, 27 Aug 2024 14:31:31 -0400 Subject: [PATCH 3/3] simplify cargo test CI step, always check benchmarks + other feats --- .github/workflows/check-rust.yml | 53 ++------------------------------ 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/.github/workflows/check-rust.yml b/.github/workflows/check-rust.yml index 797ad4df45..b088744cb7 100644 --- a/.github/workflows/check-rust.yml +++ b/.github/workflows/check-rust.yml @@ -254,57 +254,8 @@ jobs: with: key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }} - - name: cargo test --workspace - run: cargo test --workspace - - # runs cargo test --workspace --features=runtime-benchmarks - cargo-test-benchmarks: - name: cargo test w/benchmarks - runs-on: SubtensorCI - strategy: - matrix: - rust-branch: - - stable - rust-target: - - x86_64-unknown-linux-gnu - # - x86_64-apple-darwin - os: - - ubuntu-latest - # - macos-latest - include: - - os: ubuntu-latest - # - os: macos-latest - env: - RELEASE_NAME: development - # RUSTFLAGS: -A warnings - RUSTV: ${{ matrix.rust-branch }} - RUST_BACKTRACE: full - RUST_BIN_DIR: target/${{ matrix.rust-target }} - SKIP_WASM_BUILD: 1 - TARGET: ${{ matrix.rust-target }} - steps: - - name: Check-out repository under $GITHUB_WORKSPACE - uses: actions/checkout@v4 - - - name: Install dependencies - run: | - sudo apt-get update && - sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler - - - name: Install Rust ${{ matrix.rust-branch }} - uses: actions-rs/toolchain@v1.0.6 - with: - toolchain: ${{ matrix.rust-branch }} - components: rustfmt, clippy - profile: minimal - - - name: Utilize Rust shared cached - uses: Swatinem/rust-cache@v2.2.1 - with: - key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }} - - - name: cargo test --workspace --features=runtime-benchmarks - run: cargo test --workspace --features=runtime-benchmarks + - name: cargo test --workspace --all-features + run: cargo test --workspace --all-features # ensures cargo fix has no trivial changes that can be applied cargo-fix: