Skip to content

Conversation

@mavam
Copy link
Member

@mavam mavam commented Dec 2, 2025

This PR introduces a new way to automatically load packages.

Companion PR in docs: tenzir/docs#127

@mavam mavam force-pushed the feature/library-mode branch from 95391bf to 545c4e1 Compare December 2, 2025 23:50
mavam and others added 2 commits December 2, 2025 17:22
- Fix typo in example-library README (tests.yaml -> test.yaml)
- Add missing test.yaml entries to layout diagram
- Extract _deduplicate_package_dirs helper to reduce duplication
- Rename shadowed parameter in _set_cli_packages
- Add debug logging to _expand_package_dirs error path
- Fix Worker._run_suite to set TENZIR_PACKAGE_DIRS after deduplication

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Alainx277
Copy link

Thanks for the quick implementation, much appreciated.

The ability to pass multiple --package-dirs via CLI is great, so we're very much on board with this PR. I also like the utility of automatically discovering packages from an entire directory, which saves us some Bash shenanigans.

One situation where it didn't work quite correctly is when I ran uv run tenzir-test --root /package. The test client was not able to connect to the node and timed out. I suspected that this was because the root package directory was added multiple times:

◆ spawning tenzir-node: /opt/tenzir/bin/tenzir-node --bare-mode --console-verbosity=warning --state-directory=/package/.tenzir-test/tmp/tests-pipelines-aaa-add-packages-dgu6l_yt/tenzir-node-j_qki248/state --cache-directory=/package/.tenzir-test/tmp/tests-pipelines-aaa-add-packages-dgu6l_yt/tenzir-node-j_qki248/cache --endpoint=localhost:0 --print-endpoint --package-dirs=/package --package-dirs=/package,/package (cwd=/package/tests/pipelines)

After converting package_dirs into a set in the node fixture, the tests ran without issue. I think this slipped through the added test because it converts the arguments into a set, which removes the duplication before asserting.

If you could fix that remaining problem, the functionality would solve our use case and we're looking forward to it being merged. Thanks!

mavam and others added 2 commits December 3, 2025 09:02
The node fixture now extracts --package-dirs from config_args and
combines them with TENZIR_PACKAGE_ROOT and TENZIR_PACKAGE_DIRS,
deduplicating by resolved path. This prevents duplicate directories
from being passed to tenzir-node when running tests from a package
root directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mavam
Copy link
Member Author

mavam commented Dec 3, 2025

If you could fix that remaining problem, the functionality would solve our use case and we're looking forward to it being merged. Thanks!

Great to hear. I added the fix. Merging this now.

@mavam mavam merged commit c1a78ec into main Dec 3, 2025
6 checks passed
@mavam mavam deleted the feature/library-mode branch December 3, 2025 17:07
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.

3 participants