Use the launcher script:
# from UnitTesting repo root
./docker/ut-run-tests /path/to/package
./docker/ut-run-tests /path/to/package --file tests/test_example.pyOr call it via absolute path from any package directory:
/path/to/UnitTesting/docker/ut-run-tests .If this directory is on your PATH, you can run ut-run-tests directly.
The launcher calls docker/run_tests.py, builds/uses a local image,
mounts the package at /project, runs tests headlessly, and keeps a cache
volume for fast reruns.
By default it:
- builds
unittesting-localimage from./dockerif missing - mounts your repo as
/project - runs UnitTesting through the same CI shell entrypoints
- stores Sublime install/cache in docker volume
unittesting-home - synchronizes only changed files into
Packages/<Package>usingrsync
# build from UnitTesting/docker
docker build -t unittesting-local .
# run from package root
docker run --rm -it \
-e PACKAGE=$PACKAGE \
-v $PWD:/project \
-v unittesting-home:/root \
unittesting-local run_testsThe container entrypoint writes a marker in /root/.cache/unittesting.
With -v unittesting-home:/root, bootstrap/install runs once and later runs
only refresh your package files and execute tests.
Use launcher flags instead of calling docker manually:
--refresh-cache: recreateunittesting-homecache volume (forces fresh bootstrap, including Sublime Text/Package Control install path)--refresh-image: rebuild local image (for Dockerfile/entrypoint changes)--refresh: both--refresh-cacheand--refresh-image
Examples:
ut-run-tests . --refresh-image
ut-run-tests . --refresh-cache
ut-run-tests . --refreshUse --dry-run to print runner metadata (including detected Sublime
Text and Package Control versions) plus the generated schedule.
ut-run-tests . --dry-runUse --color to control ANSI colors in test output:
--color auto(default): color only when stdout is a TTY--color always: force color--color never: disable color
ut-run-tests . --color alwaysdocker run --rm -it \
-e PACKAGE=$PACKAGE \
-v $PWD:/project \
-v unittesting-home:/root \
unittesting-local run_tests --tests-dir tests --pattern test_example.py