Add unit tests for untested modules#1185
Conversation
9ccd37c to
61bdd7a
Compare
There was a problem hiding this comment.
Pull request overview
Adds a broad set of new unit/integration tests to close previously identified coverage gaps across protocols, utilities, interfaces, PyDM imports, and C++ packetizer CRC functionality.
Changes:
- Add new pytest-based tests for SRP (v0 + Cmd), PRBS utilities/devices, stream interfaces (FIFO device, stream variable), TCP bridge, RSSI, Packetizer V1, HLS RegInterfParser, and conditional smoke imports (GPIB / hardware / PyDM).
- Add new C++ doctest coverage for
rogue/protocols/packetizer/CRC.hand wire it into the CMake test build. - Extend
tests/cppCMake structure to include the new protocols/packetizer test directory.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utilities/test_reg_interf_parser.py | Tests HLS RegInterfParser parsing and error exits using temp zip/header inputs. |
| tests/utilities/test_prbs_devices.py | Exercises PyRogue PRBS device trees and basic loopback behavior. |
| tests/utilities/test_prbs.py | Tests rogue.utilities.Prbs generation/checking, widths, counters, and enable/disable API. |
| tests/protocols/test_srpv0.py | Adds SRPv0 end-to-end tests using a Python responder to emulate hardware. |
| tests/protocols/test_srp_cmd.py | Validates SRP Cmd frame size and content. |
| tests/protocols/test_gpib.py | Conditional import/skip smoke tests for optional GPIB dependencies. |
| tests/interfaces/test_zmq_client.py | Adds (currently skipped) ZmqClient API tests and a local ZmqServer setup helper. |
| tests/interfaces/test_stream_variable.py | Tests YAML streaming behavior of pyrogue.interfaces.stream.Variable. |
| tests/interfaces/test_stream_fifo_device.py | Tests PyRogue stream Fifo device variables and stream flow. |
| tests/interfaces/test_pydm_tools_widgets_smoke.py | Conditional import smoke tests for PyDM/Qt tools/widgets. |
| tests/interfaces/test_hardware_imports.py | Conditional import smoke tests for rogue.hardware on supported platforms. |
| tests/interfaces/test_axi_stream_dma_mon.py | Tests DMA monitor device variables using a mock DMA object (conditional import). |
| tests/integration/test_stream_tcp_bridge.py | Adds integration tests for TcpServer/TcpClient frame delivery and ordering. |
| tests/integration/test_rssi_loopback.py | Adds RSSI handshake/data transfer/invariants integration checks over UDP. |
| tests/integration/test_packetizer_v1.py | Adds integration tests for packetizer v1 routing and fragmentation. |
| tests/cpp/protocols/packetizer/test_crc.cpp | Adds doctest coverage for CRC check vectors and incremental/table modes. |
| tests/cpp/protocols/packetizer/CMakeLists.txt | Registers the new CRC C++ test target. |
| tests/cpp/protocols/CMakeLists.txt | Adds protocols subtree to C++ tests. |
| tests/cpp/CMakeLists.txt | Includes protocols subtree in overall C++ test build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add comprehensive test coverage for protocols (GPIB, SRP, Packetizer, RSSI), interfaces (ZMQ, PyDM, StreamFifo, AxiStreamDma, StreamVariable), utilities (PRBS, register interface parser), and integration tests (TCP bridge, Packetizer v1). Includes C++ CRC unit test, improved conftest fixtures for port isolation, and test hardening for CI.
02daab3 to
d314717
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pre-release #1185 +/- ##
===============================================
+ Coverage 56.05% 58.97% +2.92%
===============================================
Files 70 72 +2
Lines 8137 8168 +31
Branches 1209 1209
===============================================
+ Hits 4561 4817 +256
+ Misses 3293 3059 -234
- Partials 283 292 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
CRC.hcheck vectors)Modules now covered
Protocols: SrpV0, SRP Cmd, Packetizer CRC (C++), Packetizer V1 Core, RSSI Client+Server, GPIB (conditional)
Utilities: PRBS generator/checker, PrbsRx/PrbsTx/PrbsPair devices, HLS RegInterfParser
Interfaces: Stream TCP bridge, Stream Fifo device, Stream Variable, ZmqClient (skipped), AxiStreamDmaMon (mock), hardware module imports
PyDM: Smoke-import all 18 tools/widgets (conditional skip when Qt unavailable)
Test plan
./scripts/run_linters.shclean (flake8 on new files)cmake -S . -B build -DROGUE_INSTALL=local -DROGUE_BUILD_TESTS=ON && cmake --build build -j && cmake --build build --target installctest --test-dir build --output-on-failure -L cpppython -m pytest <new test files> -vpython -m pytest -m "not perf" --ignore=tests/perfNote
test_interfaces_zmq_server.py.