-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
1,057 additions
and
700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ orbs: | |
# coveralls: coveralls/[email protected] | ||
|
||
jobs: | ||
black: | ||
ruff: | ||
resource_class: small | ||
parameters: | ||
python-version: | ||
|
@@ -18,29 +18,29 @@ jobs: | |
- checkout | ||
|
||
- restore_cache: | ||
name: Restore cached black venv | ||
name: Restore cached ruff venv | ||
keys: | ||
- v2-pypi-py-black-<< parameters.python-version >> | ||
- v2-pypi-py-ruff-<< parameters.python-version >> | ||
|
||
- run: | ||
name: Update & Activate black venv | ||
name: Update & Activate ruff venv | ||
command: | | ||
python -m venv env/ | ||
. env/bin/activate | ||
python -m venv .venv | ||
. .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install black==23.7.0 | ||
pip install ruff -c requirements/dev.txt | ||
- save_cache: | ||
name: Save cached black venv | ||
name: Save cached ruff venv | ||
paths: | ||
- "env/" | ||
key: v2-pypi-py-black-<< parameters.python-version >> | ||
- ".venv/" | ||
key: v2-pypi-py-ruff-<< parameters.python-version >> | ||
|
||
- run: | ||
name: Black format check | ||
name: Ruff format check | ||
command: | | ||
. env/bin/activate | ||
python -m black --exclude '(env|venv|.eggs)' --check . | ||
. .venv/bin/activate | ||
ruff format --diff . | ||
check_compatibility: | ||
parameters: | ||
|
@@ -85,8 +85,8 @@ jobs: | |
- run: | ||
name: Update & Activate venv | ||
command: | | ||
python -m venv env/ | ||
. env/bin/activate | ||
python -m venv .venv | ||
. .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install '.[dev]' | ||
|
@@ -99,20 +99,20 @@ jobs: | |
- run: | ||
name: Install Bittensor | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
pip install -e '.[dev]' | ||
- run: | ||
name: Instantiate Mock Wallet | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
./scripts/create_wallet.sh | ||
# TODO: Update test durations on different runs | ||
- run: | ||
name: Unit Tests | ||
no_output_timeout: 20m | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
export PYTHONUNBUFFERED=1 | ||
pytest -n2 --reruns 3 --durations=0 --verbose --junitxml=test-results/unit_tests.xml \ | ||
--cov=. --cov-append --cov-config .coveragerc \ | ||
|
@@ -122,8 +122,9 @@ jobs: | |
- run: | ||
name: Integration Tests | ||
no_output_timeout: 30m | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
export PYTHONUNBUFFERED=1 | ||
pytest -n2 --reruns 3 --reruns-delay 15 --durations=0 --verbose --junitxml=test-results/integration_tests.xml \ | ||
--cov=. --cov-append --cov-config .coveragerc \ | ||
|
@@ -143,7 +144,7 @@ jobs: | |
#- run: | ||
#name: Upload Coverage | ||
#command: | | ||
#. env/bin/activate && coveralls | ||
#. .venv/bin/activate && coveralls | ||
#env: | ||
#CI_NAME: circleci | ||
#CI_BUILD_NUMBER: $CIRCLE_BUILD_NUM | ||
|
@@ -173,8 +174,8 @@ jobs: | |
- run: | ||
name: Update & Activate venv | ||
command: | | ||
python -m venv env/ | ||
. env/bin/activate | ||
python -m venv .venv | ||
. .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install '.[dev]' | ||
pip install flake8 | ||
|
@@ -188,19 +189,19 @@ jobs: | |
- run: | ||
name: Install Bittensor | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
pip install -e '.[dev]' | ||
- run: | ||
name: Lint with flake8 | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
python -m flake8 bittensor/ --count | ||
- run: | ||
name: Type check with mypy | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
python -m mypy --ignore-missing-imports bittensor/ | ||
unit-tests-all-python-versions: | ||
|
@@ -290,7 +291,7 @@ workflows: | |
|
||
pr-requirements: | ||
jobs: | ||
- black: | ||
- ruff: | ||
python-version: "3.9.13" | ||
- build-and-test: | ||
matrix: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "" | ||
file: "requirements/prod.txt" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 0 # Only security updates will be opened as PRs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: E2E Subtensor Tests | ||
|
||
concurrency: | ||
group: e2e-subtensor-${{ 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: Add wasm32-unknown-unknown target | ||
run: | | ||
rustup target add wasm32-unknown-unknown --toolchain stable-x86_64-unknown-linux-gnu | ||
rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu | ||
- name: Clone subtensor repo | ||
run: git clone https://github.com/opentensor/subtensor.git | ||
|
||
- name: Setup subtensor repo | ||
working-directory: ${{ github.workspace }}/subtensor | ||
run: git checkout testnet | ||
|
||
- name: Run tests | ||
run: | | ||
python3 -m pip install -e .[dev] pytest | ||
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest tests/e2e_tests/ -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.