Setup Python virtual environment and run integration tests with gltest
Setup the Python environment, start the studio, and run integration tests for GenLayer Studio.
pip install virtualenv)The studio must be running before executing integration tests.
# Stop any existing containers and rebuild
docker-compose down && docker-compose up --build
Wait for all services to be healthy before proceeding.
In a separate terminal:
# Remove existing venv if present
rm -rf .venv
# Create new venv with Python 3.12
virtualenv -p python3.12 .venv
# Activate
source .venv/bin/activate
# Upgrade pip
pip install --upgrade pip
# Install all dependencies
pip install -r requirements.txt
pip install -r requirements.test.txt
pip install -r backend/requirements.txt
# Set Python path
export PYTHONPATH="$(pwd)"
# Activate venv (if not already)
source .venv/bin/activate
export PYTHONPATH="$(pwd)"
# Run all integration tests (serial)
gltest --contracts-dir . tests/integration
# Run tests in parallel (4 workers) - excludes test_validators.py
gltest --contracts-dir . tests/integration -n 4 --ignore=tests/integration/test_validators.py
# Run validator CRUD tests separately (must run serially)
gltest --contracts-dir . tests/integration/test_validators.py
# Run faster with leader-only mode (skips validator consensus)
gltest --contracts-dir . tests/integration --leader-only
# Run specific test file
gltest --contracts-dir . tests/integration/test_specific.py
# Run with verbose output
gltest --contracts-dir . tests/integration -v
# Run specific test function
gltest --contracts-dir . tests/integration/test_file.py::test_function_name
-n 4 to run tests in parallel with 4 workers (pytest-xdist)test_validators.py must be excluded from parallel runs (--ignore) because it tests validator CRUD operations and needs exclusive access to the validator statetest_validators.py separately after parallel tests complete# Terminal 1: Start studio
docker-compose down && docker-compose up --build
# Terminal 2: Setup and run tests
rm -rf .venv && \
virtualenv -p python3.12 .venv && \
source .venv/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.txt && \
pip install -r requirements.test.txt && \
pip install -r backend/requirements.txt && \
export PYTHONPATH="$(pwd)" && \
gltest --contracts-dir . tests/integration
source .venv/bin/activate && export PYTHONPATH="$(pwd)" && gltest --contracts-dir . tests/integration
source .venv/bin/activate && export PYTHONPATH="$(pwd)" && \
gltest --contracts-dir . tests/integration -n 4 --ignore=tests/integration/test_validators.py && \
gltest --contracts-dir . tests/integration/test_validators.py
source .venv/bin/activate && export PYTHONPATH="$(pwd)" && gltest --contracts-dir . tests/integration --leader-only
# Check if containers are up
docker-compose ps
# Check container logs
docker-compose logs -f backend
The studio needs time to initialize. Wait for all services to be healthy:
# Watch container status
docker-compose ps
# Check backend health
curl http://localhost:4000/health
# Check available Python versions
which python3.12
# On macOS with Homebrew
brew install python@3.12
# Make sure venv is activated
source .venv/bin/activate
# Reinstall test dependencies
pip install -r requirements.test.txt
# Ensure PYTHONPATH is set
export PYTHONPATH="$(pwd)"
# Verify from project root
pwd # Should be genlayer-studio
Integration tests may timeout if the studio is under load. Try:
# Run with leader-only for faster execution
gltest --contracts-dir . tests/integration --leader-only
# Run a single test file to isolate issues
gltest --contracts-dir . tests/integration/test_specific.py -v
npx skills add genlayerlabs/integration-tests下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer