Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
92b4478
- Added the initial setup for ts-testing
evgeny-s Mar 6, 2026
31bb03e
- Fixed manual sealing for aura consensus
evgeny-s Mar 9, 2026
9dc9db6
- Added remove stake test
evgeny-s Mar 9, 2026
3a9421f
- Updated gigignore
evgeny-s Mar 9, 2026
e5209d3
Reverted fees change
evgeny-s Mar 11, 2026
a94b3ca
- fmt
evgeny-s Mar 11, 2026
e85979d
- docs
evgeny-s Mar 11, 2026
0815804
- Added CI, simulated current e2e setup
evgeny-s Mar 13, 2026
b6d1a6a
- fix CI
evgeny-s Mar 13, 2026
3d407f2
- Removed unused
evgeny-s Mar 13, 2026
506d025
- remove unused
evgeny-s Mar 13, 2026
d6b24fd
- Adapted add_stake test from e2e folder
evgeny-s Mar 13, 2026
34df60c
- Adapted add_stake test from e2e folder
evgeny-s Mar 16, 2026
e80e5ee
- Adapted shield tests from e2e folder
evgeny-s Mar 17, 2026
9bc6722
- Fixed warning
evgeny-s Mar 17, 2026
6e57589
Merge branch 'devnet-ready' into e2e-tests-moonwall
evgeny-s Mar 17, 2026
12915f1
- Added types generation as a part of zombienet script
evgeny-s Mar 17, 2026
00d3ba7
- make optional to prevent install failure
evgeny-s Mar 17, 2026
d9abd0b
- Fixed test for new alpha format
evgeny-s Mar 17, 2026
d05d906
- fixed arg
evgeny-s Mar 17, 2026
19c617e
- Replaced getStake function
evgeny-s Mar 17, 2026
7843ceb
- Improved transaction processing
evgeny-s Mar 17, 2026
9274d30
- Added runtime check
evgeny-s Mar 18, 2026
fd7f751
- fixed path
evgeny-s Mar 18, 2026
804932e
- Fixed pnpm version issue
evgeny-s Mar 18, 2026
18d0097
Merge branch 'devnet-ready' into e2e-tests-moonwall
evgeny-s Mar 19, 2026
845536d
- Revert papi instead of polkadotJS connector type.
evgeny-s Mar 19, 2026
b6085e1
Merge branch 'devnet-ready' into e2e-tests-moonwall
evgeny-s Mar 19, 2026
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
47 changes: 47 additions & 0 deletions .github/workflows/scheduled-smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Scheduled Smoke Tests

on:
schedule:
- cron: '0 */6 * * *'

env:
CARGO_TERM_COLOR: always

permissions:
contents: read

jobs:
run-smoke-tests:
runs-on: [self-hosted, type-ccx33]
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
include:
- test: smoke_mainnet
- test: smoke_testnet

name: "smoke-e2e-${{ matrix.test }}"

steps:
- name: Check-out repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ts-tests/.nvmrc

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Install e2e dependencies
working-directory: ts-tests
run: pnpm install --frozen-lockfile

- name: Run smoke test
working-directory: ts-tests
run: pnpm moonwall test ${{ matrix.test }}
155 changes: 155 additions & 0 deletions .github/workflows/typescript-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Typescript E2E Tests

on:
pull_request:

env:
CARGO_TERM_COLOR: always

permissions:
contents: read

jobs:
typescript-formatting:
runs-on: ubuntu-latest
steps:
- name: Check-out repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ts-tests/.nvmrc

- name: Install system dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler pkg-config

- name: Install e2e dependencies
working-directory: ts-tests
run: pnpm install --frozen-lockfile

- name: Formatting check
run: |
cd ts-tests
pnpm run fmt

# Build the node binary in both variants and share as artifacts.
build:
runs-on: [self-hosted, type-ccx33]
needs: [typescript-formatting]
timeout-minutes: 60
strategy:
matrix:
include:
- variant: release
flags: ""
- variant: fast
flags: "--features fast-runtime"
env:
RUST_BACKTRACE: full
steps:
- name: Check-out repository
uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler pkg-config

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Utilize Shared Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: e2e-${{ matrix.variant }}
cache-on-failure: true

- name: Build node-subtensor (${{ matrix.variant }})
run: cargo build --profile release ${{ matrix.flags }} -p node-subtensor

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: node-subtensor-${{ matrix.variant }}
path: target/release/node-subtensor
if-no-files-found: error

run-e2e-tests:
needs: [build]
runs-on: [self-hosted, type-ccx33]
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
include:
- test: dev
binary: release
- test: zombienet_shield
binary: release
- test: zombienet_staking
binary: fast

name: "typescript-e2e-${{ matrix.test }}"

steps:
- name: Check-out repository
uses: actions/checkout@v4

- name: Download release binary
uses: actions/download-artifact@v4
with:
name: node-subtensor-release
path: target/release

- name: Download fast binary
uses: actions/download-artifact@v4
with:
name: node-subtensor-fast
path: target/fast

- name: Make binaries executable
run: chmod +x target/release/node-subtensor target/fast/node-subtensor

# Replace binary to fast if needed
- name: Select binary for test
run: |
if [ "${{ matrix.binary }}" = "fast" ]; then
echo "Using FAST runtime binary"
cp target/fast/node-subtensor target/release/node-subtensor
else
echo "Using RELEASE runtime binary"
fi

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ts-tests/.nvmrc

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Install e2e dependencies
working-directory: ts-tests
run: pnpm install --frozen-lockfile

- name: Run tests
run: |
cd ts-tests
pnpm moonwall test ${{ matrix.test }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ by appending your own. A few useful ones are as follow.
```
-->

## Testing

Check [testing section](./docs/testing.md).

## License
The MIT License (MIT)
Copyright © 2021 Yuma Rao
Expand Down
39 changes: 39 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Testing

Typescript tests are run with [Moonwall](https://github.com/Moonsong-Labs/moonwall). To run these you will need to have pnpm installed:

```
# Use the correct Node version
nvm use

# Install moonwall
sudo npm i -g pnpm

# Change directory to test
cd ts-tests

# Install dependencies
pnpm i

# Run manual seal dev tests
pnpm moonwall test dev

# Run zombienet tests
pnpm moonwall test zombienet

# If you have MacOS, you might need to run zombinet test with sudo, because tmp folder
sudo pnpm moonwall test zombienet

# Run smoke tests
pnpm moonwall test smoke_mainnet
```

Moonwall lets you also run the testing environment without performing any tests on it, as a method for you to manually test certain things:

```
# Dev tests in run mode
pnpm moonwall run dev

# Zombinet test with run mode
pnpm moonwall run zombienet
```
7 changes: 5 additions & 2 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ fn run_manual_seal_authorship(
TIMESTAMP.with(|x| {
let mut x_ref = x.borrow_mut();
*x_ref = x_ref.saturating_add(subtensor_runtime_common::time::SLOT_DURATION);
inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, &*x.borrow())
inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, &*x_ref)
})
}

Expand All @@ -775,6 +775,9 @@ fn run_manual_seal_authorship(
let create_inherent_data_providers =
move |_, ()| async move { Ok(MockTimestampInherentDataProvider) };

let aura_data_provider =
sc_consensus_manual_seal::consensus::aura::AuraConsensusDataProvider::new(client.clone());

let manual_seal = match sealing {
Sealing::Manual => future::Either::Left(sc_consensus_manual_seal::run_manual_seal(
sc_consensus_manual_seal::ManualSealParams {
Expand All @@ -784,7 +787,7 @@ fn run_manual_seal_authorship(
pool: transaction_pool,
commands_stream,
select_chain,
consensus_data_provider: None,
consensus_data_provider: Some(Box::new(aura_data_provider)),
create_inherent_data_providers,
},
)),
Expand Down
4 changes: 4 additions & 0 deletions ts-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tmp
specs
html
.papi
1 change: 1 addition & 0 deletions ts-tests/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
60 changes: 60 additions & 0 deletions ts-tests/biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false,
},
"files": {
"ignoreUnknown": false,
"ignore": [
"**/html/**",
"**/build/**",
"**/target/**",
"**/scripts/tmp/**",
"**/node_modules/**",
"**/.yarn/**",
"test/tsconfig.json",
"tmp",
"**/tmp/",
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"lineWidth": 120,
"indentWidth": 4,
},
"organizeImports": {
"enabled": true,
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noShadowRestrictedNames": "off",
},
"correctness": {
"noUnusedImports": "error",
},
},
"ignore": [],
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always",
"trailingCommas": "es5",
},
},
"json": {
"formatter": {
"enabled": false,
},
"linter": {
"enabled": false,
},
},
}
Loading
Loading