Sign inSign up

chenyi26/chatunitest

By chenyi26

•Updated almost 3 years ago

The image for ChatUniTest Maven Plugin v1.4.1

Image
0

96

chenyi26/chatunitest repository overview

⁠ChatUniTest

⁠Description

Use chatunitest image to generate unit tests for a Maven project in a sandbox. This process involves the use of Large Language Models (LLMs) to assist in creating effective and comprehensive test cases. To ensure safety and prevent any potential harm to the user's machine, all testing activities should be conducted within a secure and isolated sandbox environment. This approach will help in mitigating risks associated with the execution of test cases that might otherwise cause issues on the user's system.

⁠How to use

⁠Create a Dockerfile:

Add a Dockerfile to your project with the following content:

FROM chenyi26/chatunitest:v1.4.1

WORKDIR /app
COPY . .
⁠Configuration File:

Ensure that you have a chatunitest.config.json file in your project with the necessary plugin configuration. For example.

{
    "apiKeys": "your-api-key",
    "model": "gpt-3.5-turbo",
    "url": "your-model-api"
}
⁠Build Your Project Image:

Execute the following shell command to build your project image:

build -t chatunitest:my-project .
⁠Run your image:

Use the following command to run your image:

docker run -it \
-v ~/.m2/repository:/root/.m2/repository \
chatunitest:commons-csv \
/bin/bash -c "python /scripts/fit_xml.py; bash"

This command mounts the local Maven repository into the container, which may affect the local environment. Alternatively, you can copy the local Maven repository into the image when building the project's image with a Dockerfile. This ensures that the container runs in a completely isolated environment.

⁠Generate Unit Tests:

In the container, use the Maven command to generate unit tests. For example:

mvn chatunitest:project

This command will generate unit tests for the entire project.

For additional information and details, visit the chatunitest-maven-plugin⁠ on GitHub.

Tag summary

Content type

Image

Digest

sha256:ffb234a4e…

Size

356 MB

Last updated

almost 3 years ago

docker pull chenyi26/chatunitest:v1.4.1