@@ -26,52 +26,63 @@ By default it:
2626
2727- builds ` unittesting-local ` image from ` ./docker ` if missing
2828- mounts your repo as ` /project `
29+ - runs Python unit tests, syntax tests and syntax compatibility checks
2930- runs UnitTesting through the same CI shell entrypoints
3031- stores Sublime install/cache in docker volume ` unittesting-home `
3132- synchronizes only changed files into ` Packages/<Package> ` using ` rsync `
33+ - excludes files ignored by Git, including repository-local and global rules
3234
33- ## Manual docker usage
35+ A category with no matching resources is reported and succeeds. Disable
36+ categories that are not needed with:
3437
3538``` sh
36- # build from UnitTesting/docker
37- docker build -t unittesting-local .
39+ ut-run-tests . --no-unit-tests
40+ ut-run-tests . --no-syntax-tests
41+ ut-run-tests . --no-syntax-compatibility-checks
42+ ```
3843
39- # run from package root
40- docker run --rm -it \
41- -e PACKAGE=$PACKAGE \
42- -v $PWD :/project \
43- -v unittesting-home:/root \
44- unittesting-local run_tests
44+ ` --file ` selects its category automatically. Python files run as unit tests,
45+ files whose names start with ` syntax_test ` run as syntax tests, and
46+ ` .sublime-syntax ` files run compatibility checks:
47+
48+ ``` sh
49+ ut-run-tests . --file tests/test_example.py
50+ ut-run-tests . --file syntax_test_example
51+ ut-run-tests . --file Example.sublime-syntax
4552```
4653
54+ ` --pattern ` and ` --tests-dir ` try every enabled category. Use the
55+ ` --no-* ` options to avoid running unrelated categories when desired.
56+
4757## Fast reruns
4858
4959The container entrypoint writes a marker in ` /root/.cache/unittesting ` .
5060With ` -v unittesting-home:/root ` , bootstrap/install runs once and later runs
5161only refresh your package files and execute tests.
5262
53- ## Serialized runs
63+ ## Concurrent runs and races
5464
5565The shared cache volume contains the Sublime data directory, including
56- ` Packages ` , ` Lib ` , UnitTesting schedules and test output files. Concurrent
57- runs against the same volume are serialized by default to avoid races while
66+ ` Packages ` , ` Lib ` , UnitTesting schedules and test output files. * Concurrent
67+ runs against the same volume are serialized by default* to avoid races while
5868copying packages, writing schedules and syncing Package Control libraries.
69+ This is a speed-versus-space trade-off: tests are likely to run quickly,
70+ keeping wait times low, and a shared volume uses less disk space than
71+ multiple volumes.
5972
6073Use ` --lock-timeout SECONDS ` to control how long a runner waits for the cache
6174volume lock. Use ` --no-lock ` only if you know the selected cache volume is not
6275shared by another runner.
6376
64- ## Concurrent runs
65-
66- You can control concurrency by choosing how many cache volumes you use. The
67- default single volume serializes all runs. A stable volume per package allows
68- different packages to run concurrently while still keeping warm caches:
77+ You can increase concurrency by choosing how many cache volumes you use. For
78+ example, a stable volume per package allows different packages to run
79+ concurrently while still keeping warm caches:
6980
7081``` sh
7182ut-run-tests . --cache-volume unittesting-home-gitsavvy
7283```
7384
74- To maximize concurrency, use a stable volume per checkout directory. For
85+ To * maximize* concurrency, use a stable volume per checkout directory. For
7586example, in a POSIX shell:
7687
7788``` sh
@@ -120,7 +131,21 @@ Use `--color` to control ANSI colors in test output:
120131ut-run-tests . --color always
121132```
122133
123- ## Run a single test file
134+ ## Manual docker usage
135+
136+ ``` sh
137+ # build from UnitTesting/docker
138+ docker build -t unittesting-local .
139+
140+ # run from package root
141+ docker run --rm -it \
142+ -e PACKAGE=$PACKAGE \
143+ -v $PWD :/project \
144+ -v unittesting-home:/root \
145+ unittesting-local run_tests
146+ ```
147+
148+ Run a single test file
124149
125150``` sh
126151docker run --rm -it \
0 commit comments