Skip to content

test: add fixture coverage for rule families#122

Merged
avifenesh merged 3 commits intomainfrom
feature/add-test-fixtures-for-all-rule-families-45
Feb 3, 2026
Merged

test: add fixture coverage for rule families#122
avifenesh merged 3 commits intomainfrom
feature/add-test-fixtures-for-all-rule-families-45

Conversation

@avifenesh
Copy link
Copy Markdown
Collaborator

Summary

  • add XML fixtures (including a valid sample) to cover XML rule family rules
  • add CLI integration tests that assert fixture family rule IDs
  • expand core fixture validation coverage and document fixture conventions

Test Plan

  • cargo test -p agnix-core test_validate_fixtures_directory
  • cargo test -p agnix-cli --test fixture_family_cli

Related Issues

Closes #45

Copilot AI review requested due to automatic review settings February 2, 2026 20:35
Copy link
Copy Markdown
Contributor

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

This PR adds comprehensive fixture coverage for XML rule family validation and expands test coverage across all rule families. The changes introduce XML test fixtures demonstrating various XML parsing errors, document fixture conventions, and add both core and CLI integration tests to verify that fixtures correctly trigger their expected rule violations.

Changes:

  • Added XML fixtures covering unclosed tags (XML-001), mismatched tags (XML-002), and unmatched closing tags (XML-003), plus a valid XML sample
  • Created fixture documentation explaining conventions and providing a reference table for all rule families
  • Expanded core fixture validation tests to assert that each family's fixtures trigger the correct rule IDs
  • Added CLI integration tests that validate fixture behavior through the command-line interface

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/fixtures/xml/xml-valid.md Valid XML fixture that should not trigger any XML-family diagnostics
tests/fixtures/xml/xml-003-unmatched.md Fixture demonstrating unmatched closing tag error (XML-003)
tests/fixtures/xml/xml-002-mismatch.md Fixture demonstrating mismatched opening/closing tags (XML-002)
tests/fixtures/xml/xml-001-unclosed.md Fixture demonstrating unclosed tag error (XML-001)
tests/fixtures/README.md Documents fixture conventions and provides reference table for all rule families
crates/agnix-core/src/lib.rs Adds test assertions for XML, AGM, XP, REF fixtures and creates positive test cases verifying valid fixtures produce no diagnostics
crates/agnix-cli/tests/fixture_family_cli.rs New CLI integration test file verifying that fixtures trigger expected rules through the command-line interface

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @avifenesh, 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 improves the testing infrastructure for the agnix linter. It introduces a comprehensive set of new XML fixtures and corresponding CLI integration tests to ensure accurate detection of XML-related issues. Additionally, the core fixture validation has been extended to cover more rule families, and clear conventions for fixture organization have been documented, making the testing suite more robust and maintainable.

Highlights

  • XML Fixture Coverage: Added new XML fixtures, including a valid sample, to enhance coverage for XML rule family rules.
  • CLI Integration Tests: Introduced CLI integration tests to verify that the agnix tool correctly reports diagnostics for various fixture family rule IDs.
  • Fixture Validation and Documentation: Expanded the core fixture validation logic and documented conventions for fixture files, improving test robustness and clarity.
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.

Copy link
Copy Markdown
Contributor

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

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 significantly improves test coverage by adding fixtures and integration tests for various rule families. The changes are well-structured and the new tests effectively cover the intended scenarios. I have a couple of suggestions to refactor some of the new test code to reduce duplication and improve maintainability.

Copilot AI review requested due to automatic review settings February 3, 2026 06:00
@claude
Copy link
Copy Markdown

claude bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Copy link
Copy Markdown
Contributor

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 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

assert!(
diagnostics
.iter()
.any(|d| { d.rule == rule && d.file.to_string_lossy().contains(file_part) }),
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The closure has unnecessary braces around the boolean expression. This is inconsistent with the style used in similar assertions in this test function (lines 1408-1409 and 1416-1417). The braces should be removed for consistency.

Suggested change
.any(|d| { d.rule == rule && d.file.to_string_lossy().contains(file_part) }),
.any(|d| d.rule == rule && d.file.to_string_lossy().contains(file_part)),

Copilot uses AI. Check for mistakes.
@claude
Copy link
Copy Markdown

claude bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@avifenesh avifenesh merged commit 71cb327 into main Feb 3, 2026
18 checks passed
@avifenesh avifenesh deleted the feature/add-test-fixtures-for-all-rule-families-45 branch February 3, 2026 06:06
avifenesh added a commit that referenced this pull request Mar 28, 2026
- Remove non-standard `version` field from SKILL.md frontmatter (fixes
  code scanning alert #1062, XP-SK-001)
- Override serialize-javascript to ^7.0.5 in website and vscode extension
  to fix CPU exhaustion DoS vulnerability (fixes Dependabot alerts #122
  and #123)
avifenesh added a commit that referenced this pull request Mar 28, 2026
* fix: resolve security alerts (serialize-javascript, XP-SK-001)

- Remove non-standard `version` field from SKILL.md frontmatter (fixes
  code scanning alert #1062, XP-SK-001)
- Override serialize-javascript to ^7.0.5 in website and vscode extension
  to fix CPU exhaustion DoS vulnerability (fixes Dependabot alerts #122
  and #123)

* fix: address review feedback - add engines.node, changelog entry

- Add engines.node >= 20.0.0 to website and vscode extension
  (serialize-javascript@7 requires Node 20+)
- Add CHANGELOG.md entry for security fixes

* fix: merge engines.node into existing engines block

Avoid overwriting engines.vscode by merging the Node constraint into the
existing engines object instead of adding a duplicate key.

* fix: merge duplicate Fixed headings in changelog
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.

Add test fixtures for all rule families

2 participants