laurigates / gha-issue-resolution

Analyzes GitHub issues and provides AI-generated suggestions using Gemini
1 stars 0 forks source link

Add python unit testing capability #12

Open laurigates opened 1 month ago

laurigates commented 1 month ago

Add unit tests for python script

laurigates commented 2 weeks ago

AI-generated suggestion

Here's a potential solution to this issue, generated by an AI assistant:

Analysis of the Issue: Add python unit testing capability

The issue requests the addition of unit tests for the Python scripts within the gha-issue-resolution repository. Currently, there are no unit tests present. This needs to be addressed by adding a testing framework, writing test cases for the existing functions, and potentially adjusting the project structure to accommodate the tests.

Files Requiring Modification

  1. pyproject.toml: This file manages project dependencies. It needs modification to include the chosen testing framework (e.g., pytest).

  2. src/gha_issue_resolution/__init__.py: While not strictly required for testing, updating the version number here after adding tests is good practice.

  3. tests/__init__.py: This file currently only contains version information. It will be expanded to include test modules or act as a namespace for the tests.

  4. All files within the src/gha_issue_resolution directory: Each module in this directory contains functions that should be tested individually.

Detailed Changes

1. File: pyproject.toml (CURRENT CONTENT)

[tool.pdm.dependencies]
PyGithub = ">=1.55"
google-generativeai = ">=0.8.3"

[tool.pdm.dev-dependencies]
pytest = "^7.4.0"

Changes to make:

File: pyproject.toml (WITH CHANGES)

[tool.pdm.dependencies]
PyGithub = ">=1.55"
google-generativeai = ">=0.8.3"

[tool.pdm.dev-dependencies]
pytest = "^7.4.0"

2. File: src/gha_issue_resolution/__init__.py (CURRENT CONTENT)

"""
GitHub Issue Resolution with Gemini Flash
A GitHub Action that uses Google's Gemini Flash model to analyze issues and provide solutions
"""

__version__ = "0.1.0"

Changes to make:

To create a pull request with these changes, comment with: /create-pr To get an updated analysis, comment with: /update

This is an AI-generated response and requires human validation and testing before implementation.