This repository automates the generation of test scripts from your codebase. The workflow involves reading your codebase, gathering relevant information, and generating the necessary test scripts.
To use this repository, follow these steps:
-
Set up the environment:
- Create a
.env
file in the root directory of the repository. - Add a variable
CODEBASE
that points to the path of your codebase:CODEBASE=/path/to/your/codebase
- Current .env variables set are
CODEBASE = path to codebase //GROQ CLOUD API KEY FOR LATEST OPEN SOURCE MODELS WITH SUPER FAST INFERENCE GROQ_API_KEY =
- Create a
-
Step 1: Execute
file_read.py
:- This script reads and processes the files in your codebase as specified in the
.env
file.
- This script reads and processes the files in your codebase as specified in the
-
Step 2: Run
information_gathering.py
:- This script gathers the necessary information from the processed files to prepare for test generation.
-
Step 3: Run
test_generator.py
:- This script generates the test scripts based on the gathered information. It also logs the process and stores the logs and generated test scripts in the
test_scripts
directory.
- This script generates the test scripts based on the gathered information. It also logs the process and stores the logs and generated test scripts in the
-
Step 3-ALTERNATE : Run
test_generator_local.py
:- THIS PERFORMS THE SAME TASK AS THE TEST_GENERATOR but THE MODEL IS LOADED LOCALLY ONTO MEMORY. May be computationally intensive depending on the model.
After running the above scripts, the following outputs will be generated:
- Test Scripts: The generated test scripts will be located in the
test_scripts
directory. - Log Files: Logs detailing the execution process will also be saved in the
test_scripts
directory. - Summary File: A summary of the run will be generated and saved as
output.md
in the root directory.
- Python 3.x
- Necessary dependencies listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/your-repo-name.git cd your-repo-name
-
Install the required dependencies:
pip install -r requirements.txt
-
Follow the workflow steps to generate the test scripts.
You can modify the placeholders like "Repository Name" and the repository URL as per your project specifics.