Draft
Conversation
Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
This pull request introduces a new tool called Erospector for the
containerdproject, designed to help automatically generate Go unit tests using Azure OpenAI (GPT) integration. The changes add the full source code for the Erospector utility in a dedicated directory, including Go and Python files that work together to parse Go source files, extract functions, generate context, and produce unit tests.Summary of changes:
erospector/: Contains all the tooling for the Erospector utility.main.go: Implements the command-line interface for Erospector. Handles argument parsing, manages function selection, loads context files as a "primer," and coordinates the test generation process.parser.go: Extracts functions from Go source files for targeted test generation.primer_loader.go: Recursively finds Go files in key directories and loads their contents to provide context to the test generator.writer.go: Handles writing generated test files to disk, with logic to extract code blocks from GPT output.gpt_python.go: Bridges the Go code to the Python script, managing communication and error handling.gpt.py: The Python script responsible for interacting with Azure OpenAI, generating test code, and running Go tests with coverage calculation. Implements both "simple" and "iterative test-and-run" modes.Key Features:
_test.gofiles.This PR adds an advanced, AI-powered test generation tool for Go code within the containerd repository, enabling developers to automate and streamline the creation of unit tests.