Commit 6385c40
authored
fix(tests): Fix packetparser tests (#1977)
# Description
This PR fixes unit test failures in the `packetparser` plugin:
- Mocks `metrics.ParsedPacketsCounter` in `TestReadDataPodLevelEnabled`
to prevent a nil pointer dereference during test execution.
- Updates the expected dynamic header content in
`TestPacketParseGenerate` to match the actual generated output, which
now includes `DATA_SAMPLING_RATE` and `BYPASS_LOOKUP_IP_OF_INTEREST`
definitions.
## Related PRs
This test was broken in the following PRs
- #624
- #1767
## Checklist
- [x] I have read the [contributing
documentation](https://retina.sh/docs/Contributing/overview).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.
## Screenshots (if applicable) or Testing Completed
<img width="1624" height="1343" alt="image"
src="https://github.com/user-attachments/assets/9549ed15-7c62-4537-a806-2d2368d3fc66"
/>
## Additional Notes
We have a bigger issue which is CI is not showing a failure when single
test fails, we will look into that and create another PR to fix that.
See this example (FAIL not caught) - reference #1688
https://github.com/microsoft/retina/actions/runs/20115412850/job/57723528708#step:4:3145
---
Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.1 parent 6447b7e commit 6385c40
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
347 | 351 | | |
348 | 352 | | |
349 | 353 | | |
| |||
560 | 564 | | |
561 | 565 | | |
562 | 566 | | |
563 | | - | |
| 567 | + | |
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
567 | 571 | | |
568 | | - | |
| 572 | + | |
569 | 573 | | |
570 | 574 | | |
571 | 575 | | |
572 | 576 | | |
573 | | - | |
| 577 | + | |
574 | 578 | | |
575 | 579 | | |
576 | 580 | | |
577 | 581 | | |
578 | | - | |
| 582 | + | |
579 | 583 | | |
580 | 584 | | |
581 | 585 | | |
| |||
0 commit comments