Repository navigation
feat: add ltest verb and CI-friendly output - #5
Merged
Merged
Conversation
Add `colcon ltest` (alias `lt`): colcon test with the live per-package board, a readable summary built from JUnit (tests/failures/errors/skipped, failing test cases with messages, JUnit locations), a non-zero exit on any failure, an isolated ROS_DOMAIN_ID per run (on by default), and options --no-isolated-domain, --no-user-site, --fail-on-skip PATTERN, --retest-failed. Add CI mode to lbuild and ltest: used when stdout is not a TTY, with --ci, or when CI/GITHUB_ACTIONS is set. It prints a stable per-package log, GitHub Actions groups and ::error annotations, and writes a Markdown summary to $GITHUB_STEP_SUMMARY. Terminal output of lbuild/lclean is unchanged. Unregistered CI handlers fall back to the live board, so a shadowing installation can no longer make --event-handlers fail with a KeyError. Add pytest tests under test/ and run them in CI. Bump to 0.2.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CI mode is driven only by --ci and CI/GITHUB_ACTIONS. A non-TTY stdout no longer switches lbuild/ltest to the CI log, so piped `colcon lb` output matches 0.1.1 (pinned by a test and checked against 0.1.1). - ltest: a run with zero test cases warns; in CI mode it exits non-zero unless --allow-no-tests is given. Selected packages without results are reported. - --isolated-domain picks from 1..101 (not 0, and not above 101 where the DDS ports reach the Linux ephemeral range) and skips the current ROS_DOMAIN_ID. - New event handler entry points are prefixed live_tools_ (live_status is kept): live_tools_test_status, live_tools_ci_status, live_tools_ci_test_status, live_tools_test_recorder. - Test-run CI group titles say "done" or "FAIL" instead of "OK". - test_ltest.py works when colcon-package-selection is installed. - CHANGELOG and README updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…age-selection Also document --allow-no-tests for workspaces whose tests write no JUnit XML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
colcon ltest(aliascolcon lt):colcon testwith the same live per-package board aslbuild, a readable JUnit-based summary (tests/failures/errors/skipped per package, failing test cases with messages, JUnit locations), a non-zero exit on any failure, and an isolatedROS_DOMAIN_IDper run.ltestoptions:--isolated-domain(default on;--no-isolated-domain),--no-user-site,--fail-on-skip PATTERN,--retest-failed,--ci. Allcolcon testarguments still work.lbuildandltest: used when stdout is not a TTY, with--ci, or whenCI/GITHUB_ACTIONSis set. Prints a stable per-package log; on GitHub Actions uses::group::,::errorannotations, and writes a Markdown summary to$GITHUB_STEP_SUMMARY.lbuildandlcleanis unchanged.KeyErrorfrom--event-handlers.ltand CI mode with a GitHub Actions example.Design decisions
--no-isolated-domainif a test must reach other machines.--no-user-sitescope. It setsPYTHONNOUSERSITE=1for the whole test run, so every Python child process is affected, not only pytest. Narrowing it to pytest alone is not possible through colcon. Documented in README.ltestkeeps colcon test's default parallelism (notlbuild's unlimited).Testing
pytest test/: 39 tests covering the JUnit summary, CI detection, workflow command escaping, step summary, fail-on-skip, domain isolation, the CI log handler, and theltestverb. Added as a step inci.yml.python -m buildandtwine check dist/*pass.ce-curve,oedo_config_paths):colcon lbandcolcon ltboth finish with exit 0, in terminal (pty) and withCI=1.ce-curve,oedo_response_curve):colcon ltran 147 tests (18 skipped), all passed, JUnit summary printed.🤖 Generated with Claude Code