fix(test): restore the sendAckNak overrides broken by #10767 - #11626
Conversation
#10767 added a relaySource parameter to the RoutingModule::sendAckNak virtual, but the five test mocks that derive from RoutingModule still declared the six-parameter signature with `override`. Nothing overrides the new virtual, so all five suites fail to compile and the native test job has been red on develop since the merge: test/test_reliable_ack_matrix/test_main.cpp:167:10: error: 'void MockRoutingModule::sendAckNak(meshtastic_Routing_Error, NodeNum, PacketId, ChannelIndex, uint8_t, bool)' marked 'override', but does not override Widen the five mocks to the new signature. Also carry has_rx_rssi with rx_rssi in allocAckNak(). rx_rssi has explicit presence, so copying only the value left has_rx_rssi false and nanopb dropped the field at encode time - the phone never saw the relayer's RSSI that #10767 set out to deliver. Cover both: test_reliable_ack_matrix asserts the overheard rebroadcast is handed through as the relay source on the decodable path and the opaque #11502 ingress path, and that no other ACK/NAK claims a relayer; test_mesh_module drives a real RoutingModule and asserts the relay fields, has_rx_rssi included, survive all the way to the phone.
⚡ Try this PR in the Web FlasherNote Building this pull request… the flash button, badges and supported-board |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe ACK/NAK packet now copies the relay source RSSI presence flag. Mesh and reliable-ACK tests verify relay attribution and unset relay fields. Test routing overrides accept the updated method parameters. ChangesACK/NAK relay attribution
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
#10767 added a
relaySourceparameter to theRoutingModule::sendAckNakvirtual, but the five test mocks that derive fromRoutingModulestill declared the six-parameter signature withoverride. Nothing overrides the new virtual, so all five suites fail to compile andtest-native / Native PlatformIO Testshas been red on develop since the merge:The compile failure also cascaded: no suite emitted results, so the test-attribution gate reported 73 empty suites and lcov found no
.gcdafiles.What this does
Widens the five mocks to the new signature.
test_reliable_ack_matrix,test_mqtt,test_nexthop_routing,test_packet_signing,test_mesh_module.Carries
has_rx_rssiwithrx_rssiinallocAckNak().rx_rssihas explicit presence (see #11271); copying only the value lefthas_rx_rssifalse, so nanopb dropped the field at encode time and the phone never saw the relayer's RSSI that #10767 set out to deliver.relay_nodeandrx_snrare unconditional and were arriving fine.Adds the coverage that would have caught both.
test_reliable_ack_matrixnow asserts that the overheard rebroadcast is handed tosendAckNakas the relay source, with itsrelay_node/rx_rssi/rx_snrintact - on both the decodable path and the opaque#11502ingress short-circuit - and that a normal want-ack ACK claims no relayer.test_mesh_moduledrives a realRoutingModuleand asserts the relay fields survive all the way to the phone, includinghas_rx_rssi; a second test asserts an ack with no relay source reaches the phone with the relay fields clear.🤝 Attestations
has_rx_rssipresence flag)Summary by CodeRabbit
Bug Fixes
Tests