Skip to main content

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:

  1. Fix version

  2. Build

$ python -m build
  1. Upload to pypi
$ python -m twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apitests-0.0.3.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apitests-0.0.3-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

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

Hashes for apitests-0.0.3.tar.gz
Algorithm Hash digest
SHA256 bd67ac499c19d3ae4d91960b320abd534a1cbd4be60300c8cd195b86d49dcc77
MD5 209d2050210ab7063e99595159e10598
BLAKE2b-256 03b337b6a6d4229d1679069cd72428dd6f0b6574b7de5c967dfb4910829c9733

See more details on using hashes here.

Provenance

The following attestation bundles were made for apitests-0.0.3.tar.gz:

Publisher: pypi.yaml on ryabtsev/apitests

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for apitests-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9441ed64166ecd24be1de175fd613272d23fd9437b1c84168e0d1f3b5c37bb58
MD5 3150b3786d6ec96b9a1d47be020ff196
BLAKE2b-256 5bef48059e16cedc352cc6bd8cdf45929a7c5fdcaeb1a7bce06ce3451d18c084

See more details on using hashes here.

Provenance

The following attestation bundles were made for apitests-0.0.3-py3-none-any.whl:

Publisher: pypi.yaml on ryabtsev/apitests

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page