Skip to content

Local runner - round 3 - #296

Open
kaste wants to merge 12 commits into
SublimeText:masterfrom
kaste:local-runner
Open

Local runner - round 3#296
kaste wants to merge 12 commits into
SublimeText:masterfrom
kaste:local-runner

Conversation

@kaste

@kaste kaste commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This PR has three parts.

  • First three commits tell docker/rsync to not sync gitignored files.
    That is really a speed-up if you have temp files or a .venv directory
    in the package dir.

  • Then there are a couple of simple maintenance commits.

  • Then, the bigger feature, I teach the runner to run syntax tests.
    E.g. ut-run-tests . will now run unit tests, syntax tests, and syntax
    compatibility tests in one go, (--no-unit-tests --no-syntax-tests --no-syntax-compatibility-checks to tweak the default.) and the --file
    will work by our naming conventions

    ut-run-tests . --file tests/test_example.py
    ut-run-tests . --file syntax_test_example
    ut-run-tests . --file Example.sublime-syntax
    

In general, only docker/ and sbin/ files have been touched, but the syntax tests
need a small extension to unittesting/syntax.py:

  • By default, these commands failed loud ("red") if invoked and no tests could
    be found. (Unlike UnitTesting, which just says "0 tests run. OK.")
    This behavior can now be flipped by using the option fail_if_no_resources.

    Without that change we would need to duplicate the find_resources logic in
    the runner, so that it only invokes the actual tests if such resources can be
    found. That seemed like needless duplication.

  • We allow pattern and tests_dir for these commands now as well. This is
    to support file selection (--file).

Example

$ time ut-run-tests . --file syntax/test/syntax_test_blame.txt
Package root: C:\Users\kaste\AppData\Roaming\Sublime Text\Packages\GitSavvy
Package name: GitSavvy
Docker image: unittesting-local
Scheduler delay: 0ms
Cache volume: unittesting-home
Cache lock: enabled
Test categories: syntax-tests
Test target: syntax/test/syntax_test_blame.txt
Package sync: Git-ignored files excluded
PACKAGE = GitSavvy
Starting virtual X frame buffer: Xvfb.
Running command: copy_tested_package overwrite
sync package into sublime package directory
Running command: copy_tested_package overwrite
sync package into sublime package directory
Running command: run_test_categories --syntax-tests -- --color auto --tests-dir syntax/test --pattern syntax_test_blame.txt
Runtime:
  Sublime Text: Sublime Text Build 4200
  Package Control: 4.2.7
Schedule:
  package: GitSavvy
  coverage: None
  reload_package_on_testing: False
  pattern: syntax_test_blame.txt
  tests_dir: syntax/test
  fail_if_no_resources: False
  syntax_test: True
  output: /root/.config/sublime-text/Packages/User/UnitTesting/GitSavvy/result
Wait for syntax tests output....
=== SYNTAX TESTS OUTPUT ===
Success: 22 assertions in 1 file passed
OK

UnitTesting: Done.

real    0m3,618s
user    0m0,060s
sys     0m0,016s

kaste added 12 commits August 13, 2026 19:16
Build an exclude manifest from Git's standard ignore rules and pass it
to rsync when copying a package into the Docker test environment.

Retain the existing sync behavior outside Git repositories and for
callers that do not provide a manifest.
Move temporary-file cleanup into a context-managed manifest object and use
its optional path when constructing the Docker command.
Translate Git's ignored paths into rsync filter rules and include an
explicitly selected test file without copying its ignored siblings.
Report repeated --file options instead of silently using only the final
value.
Forward tests_dir and pattern through scheduled syntax runs and use them to
narrow syntax test and compatibility resources within the selected package.
Add an opt-in fail_if_no_resources setting while preserving the existing
failure behavior by default. Forward it through scheduled syntax runs.
Run unit tests, syntax tests and syntax compatibility checks by default.

For selected files (`--file`), naivly infer the category.

Allow categories to be disabled (the `--no-*` args) and coordinate
category runs through the shared CI scripts.
Let tests_dir and pattern constrain every enabled test category instead of
implicitly selecting unit tests.
Write selected categories to one schedule with distinct result files. Run
synchronous checks before potentially deferred unit tests, aggregate their
output and stop Sublime only after every category completes.

This removes repeated startup and shutdown costs from the default Docker
run while preserving standalone category behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant