Skip to content

test: add go fuzz tests for key internal functions#868

Open
shaoboon wants to merge 1 commit intomainfrom
sb_go_fuzz
Open

test: add go fuzz tests for key internal functions#868
shaoboon wants to merge 1 commit intomainfrom
sb_go_fuzz

Conversation

@shaoboon
Copy link
Copy Markdown

@shaoboon shaoboon commented Mar 31, 2026

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.md and the new FUZZ_TEST.md.

@shaoboon shaoboon requested a review from Copilot March 31, 2026 08:51
@shaoboon shaoboon linked an issue Mar 31, 2026 that may be closed by this pull request
15 tasks
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.71%. Comparing base (220e5fa) to head (014a02f).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md and the new FUZZ_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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Fuzz Testing for Internal Functions & API Endpoints

2 participants