Skip to content

tests: extend coverage of lifecycle, LIN, CAN/Ethernet, CommandlineParser and wall clock coupling - #451

Open
KonradBreitsprecherBkd wants to merge 7 commits into
mainfrom
dev_test_uncovered_sections
Open

KonradBreitsprecherBkd wants to merge 7 commits into
mainfrom
dev_test_uncovered_sections

Conversation

@KonradBreitsprecherBkd

@KonradBreitsprecherBkd KonradBreitsprecherBkd commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Extend unit and integration tests for code sections the coverage job reported as uncovered. Areas that are about to be reworked (trace/replay config, participant config, dashboard) were left out.

Area New tests Line coverage
Lifecycle states ITest_Lifecycle (stop while paused), ITest_Abort (abort with pending async CommunicationReady), Test_LifecycleStates (drives the state machine directly: invalid/ignored transitions, restart, abort/stop chains, state names) 65% → 92%
LinController ignored receptions, ignored SetFrameResponse calls, slave response on master-Tx ID, GetSlaveConfiguration, handler removal 66% → 85%
CommandlineParser of the utils (not the demos) usage info, hidden arguments, PositionalList, accessors, parse errors 52% → 81%
CAN / Ethernet controllers network simulator joins/leaves → detailed/trivial switch, rejecting messages not from the network simulator, handler removal 65% → 82% / 78% → 94%
Wall clock coupling ITest_WallClockCoupling: coupled participant paces the simulation, lagging async completion catches up coupling thread, catch-up and lag paths fully covered

Instructions for review / testing

cmake --preset coverage && cmake --build --preset coverage
ctest --preset coverage -L 'unit|integration'
  • Before: 155 tests, total line coverage 63.0%.
    After: 158 tests, all pass; total line coverage 64.0%.

Please look closely at ITest_WallClockCoupling: it only asserts lower bounds of the elapsed wall clock time (a slow CI runner can only make a run longer), the upper bound is the 30 s harness timeout. It passed 40/40 runs with the CPU oversubscribed 2x (slowest run 0.7 s), and the pacing test fails as expected without coupling.

Blast radius: CI time (about +2 s), tests only.

Developer checklist (address before review)

  • Changelog.md updated
  • Prepared update for depending repositories
  • Documentation updated (public API changes only)
  • API docstrings updated (public API changes only)
  • Rebase → commit history clean
  • Squash and merge → proper PR title

Add integration tests for stopping a paused simulation and for aborting
while an async CommunicationReady handler is pending. Add unit tests that
drive LifecycleManagement directly for transitions the public API filters
out or that only occur in races (invalid/ignored transitions, restart,
abort during CommunicationInitializing, stop in error state, state names).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Add unit tests for ignored receptions (inactive, sleeping, invalid data
length, invalid ID), ignored SetFrameResponse calls, SendFrame with a
slave response on a master-transmitted ID, GetSlaveConfiguration, and
removal of GoToSleep, Wakeup, SlaveConfiguration and FrameHeader handlers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Add tests for PrintUsageInfo (hidden arguments skipped), parsing hidden
arguments, PositionalList, argument accessors, Get with unknown or
mismatched arguments, and parse errors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Add tests for switching between trivial and detailed simulation when a
network simulator joins or leaves, for rejecting messages that do not
come from the network simulator in detailed mode, and for removing
handlers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Check that a coupled participant paces the whole simulation and that a
lagging async step completion catches up without losing steps. Only
lower bounds of the elapsed wall clock time are asserted, which slow or
loaded CI runners cannot violate; upper bounds are left to the harness
timeout.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
@KonradBreitsprecherBkd
KonradBreitsprecherBkd marked this pull request as draft October 22, 2026 11:27
@KonradBreitsprecherBkd KonradBreitsprecherBkd added the status: ready for review Complete and waiting for a reviewer. label Oct 22, 2026
@KonradBreitsprecherBkd
KonradBreitsprecherBkd marked this pull request as ready for review October 22, 2026 11:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready for review Complete and waiting for a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant