agentleFS
genlayerlabsgenlayerlabs/genlayer-studio/.claude/skills/integration-tests/SKILL.md

integration-tests

Skill180 starsChanged 8 months agoMITView on GitHub

Setup Python virtual environment and run integration tests with gltest

  • Deletes or force-pushes
  • Installs packages

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-policy, tool-rename-deprecation and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenCortexIDESkill

    add-policy

    Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.

    Also in 4 projects that use this

  • gitpod-ioSkill

    tool-rename-deprecation

    Ensure renamed built-in tool references preserve backward compatibility. Use when renaming a toolReferenceName, tool set referenceName, or any tool identifier. Run on ANY change to tool registration code. Covers legacyToolReferenceFullNames for tools and legacyFullNames for tool sets.

    Also in 4 projects that use this

  • gitpod-ioSkill

    hygiene

    Use when making code changes to ensure they pass VS Code's hygiene checks. Covers the pre-commit hook, unicode restrictions, string quoting rules, copyright headers, indentation, formatting, ESLint, and stylelint. Run the hygiene check before declaring work complete.

    Also in 4 projects that use this

  • +1 more from gitpod-io

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for all services to be healthy before proceeding.

    line 25
  2. Very specific:

    Use -n 4 to run tests in parallel with 4 workers (pytest-xdist)

    line 84
  3. Very specific:

    Run test_validators.py separately after parallel tests complete

    line 86

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run Integration Tests

Setup the Python environment, start the studio, and run integration tests for GenLayer Studio.

Prerequisites

  • Python 3.12 installed
  • virtualenv installed (pip install virtualenv)
  • Docker and Docker Compose installed

Step 1: Start the Studio

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.

Step 2: Setup Virtual Environment (first time or reset)

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)"

Step 3: Run Integration Tests

# 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

Parallel Execution Notes

  • Use -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 state
  • Run test_validators.py separately after parallel tests complete

Quick Commands

Full Setup (first time)

# 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

Quick Run (after initial setup, studio already running)

source .venv/bin/activate && export PYTHONPATH="$(pwd)" && gltest --contracts-dir . tests/integration

Parallel Run (4 workers)

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

Fast Run (leader-only mode)

source .venv/bin/activate && export PYTHONPATH="$(pwd)" && gltest --contracts-dir . tests/integration --leader-only

Troubleshooting

Studio Not Running

# Check if containers are up
docker-compose ps

# Check container logs
docker-compose logs -f backend

Connection Refused Errors

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

Python 3.12 Not Found

# Check available Python versions
which python3.12

# On macOS with Homebrew
brew install python@3.12

gltest Command Not Found

# Make sure venv is activated
source .venv/bin/activate

# Reinstall test dependencies
pip install -r requirements.test.txt

Import Errors

# Ensure PYTHONPATH is set
export PYTHONPATH="$(pwd)"

# Verify from project root
pwd  # Should be genlayer-studio

Test Timeouts

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.