Skip to content

Create generate-unit-tests prompt for Google Test#1

Open
kblricks wants to merge 1 commit intoSharedDevelopmentfrom
kblricks-patch-1
Open

Create generate-unit-tests prompt for Google Test#1
kblricks wants to merge 1 commit intoSharedDevelopmentfrom
kblricks-patch-1

Conversation

@kblricks
Copy link
Copy Markdown
Owner

@kblricks kblricks commented Feb 9, 2026

Add a prompt for generating Google Test unit tests for Graphitti C++17 functions with guidelines for discovery, research, and output.

Closes #

Description

Checklist (Mandatory for new features)

  • Added Documentation
  • Added Unit Tests

Testing (Mandatory for all changes)

  • GPU Test: test-medium-connected.xml Passed
  • GPU Test: test-large-long.xml Passed

Add a prompt for generating Google Test unit tests for Graphitti C++17 functions with guidelines for discovery, research, and output.
Copilot AI review requested due to automatic review settings February 9, 2026 07:52
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 a GitHub Copilot prompt file to guide generation of Google Test unit tests for Graphitti C++17 code, with emphasis on discovery and planning before writing tests.

Changes:

  • Introduces a new .github/prompts/generate-unit-tests.prompt.md prompt with discovery/research steps.
  • Defines a test plan checklist and output guidelines for produced Google Test code.

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

Comment on lines +42 to +44
- Test behavior, not implementation details
- Follow naming: `TEST(ClassName, Method_Condition_Expected)`
- Place new tests in `Testing/UnitTesting/{ClassName}Tests.cpp`
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The suggested test naming TEST(ClassName, Method_Condition_Expected) uses underscores, which conflicts with the documented Graphitti GoogleTest convention of PascalCase for both suite and test names (no underscores). To keep generated tests consistent with the existing suite, update this guideline to use PascalCase examples (e.g., TEST(ClassName, FunctionalityBeingTested)).

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +12
Target function: ${input:function_name:Which C++ function or method should be tested?}
Target class: ${input:class_name:Which class does this function belong to? (or 'standalone' for free functions)}

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Target class can be 'standalone' for free functions, but the output guidance still assumes {ClassName} for suite naming and file placement. Please define what suite/file name should be used for free functions (e.g., a module name or dedicated FreeFunctions suite) so generation is unambiguous.

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +46
- Place new tests in `Testing/UnitTesting/{ClassName}Tests.cpp`
- If updating an existing test file, add a brief comment marking new additions
- Include realistic Graphitti simulation data where appropriate
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The instruction to "add a brief comment marking new additions" when updating an existing test file doesn't match existing unit test files in Testing/UnitTesting/, which generally don't annotate incremental additions. Consider removing this requirement (or making it conditional) to avoid creating unnecessary churn in diffs.

Copilot uses AI. Check for mistakes.
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.

2 participants