No description
.forgejo/workflows | ||
.gitignore | ||
README.md | ||
run_test.py |
Integration Test
An example integration test for the CleverBrag API health endpoint. multi-staged
Overview
This project contains integration tests that validate the functionality of the CleverBrag API's health endpoint. The tests ensure that the API is responding correctly and returning the expected health status.
Features
- Health Endpoint Testing: Validates the
/v3/health
endpoint of the CleverBrag API - Automated CI/CD: Continuous integration using Forgejo workflows
- Python-based: Uses pytest framework for testing
- HTTP Request Testing: Validates API responses and status codes
Project Structure
.
├── README.md # This file
├── run_test.py # Main test file
└── .forgejo/
└── workflows/
└── integration-test.yaml # CI/CD workflow configuration
Requirements
- Python 3.x
- pytest
- requests
Installation
- Clone the repository:
git clone <repository-url>
cd integration-test
- Install dependencies:
pip install pytest requests
Usage
Running Tests Locally
You can run the tests in several ways:
- Using pytest (recommended):
pytest run_test.py
- Running directly with Python:
python run_test.py
- Verbose output:
pytest run_test.py -v
Test Details
The test suite includes:
test_health_endpoint()
: Tests the health endpoint athttps://api.cleverbrag.epsilon.cleverthis.com/v3/health
- Verifies HTTP 200 status code
- Validates JSON response structure
- Checks that
results.message
equals "ok"
CI/CD Integration
This project uses Forgejo for continuous integration. The workflow automatically:
- Triggers on pushes to the
master
branch - Sets up a Python 3 environment
- Installs required dependencies (
pytest
andrequests
) - Runs the test suite using pytest
Workflow Configuration
The CI/CD pipeline is defined in .forgejo/workflows/integration-test.yaml
and runs on a generic runner with a Python 3 container.
API Endpoint
The tests target the following endpoint:
- URL:
https://api.cleverbrag.epsilon.cleverthis.com/v3/health
- Method: GET
- Expected Response:
{
"results": {
"message": "ok"
}
}
Contributing
- Fork the repository
- Create a feature branch
- Add or modify tests as needed
- Ensure all tests pass locally
- Submit a pull request
License
This project is part of the CleverBrag API testing suite.