Skip to content

Commit

Permalink
Merge pull request #434 from opentensor/feat/e2e-bittensor-tests
Browse files Browse the repository at this point in the history
feat: e2e bittensor tests
  • Loading branch information
distributedstatemachine authored May 19, 2024
2 parents d5d20a3 + 14b1682 commit 2e073f8
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
name: Check Rust

concurrency:
group: ci-${{ github.ref }}
group: check-rust-${{ github.ref }}
cancel-in-progress: true

on:
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/e2e-bittensor-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: E2E Bittensor Tests

concurrency:
group: e2e-bittensor-${{ github.ref }}
cancel-in-progress: true

on:
## Run automatically for all PRs against main, regardless of what the changes are
## to be safe and so we can more easily force re-run the CI when github is being
## weird by using a blank commit
push:
branches: [main, development, staging]

##
# Run automatically for PRs against default/main branch if Rust files change
pull_request:
branches: [main, development, staging]

## Allow running workflow manually from the Actions tab
workflow_dispatch:
inputs:
verbose:
description: "Output more information when triggered manually"
required: false
default: ""

env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.events.input.verbose }}

jobs:
run:
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
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
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- 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/[email protected]
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt
profile: minimal

- name: Clone bittensor repo
run: git clone https://github.com/opentensor/bittensor.git

- name: Setup bittensor repo
working-directory: ${{ github.workspace }}/bittensor
run: |
git checkout tests/e2e-tests-staging
python3 -m pip install -e .
python3 -m pip install torch
- name: Run tests
working-directory: ${{ github.workspace }}/bittensor
run: |
pwd
ls
LOCALNET_SH_PATH="../scripts/localnet.sh" pytest tests/e2e_tests/ -s
12 changes: 6 additions & 6 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,27 +371,27 @@ fn localnet_genesis(
let mut balances = vec![
(
get_account_id_from_seed::<sr25519::Public>("Alice"),
1000000000000u128,
1000000000000000u128,
),
(
get_account_id_from_seed::<sr25519::Public>("Bob"),
1000000000000u128,
1000000000000000u128,
),
(
get_account_id_from_seed::<sr25519::Public>("Charlie"),
1000000000000u128,
1000000000000000u128,
),
(
get_account_id_from_seed::<sr25519::Public>("Dave"),
2000000000u128,
2000000000000u128,
),
(
get_account_id_from_seed::<sr25519::Public>("Eve"),
2000000000u128,
2000000000000u128,
),
(
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
2000000000u128,
2000000000000u128,
),
];

Expand Down

0 comments on commit 2e073f8

Please sign in to comment.