APITESTS: AI-Powered Runtime Test Generator for Microservices
Project description
APITESTS: AI-Powered Runtime Test Generator for Microservices
Define GenTestCase blueprints with parameter sets; the framework generates a test for each combination, reducing boilerplate and increasing coverage.
Installation
$ pip install apitests
Key concepts
AI-Powered Generation
Use a Large Language Model (e.g., Gemini) with a RAG system to auto-generate test parameters. The RAG fetches context from internal docs (API specs), and the LLM creates a dictionary of valid, invalid, and edge-case inputs for your GenTestCase.
Black-Box Mocking
For black-box testing, patch your app's HTTP client to redirect traffic to a local Active Stub Server. The stub server queries the GenTests generator for dynamic, context-aware responses for each test, allowing you to test an unmodified application.
Data Collection During Generation and "live documentation"
As tests are generated and run, the framework can collect valuable data, such as:
- Request/response payloads from mocked services.
- Application logs emitted during the test.
- Performance metrics like response times.
This data can be aggregated into a report, offering insights into the application's behavior under different scenarios and aiding in debugging. This collected data can then be fed into a corporate RAG system, creating a form of "live documentation" that reflects the application's actual, tested behavior.
Running the Generator
You can tag your GenTestCase tests and run them selectively with your test runner.
This will start test generation:
Django:
$ ./manage.py test animals --tag=generator
Pytest:
$ pytest tests/test_mod.py -m=generator
PYPI publising:
-
Fix version
-
Build
$ python -m build
- Upload to pypi
$ python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apitests-0.0.3.tar.gz.
File metadata
- Download URL: apitests-0.0.3.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd67ac499c19d3ae4d91960b320abd534a1cbd4be60300c8cd195b86d49dcc77
|
|
| MD5 |
209d2050210ab7063e99595159e10598
|
|
| BLAKE2b-256 |
03b337b6a6d4229d1679069cd72428dd6f0b6574b7de5c967dfb4910829c9733
|
Provenance
The following attestation bundles were made for apitests-0.0.3.tar.gz:
Publisher:
pypi.yaml on ryabtsev/apitests
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apitests-0.0.3.tar.gz -
Subject digest:
bd67ac499c19d3ae4d91960b320abd534a1cbd4be60300c8cd195b86d49dcc77 - Sigstore transparency entry: 1009270828
- Sigstore integration time:
-
Permalink:
ryabtsev/apitests@f0fe181d490ac80e082655da4d7e0854ba947cc3 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/ryabtsev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@f0fe181d490ac80e082655da4d7e0854ba947cc3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file apitests-0.0.3-py3-none-any.whl.
File metadata
- Download URL: apitests-0.0.3-py3-none-any.whl
- Upload date:
- Size: 32.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9441ed64166ecd24be1de175fd613272d23fd9437b1c84168e0d1f3b5c37bb58
|
|
| MD5 |
3150b3786d6ec96b9a1d47be020ff196
|
|
| BLAKE2b-256 |
5bef48059e16cedc352cc6bd8cdf45929a7c5fdcaeb1a7bce06ce3451d18c084
|
Provenance
The following attestation bundles were made for apitests-0.0.3-py3-none-any.whl:
Publisher:
pypi.yaml on ryabtsev/apitests
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apitests-0.0.3-py3-none-any.whl -
Subject digest:
9441ed64166ecd24be1de175fd613272d23fd9437b1c84168e0d1f3b5c37bb58 - Sigstore transparency entry: 1009270842
- Sigstore integration time:
-
Permalink:
ryabtsev/apitests@f0fe181d490ac80e082655da4d7e0854ba947cc3 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/ryabtsev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@f0fe181d490ac80e082655da4d7e0854ba947cc3 -
Trigger Event:
release
-
Statement type: