Skip to content

test: expand fuzz testing coverage - #707

Merged
kalbasit merged 2 commits into
mainfrom
02-03-test_expand_fuzz_testing_coverage
Feb 3, 2026
Merged

kalbasit merged 2 commits into
mainfrom
02-03-test_expand_fuzz_testing_coverage

Conversation

@kalbasit

@kalbasit kalbasit commented Feb 3, 2026

Copy link
Copy Markdown
Owner

Expanded fuzz testing coverage to include narinfo parsing and nar
compression type validation.

  • Added FuzzParseNarInfo to pkg/cache/fuzz_test.go to test
    narinfo.Parse.
  • Added FuzzCompressionTypeFromExtension to pkg/nar/fuzz_test.go.
  • Updated .github/workflows/fuzz.yml to include the new fuzz tests
    in the matrix.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 3, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kalbasit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the fuzz testing coverage for the go-nix project by introducing new fuzz tests for critical components. Specifically, it adds tests for parsing Narinfo files and for validating Nar compression types from file extensions. This expansion aims to proactively identify and mitigate potential vulnerabilities or unexpected behaviors when processing diverse and potentially malformed inputs, thereby improving the overall stability and security of the codebase.

Highlights

  • Narinfo Parsing Fuzzing: Introduced a new fuzz test, FuzzParseNarInfo, in pkg/cache/fuzz_test.go to validate the robustness of narinfo.Parse against various inputs, ensuring it handles malformed data without panicking.
  • Nar Compression Type Fuzzing: Added FuzzCompressionTypeFromExtension to pkg/nar/fuzz_test.go to thoroughly test the nar.CompressionTypeFromExtension function, verifying its behavior with different file extensions and ensuring correct compression type identification.
  • Workflow Integration: The GitHub Actions fuzzing workflow (.github/workflows/fuzz.yml) has been updated to include these new fuzz tests, integrating them into the continuous integration process.
Changelog
  • pkg/cache/fuzz_test.go
    • Added a new file containing FuzzParseNarInfo to fuzz test the narinfo.Parse function.
  • pkg/nar/fuzz_test.go
    • Added FuzzCompressionTypeFromExtension to fuzz test the nar.CompressionTypeFromExtension function.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/fuzz.yml
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@dosubot dosubot Bot added enhancement New feature or request go Pull requests that update go code labels Feb 3, 2026

kalbasit commented Feb 3, 2026 •

Copy link
Copy Markdown
Owner Author

Base automatically changed from 02-03-ci_refactor_fuzz_workflow_to_use_matrix_strategy to main February 3, 2026 08:37
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 3, 2026
Expanded fuzz testing coverage to include narinfo parsing and nar
compression type validation.
- Added FuzzParseNarInfo to pkg/cache/fuzz_test.go to test
  narinfo.Parse.
- Added FuzzCompressionTypeFromExtension to pkg/nar/fuzz_test.go.
- Updated .github/workflows/fuzz.yml to include the new fuzz tests
  in the matrix.
@kalbasit
kalbasit force-pushed the 02-03-test_expand_fuzz_testing_coverage branch from 4158097 to ccdfc24 Compare February 3, 2026 08:37
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request is a valuable addition, expanding fuzz testing coverage to narinfo.Parse and nar.CompressionTypeFromExtension. This proactive approach helps improve the overall robustness and security of the codebase by catching potential panics and unexpected behavior. The implementation is straightforward. The minor suggestion to make one of the new fuzz tests more robust against future changes has been retained as it aligns with best practices and is not covered by any specific rules.

Comment thread pkg/nar/fuzz_test.go Resolved
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@kalbasit
kalbasit enabled auto-merge (squash) February 3, 2026 08:43
@codecov

codecov Bot commented Feb 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.16%. Comparing base (fbc43f3) to head (96e40ad).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #707   +/-   ##
=======================================
  Coverage   79.16%   79.16%           
=======================================
  Files           2        2           
  Lines         456      456           
=======================================
  Hits          361      361           
  Misses         83       83           
  Partials       12       12           

☔ 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.

@kalbasit
kalbasit merged commit c116c49 into main Feb 3, 2026
@kalbasit
kalbasit deleted the 02-03-test_expand_fuzz_testing_coverage branch February 3, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant