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

Test Emissions E2E #2036

Merged
merged 31 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3fdc2ed
Test emissions
Jun 17, 2024
61c6074
Test emissions e2e
Jun 18, 2024
b255de7
Merge branch 'staging' into feature/opendansor/test_emissions
Jun 18, 2024
00b2365
Update e2e-subtensor-tests.yaml
Jun 18, 2024
9a26626
Update e2e-subtensor-tests.yaml
Jun 18, 2024
2926a6b
Test emissions
Jun 17, 2024
a8087b2
Test emissions e2e
Jun 18, 2024
b865b1b
Update e2e-subtensor-tests.yaml
Jun 18, 2024
be457bb
Update e2e-subtensor-tests.yaml
Jun 18, 2024
56c0241
Merge remote-tracking branch 'origin/feature/opendansor/test_emission…
Jun 18, 2024
8b3b65e
Add delay to setting weights .
Jun 18, 2024
6d2cf6d
Merge branch 'staging' into feature/opendansor/test_emissions
Jun 20, 2024
2e70603
Allow test to pass
Jun 21, 2024
5c38137
Merge branch 'staging' into feature/opendansor/test_emissions
Jun 21, 2024
6d93fe7
Allow test to pass
Jun 21, 2024
22f968f
Merge branch 'staging' into feature/opendansor/test_emissions
Jun 21, 2024
4808274
Rename wait_epoch to wait_interval,
Jun 24, 2024
bdc968b
test passing locally
Jun 24, 2024
9b92c29
Merge branch 'staging' into feature/opendansor/test_emissions
Jun 24, 2024
1b483cb
Testing: Tempirarily increased time
ibraheem-opentensor Jun 25, 2024
1eb7d5e
add wait for inclusion and finalization flags
Jun 25, 2024
fac4a4d
Merge branch 'staging' into feature/opendansor/test_emissions
Jun 25, 2024
bcd1380
Attempt to parallelize the e2e jobs.
Jun 25, 2024
b0a33eb
Update to use github env files.
Jun 25, 2024
b0212e0
Update github workflow.
Jun 25, 2024
938f8bc
Update faucet.
Jun 25, 2024
4e4e388
Update to have 10 tests run in parallel.
Jun 25, 2024
69d9196
Update to have 5 tests run in parallel with retry
Jun 25, 2024
eca3e8e
Update to have 8 tests run in parallel with retry
Jun 25, 2024
371dde4
Unite swap hotkey tests into one.
Jun 26, 2024
7e7b7ed
Merge branch 'staging' into feature/opendansor/test_emissions
Jun 26, 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
43 changes: 30 additions & 13 deletions .github/workflows/e2e-subtensor-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ concurrency:
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:
Expand All @@ -26,24 +20,40 @@ on:

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

jobs:
# Job to find all test files
find-tests:
runs-on: ubuntu-latest
outputs:
test-files: ${{ steps.get-tests.outputs.test-files }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Find test files
id: get-tests
run: |
test_files=$(find tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "::set-output name=test-files::$test_files"
shell: bash

# Job to run tests in parallel
run:
needs: find-tests
runs-on: SubtensorCI
strategy:
fail-fast: false # Allow other matrix jobs to run even if this job fails
max-parallel: 8 # Set the maximum number of parallel jobs
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
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
Expand Down Expand Up @@ -81,4 +91,11 @@ jobs:
- 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
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest ${{ matrix.test-file }} -s

- name: Retry failed tests
if: failure()
run: |
sleep 10
python3 -m pip install -e .[dev] pytest
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest ${{ matrix.test-file }} -s
4 changes: 2 additions & 2 deletions tests/e2e_tests/multistep/test_axon.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from tests.e2e_tests.utils import (
setup_wallet,
template_path,
repo_name,
templates_repo,
write_output_log_to_file,
)

Expand Down Expand Up @@ -67,7 +67,7 @@ async def test_axon(local_chain):
cmd = " ".join(
[
f"{sys.executable}",
f'"{template_path}{repo_name}/neurons/miner.py"',
f'"{template_path}{templates_repo}/neurons/miner.py"',
"--no_prompt",
"--netuid",
"1",
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e_tests/multistep/test_dendrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from tests.e2e_tests.utils import (
setup_wallet,
template_path,
repo_name,
wait_epoch,
templates_repo,
wait_interval,
write_output_log_to_file,
)

Expand Down Expand Up @@ -95,7 +95,7 @@ async def test_dendrite(local_chain):
cmd = " ".join(
[
f"{sys.executable}",
f'"{template_path}{repo_name}/neurons/validator.py"',
f'"{template_path}{templates_repo}/neurons/validator.py"',
"--no_prompt",
"--netuid",
"1",
Expand Down Expand Up @@ -157,7 +157,7 @@ async def test_dendrite(local_chain):
],
)
# get current block, wait until 360 blocks pass (subnet tempo)
wait_epoch(360, subtensor)
wait_interval(360, subtensor)

# refresh metagraph
metagraph = bittensor.metagraph(netuid=1, network="ws://localhost:9945")
Expand Down
Loading
Loading