test: add go fuzz tests for key internal functions#868
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #868 +/- ##
==========================================
+ Coverage 40.25% 40.71% +0.46%
==========================================
Files 114 114
Lines 10866 10866
==========================================
+ Hits 4374 4424 +50
+ Misses 6091 6050 -41
+ Partials 401 392 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds Go fuzz testing infrastructure and fuzz targets to improve crash-resistance and determinism coverage for internal DTO/JSON handling, use-case transforms, certificate parsing, and interval parsing.
Changes:
- Added 17 Go fuzz targets across DTO JSON processing/validation, DTO↔entity transforms, crypto parsing, and parsing utilities.
- Introduced Makefile targets to discover and run fuzz targets (single target, smoke, and full sequential runs).
- Documented fuzzing workflows and target inventory in
README.mdand the newFUZZ_TEST.md.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds user-facing fuzz-testing workflow and Make targets. |
| Makefile | Adds fuzz-list, fuzz-one, fuzz-smoke, and fuzz-all targets. |
| FUZZ_TEST.md | Provides detailed fuzz target inventory, strategy, and CI guidance. |
| internal/entity/dto/v1/json_fuzz_test.go | Fuzzes JSON unmarshal + validator behavior across multiple DTOs using a shared helper. |
| internal/certificates/generate_fuzz_test.go | Fuzzes PEM cert/key parsing with corrupted/truncated/swapped inputs. |
| internal/usecase/devices/alarms_fuzz_test.go | Fuzzes ParseInterval for determinism and error stability. |
| internal/usecase/devices/transform_fuzz_test.go | Fuzzes device DTO↔entity transforms and key invariants (e.g., GUID normalization). |
| internal/usecase/domains/usecase_fuzz_test.go | Fuzzes PKCS#12 decrypt + expiration checking behavior. |
| internal/usecase/domains/transform_fuzz_test.go | Fuzzes domain DTO↔entity transforms including expiration parsing behavior. |
| internal/usecase/ciraconfigs/transform_fuzz_test.go | Fuzzes CIRA config DTO↔entity transforms (with mock crypto). |
| internal/usecase/profiles/transform_fuzz_test.go | Fuzzes profile DTO↔entity transforms and tag-join invariant. |
| internal/usecase/profilewificonfigs/transform_fuzz_test.go | Fuzzes profile WiFi config DTO↔entity transforms. |
| internal/usecase/wificonfigs/transform_fuzz_test.go | Fuzzes wireless config DTO↔entity transforms and link-policy nil handling. |
| internal/usecase/ieee8021xconfigs/transform_fuzz_test.go | Fuzzes IEEE8021x config DTO↔entity transforms. |
💡 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 15 out of 15 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes