Testing Guide
This guide covers how to run OpenHCS integration tests with different configurations, including visualizers (Napari/Fiji) and OMERO backend testing.
VSCode Test Discovery
VSCode is configured to discover all test variants including visualizers and OMERO tests. This allows you to run specific test combinations without memorizing command-line arguments.
Available Test Variants
The test menu will show combinations of:
Microscopes:
ImageXpress,OperaPhenix,OMEROBackends:
disk,zarrData Types:
3d(default),2d(if enabled)Execution Modes:
multiprocessing(default),threading(if enabled)ZMQ Modes:
direct(default),zmq(if enabled)Visualizers:
none,napari,fiji,napari+fiji
Example test IDs you’ll see:
test_main[disk-ImageXpress-3d-multiprocessing-direct-none]
test_main[disk-ImageXpress-3d-multiprocessing-direct-napari]
test_main[disk-ImageXpress-3d-multiprocessing-direct-fiji]
test_main[disk-ImageXpress-3d-multiprocessing-direct-napari+fiji]
test_main[disk-OMERO-3d-multiprocessing-direct-none]
test_main[zarr-OperaPhenix-3d-multiprocessing-direct-napari]
CI Test Configuration
CI runs a subset of tests to keep build times reasonable:
Microscopes:
ImageXpress,OperaPhenix(OMERO excluded)Backends:
disk,zarrData Types:
3donlyExecution Modes:
multiprocessingonlyVisualizers:
noneonly (Napari/Fiji excluded)
This means Napari, Fiji, and OMERO tests are VSCode-only and won’t run in CI.
Command-Line Testing
Basic Test Execution
Run default tests (same as CI):
pytest tests/integration/test_main.py
Testing with Visualizers
Legacy flags (still supported):
pytest tests/integration/test_main.py --enable-napari
pytest tests/integration/test_main.py --enable-fiji
pytest tests/integration/test_main.py --enable-napari --enable-fiji
New parametrized approach (recommended):
# Test with Napari only
pytest tests/integration/test_main.py --it-visualizers=napari
# Test with Fiji only
pytest tests/integration/test_main.py --it-visualizers=fiji
# Test with both Napari and Fiji
pytest tests/integration/test_main.py --it-visualizers=napari+fiji
# Test with all visualizer combinations
pytest tests/integration/test_main.py --it-visualizers=none,napari,fiji,napari+fiji
Testing with OMERO
OMERO tests automatically start Docker and OMERO if needed - zero manual setup required!
Run OMERO tests (Docker + OMERO will auto-start if not running):
# Basic OMERO tests
pytest tests/integration/test_main.py --it-microscopes=OMERO
# OMERO tests with Napari
pytest tests/integration/test_main.py --it-microscopes=OMERO --it-visualizers=napari
What happens automatically:
Test checks if OMERO is running
If not, checks if Docker daemon is running
If Docker not running, automatically starts Docker daemon:
Linux: Uses
sudo systemctl start dockermacOS: Opens Docker Desktop application
Windows: Starts Docker Desktop application
Executes
docker-compose up -dto start OMEROWaits for OMERO to be ready (up to 120 seconds)
Runs the test
Leaves Docker and OMERO running for subsequent tests
Manual management (optional):
# Start Docker manually (Linux)
sudo systemctl start docker
# Start OMERO manually
cd openhcs/omero && docker-compose up -d
# Stop OMERO manually
docker-compose down
Testing Specific Combinations
# ImageXpress + disk backend + Napari
pytest tests/integration/test_main.py \
--it-microscopes=ImageXpress \
--it-backends=disk \
--it-visualizers=napari
# All microscopes + zarr backend + Fiji
pytest tests/integration/test_main.py \
--it-microscopes=ImageXpress,OperaPhenix,OMERO \
--it-backends=zarr \
--it-visualizers=fiji
# Full coverage (all combinations)
pytest tests/integration/test_main.py \
--it-microscopes=all \
--it-backends=all \
--it-dims=all \
--it-exec-mode=all \
--it-visualizers=all
Test Parameters Reference
--it-microscopes
Default:
ImageXpress,OperaPhenixOptions:
ImageXpress,OperaPhenix,OMERO,allExample:
--it-microscopes=ImageXpress,OMERO
--it-backends
Default:
disk,zarrOptions:
disk,zarr,allExample:
--it-backends=disk
--it-dims
Default:
3dOptions:
2d,3d,allExample:
--it-dims=all
--it-exec-mode
Default:
multiprocessingOptions:
threading,multiprocessing,allExample:
--it-exec-mode=all
--it-zmq-mode
Default:
directOptions:
direct,zmq,allExample:
--it-zmq-mode=zmq
--it-visualizers
Default:
noneOptions:
none,napari,fiji,napari+fiji,allExample:
--it-visualizers=napari,fiji
Environment Variables
You can set defaults using environment variables:
export IT_MICROSCOPES="ImageXpress,OMERO"
export IT_BACKENDS="disk"
export IT_VISUALIZERS="napari"
pytest tests/integration/test_main.py
Available environment variables:
IT_MICROSCOPESIT_BACKENDSIT_DIMSIT_EXEC_MODEIT_ZMQ_MODEIT_VISUALIZERS
VSCode Configuration
The .vscode/settings.json file configures test discovery:
{
"python.testing.pytestArgs": [
"tests",
"--it-microscopes=ImageXpress,OperaPhenix,OMERO",
"--it-backends=disk,zarr",
"--it-exec-mode=multiprocessing",
"--it-dims=3d",
"--it-zmq-mode=direct",
"--it-visualizers=none,napari,fiji,napari+fiji"
]
}
To customize VSCode test discovery, edit this file to include/exclude specific test variants.
Tips and Best Practices
Use VSCode test menu for quick access to specific test combinations
Use command-line for custom combinations not in VSCode menu
OMERO tests auto-start everything - Docker daemon + OMERO (zero manual setup)
Visualizer tests are interactive - they open viewer windows
CI only runs fast tests - Napari/Fiji/OMERO are VSCode-only
Legacy flags still work -
--enable-napariand--enable-fijiare supportedFirst OMERO test is slower - Docker + OMERO startup takes ~60-120 seconds
Docker Desktop on macOS/Windows - Auto-start opens the application (may require user interaction)
Troubleshooting
OMERO tests skipped
Error:
OMERO server not available and could not be started automatically
Possible causes:
Docker not installed: Install Docker and Docker Compose
Docker daemon failed to start: Check Docker installation
docker-compose.yml not found: Ensure
openhcs/omero/docker-compose.ymlexistsPermissions issue: Docker may require sudo on Linux (auto-start uses sudo)
Docker Desktop not installed (macOS/Windows): Install Docker Desktop
Solutions:
Check Docker installation:
docker --versionCheck Docker is running:
docker psCheck Docker Compose:
docker-compose --versionManually start Docker (Linux):
sudo systemctl start dockerManually start Docker Desktop (macOS): Open Docker Desktop application
Manually start OMERO:
cd openhcs/omero && docker-compose up -dCheck logs:
docker-compose logsinopenhcs/omero/
Napari/Fiji tests not showing in VSCode
Solution: Reload VSCode window or refresh test discovery
Too many test variants in VSCode
Solution: Edit .vscode/settings.json to reduce --it-visualizers options
CI running visualizer tests
Solution: CI configuration explicitly excludes visualizers - check .github/workflows/integration-tests.yml
See Also
Viewer Management Guide - Viewer lifecycle and configuration
Fiji Viewer Management - Fiji viewer lifecycle and configuration
OMERO Integration - OMERO backend integration guide