Back to list
genlayerlabs

test

by genlayerlabs

wasm-based VM for running Intelligent Contracts

15🍴 6📅 Jan 20, 2026

SKILL.md


name: test description: Runs tests for the GenVM project. Use after making code changes to verify correctness.

Running Tests

There are 3 main test suites in GenVM. Before running tests, ensure the project is built (see /build skill).

1. Python/Poetry Tests

Tests for the Python standard library (genlayer-py-std).

cd runners/genlayer-py-std && poetry install --with dev && poetry run pytest

Or with nix:

nix develop .#py-test --command bash -c 'cd runners/genlayer-py-std && poetry install --with dev && poetry run pytest'

Filter tests:

poetry run pytest -k "test_name_pattern"

2. Rust Tests (tests/rust.sh)

Runs cargo tests, AFL fuzzing, and collects coverage for all Rust crates.

nix develop .#rust-test --command bash tests/rust.sh

Options:

FlagDescription
--filter REGEXFilter which tests/fuzz targets to run
--fuzz-timeout SECSFuzzing duration (default: 30s)
--precompileRun precompile for genvm
--update-corpusUpdate fuzz corpus after fuzzing
--no-coverageSkip coverage collection

Examples:

# Run only tests matching "parser"
nix develop .#rust-test --command bash tests/rust.sh --filter 'parser'

# Skip fuzzing, only run unit tests
nix develop .#rust-test --command bash tests/rust.sh --filter '.*/tests'

# Run with longer fuzz timeout
nix develop .#rust-test --command bash tests/rust.sh --fuzz-timeout 120

Prerequisites: Requires ./configure.rb to have been run (done by build).

3. Integration Tests (tests/runner/run.py)

Python-based integration tests that run genvm with test cases.

Precompile (optional): If WASM files or WASM compilation process changed, run precompile first to save time:

./build/out/executor/vTEST/bin/genvm precompile

Then run the tests:

nix develop .#rust-test --command python3 ./tests/runner/run.py --start-manager --start-modules

Options:

FlagDescription
--filter REGEXFilter which test cases to run
--ciCI mode
--show-stepsShow detailed step output
--log-level LEVELSet log level (trace/debug/info/warning/error)
--no-sequentialRun tests in parallel
--manager URIUse existing manager instead of starting one

Examples:

# Run specific test
nix develop .#rust-test --command python3 ./tests/runner/run.py --start-manager --start-modules --filter 'test_name'

# With debug logging
nix develop .#rust-test --command python3 ./tests/runner/run.py --start-manager --start-modules --log-level debug

Webdriver Setup (for semi-stable/unstable runner tests)

Some tests require a Selenium webdriver. Start it before running those tests:

bash modules/webdriver/build-and-run.sh

This builds and runs a docker container with webdriver on port 4444. The container runs in detached mode.

Stop webdriver:

docker ps | grep 4444 | awk '{print $1}' | xargs docker stop

Quick Reference

What to testCommand
Python stdlibcd runners/genlayer-py-std && poetry run pytest
Rust unit tests onlynix develop .#rust-test --command bash tests/rust.sh --filter '.*/tests' --no-coverage
Precompile (if WASM changed)./build/out/executor/vTEST/bin/genvm precompile
Integration testsnix develop .#rust-test --command python3 ./tests/runner/run.py --start-manager --start-modules
All rust tests (CI)nix develop .#rust-test --command bash tests/rust.sh

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon