用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/genlayerlabs/genlayer-studio --skill integration-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | integration-tests |
| description | 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