Skip to content

[skip changelog] test: validate hook fixtures via CLI#117

Merged
avifenesh merged 5 commits intomainfrom
task/75-empty-fixtures-cli-coverage
Feb 2, 2026
Merged

[skip changelog] test: validate hook fixtures via CLI#117
avifenesh merged 5 commits intomainfrom
task/75-empty-fixtures-cli-coverage

Conversation

@avifenesh
Copy link
Collaborator

Summary

  • Resolve fixture paths via workspace root in CLI integration tests
  • Add CLI test that validates hooks fixture and asserts CC-HK-006
  • Add guard to fail on empty fixture directories

Test Plan

  • cargo test -p agnix-cli --test cli_integration
  • cargo test

Related Issues

Closes #75

Copilot AI review requested due to automatic review settings February 2, 2026 17:25
@gemini-code-assist
Copy link
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 stability and coverage of the CLI integration tests. It introduces a more robust method for resolving test fixture paths relative to the workspace root, which makes the tests more portable and less prone to environment-specific failures. Furthermore, new tests have been added to specifically validate hook configurations and to enforce the presence of actual content within fixture directories, enhancing the overall quality and reliability of the test suite.

Highlights

  • Robust Path Resolution: Refactored fixture path resolution in CLI integration tests to use workspace_root() and workspace_path() for improved reliability and portability across different execution environments.
  • Hook Fixture Validation: Added a new CLI test (test_cli_covers_hook_fixtures_via_cli_validation) to validate hook fixtures, specifically checking for the CC-HK-006 rule when a command field is missing in the configuration.
  • Fixture Directory Integrity: Implemented a new test (test_fixtures_have_no_empty_placeholder_dirs) to ensure that fixture directories are not empty, preventing placeholder directories without actual test files and maintaining test suite cleanliness.
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
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 introduces several improvements to the integration tests. It refactors test paths to be relative to the workspace root, making them more robust. It also adds two new tests: one to validate hook fixtures via the CLI, and another to ensure no empty fixture directories exist. The changes are well-structured and align with the goal of improving test quality. I have one suggestion to simplify and combine assertions in one of the new tests for better readability and maintainability.

@claude
Copy link

claude bot commented Feb 2, 2026

Code review

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

1 similar comment
@claude
Copy link

claude bot commented Feb 2, 2026

Code review

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

Copy link
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 enhances CLI integration testing by resolving fixture paths via workspace root and adding comprehensive validation for hook fixtures and empty directories, addressing issue #75.

Changes:

  • Added helper functions (workspace_root(), workspace_path(), fixtures_config()) to resolve paths relative to workspace root in tests
  • Updated all existing test paths to use workspace-relative resolution for better portability across different execution contexts
  • Added CLI test test_cli_covers_hook_fixtures_via_cli_validation that validates hook fixtures through CLI and asserts CC-HK-006 rule detection
  • Added guard test test_fixtures_have_no_empty_placeholder_dirs to ensure all fixture directories contain actual test files

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

@avifenesh
Copy link
Collaborator Author

Addressed the review note by combining the CC-HK-006 assertions into a single check. The JSON output reports the file path as ests/fixtures/invalid/hooks/missing-command-field/settings.json (relative to workspace root), so the assertion targets that concrete path to match actual CLI output.

Copilot AI review requested due to automatic review settings February 2, 2026 17:50
@avifenesh avifenesh merged commit 5d2724a into main Feb 2, 2026
16 checks passed
Copy link
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 1 out of 1 changed files in this pull request and generated 1 comment.


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

Comment on lines +18 to +19
if let Ok(content) = std::fs::read_to_string(&cargo_toml) {
if content.contains("[workspace]") || content.contains("[workspace.") {
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The workspace detection logic uses simple string matching with contains("[workspace]") which could match false positives in comments or strings within the Cargo.toml file. Consider using proper TOML parsing with the toml crate (which is already a dependency in this crate's Cargo.toml) to check for a [workspace] section. For example, you could parse the file and check if parsed.get("workspace").is_some().

Copilot uses AI. Check for mistakes.
@avifenesh avifenesh deleted the task/75-empty-fixtures-cli-coverage branch February 5, 2026 12:49
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.

Address empty fixtures (fixes/valid hooks/plugins/memory) and hook fixtures CLI coverage

2 participants