Testing Guideο
Tiered testing approach for different development phases and resources.
Quick Commandsο
Development (Python-only)ο
make test-dev # Fast marker-based tests (~15s) for iteration
make test # Full pytest run on host (may include skips)
make lint # Ruff + mypy checks (~5s)
make format # Auto-format & autofix style issues
make check # format + test-dev (mutating quick gate)
Note:
make checkrunsmake formatfirst, so it will modify files to enforce style before executing tests.
Docker (Full environment)ο
make docker-build # Build Docker image
make docker-build-test # and test
make docker-shell # Interactive debugging
Test Categories by Tierο
Target |
Purpose |
Time |
Scope |
Resources |
|---|---|---|---|---|
|
Fast development iteration (pytest |
~15s |
Fastest unit-style set |
Minimal |
|
CI/CD smoke with coverage |
~40s |
|
Low |
|
Host + container validation with combined coverage |
~60s |
dev+ci+release markers |
Medium |
|
Full pytest run (allows skips/failures) |
60s+ |
Entire suite on host |
Medium |
|
Host tests needing Docker daemon |
~45s |
|
Medium |
|
Network-access-required subset |
~30s |
|
Low |
|
Nextflow-specific subset |
~45s |
|
Medium |
|
Container-only tests ( |
~60s |
tests/container suite |
High |
Local Development Testingο
1. Initial Setup (Required - Run Once)ο
# Install all development dependencies
make dev
# Expected: 60-120 seconds, installs deps + pre-commit hooks
# β
Success indicator: "Ready for development!"
2. Fast Iteration Cycleο
# Fastest validation (recommended for active development)
make test-dev
# Expected: ~15 seconds, 30 tests
# β
Success: All tests pass, no Docker required
3. Code Quality Checksο
# Quick linting (fast)
make lint
# Expected: ~5 seconds
# Tools: ruff check, ruff format --check, mypy
# Auto-fix linting issues
make format
# Expected: ~5-10 seconds, auto-fixes code style issues
# Combined quality + fast tests
make check
# Expected: ~40 seconds, runs format + lint + test-dev
4. Pre-Commit Validationο
# Run CI-tier tests (quick smoke tests for CI/CD)
make test-ci
# Expected: ~40 seconds
# Includes smoke tests with coverage reports
# Full release validation
make test-release
# Expected: ~60 seconds, includes all tests with coverage
# Note: Some tests may require Docker or network access
# Full local test suite (all tests, may have skips/failures)
make test
# Expected: 60+ seconds, includes all test categories
# Note: Some Docker integration tests may skip without Docker setup
Docker Testing (Comprehensive Validation)ο
Prerequisitesο
Docker installed and running
4GB+ RAM available to Docker
Image built with:
make docker-build
1. Build Docker Imageο
make docker-build
# Expected: ~15-20 minutes first time, creates sirnaforge:latest
# β
Success: "Docker image: sirnaforge:latest"
# Image size: ~2.5GB (includes all bioinformatics tools)
2. Run Tests in Containerο
# Run tests INSIDE Docker container (validates image setup)
make docker-test
# Expected: ~60 seconds
# Tests all container-based functionality
# β
Success: All tests pass, verifying Docker environment
# Enter interactive shell for debugging
make docker-shell
# Expected: Interactive bash prompt inside container
# Useful for: Debugging, manual testing, tool validation
3. Manual Docker Verificationο
Basic Functionalityο
# Version check
docker run --rm sirnaforge:latest sirnaforge version
# Expected output: Version information
# Help system
docker run --rm sirnaforge:latest sirnaforge --help
docker run --rm sirnaforge:latest sirnaforge design --help
Workflow Testingο
# Test with sample data
docker run --rm -v $(pwd)/examples:/data sirnaforge:latest \
sirnaforge design /data/sample_transcripts.fasta \
-o /tmp/results.csv --top-n 5
# Expected: Results file created with siRNA candidates
Best Practicesο
Development Workflowο
Setup once:
make devFast iteration:
make test-devafter changesQuality check:
make lintbefore commitsPre-commit:
make checkbefore pushingValidation:
make test-releasebefore releases
Resource Managementο
Local development: Use
test-devfor iteration andtestbefore commitsCI/CD: Use
test-ciwith artifactsRelease validation: Use
test-releasewith full coverageQuick validation: Use
make checkfor lint + fast tests
Timeouts and Expectationsο
Never cancel
uv sync --dev(can take 60-120s first time)Docker builds take ~15-20 minutes first time, much faster subsequently
Unit tests should complete in ~30 seconds
Fast tests should complete in ~15 seconds
CI tests may take 40+ seconds but generate proper artifacts
Quick Health Checksο
# Local installation verification
uv run sirnaforge version
uv run sirnaforge design examples/sample_transcripts.fasta -o /tmp/test.csv
# Docker environment verification
docker run --rm sirnaforge:latest sirnaforge version
π For Docker operations and deployment: See the Docker documentation in the docker/ directory
This guide focuses on testing workflows across development phases and CI/CD environments.