Repository navigation
tests: extend coverage of lifecycle, LIN, CAN/Ethernet, CommandlineParser and wall clock coupling - #451
Open
KonradBreitsprecherBkd wants to merge 8 commits into
Open
tests: extend coverage of lifecycle, LIN, CAN/Ethernet, CommandlineParser and wall clock coupling#451KonradBreitsprecherBkd wants to merge 8 commits into
KonradBreitsprecherBkd wants to merge 8 commits into
Conversation
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
marked this pull request as draft
October 22, 2026 11:27
KonradBreitsprecherBkd
marked this pull request as ready for review
October 22, 2026 11:42
snps-fiodorov
requested review from
snps-alaa
and removed request for
snps-fiodorov
November 17, 2026 11:40
snps-alaa
reviewed
Nov 23, 2026
snps-alaa
left a comment
Collaborator
There was a problem hiding this comment.
Good to see the test coverage go up, the new tests target real gaps!
- LIN: configure an Rx response in the invalid data length test, so it fails without the length check; assert unchanged responses after invalid SetFrameResponse calls; cover removal of unknown FrameStatus handlers; mention warnings in comments - Lifecycle: verify entered state sequences for abort and stop in Error; check restart in every state - CAN/Ethernet: verify the fallback to the trivial simulation positively and rename the network simulator discovery tests - Abort: ensure every participant calls the abort handler exactly once - Wall clock coupling: cover timely async step completion Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
snps-alaa
approved these changes
Nov 30, 2026
snps-alaa
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me now. Thanks for addressing the review comments.
|
|
||
| // The local configuration is unchanged | ||
| EXPECT_EQ(slave1.GetThisLinNode().responses[17].responseMode, LinFrameResponseMode::TxUnconditional); | ||
| EXPECT_EQ(slave1.GetThisLinNode().responses[18].responseMode, LinFrameResponseMode::Unused); |
Collaborator
There was a problem hiding this comment.
The valid LIN ID range is implicitly assumed to be 0..63, would it make sense to use at(id)or assert before accessing to guard against out-of-range access?
Also, I think there are a few additional SetFrameResponse() combinations that could be worth covering:
- setting valid id + no mode --> defaulted to
LinFrameResponseMode::Unusedand verify that no update is distributed similar to any id not configured - setting valid id + no mode or
LinFrameResponseMode::Unused, thenSetFrameResponse()(verify it's ignored) then configure the mode withRxorTxUnconditional& callSetFrameResponse()again with the new mode has effect
This branch has not been deployed
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.
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.
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)LinControllerSetFrameResponsecalls, slave response on master-Tx ID,GetSlaveConfiguration, handler removalCommandlineParserof the utils (not the demos)PositionalList, accessors, parse errorsITest_WallClockCoupling: coupled participant paces the simulation, lagging async completion catches upInstructions for review / testing
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)