# Integration Test An example integration test for the CleverBrag API health endpoint. ## 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 1. Clone the repository: ```bash git clone cd integration-test ``` 2. Install dependencies: ```bash pip install pytest requests ``` ## Usage ### Running Tests Locally You can run the tests in several ways: 1. **Using pytest** (recommended): ```bash pytest run_test.py ``` 2. **Running directly with Python**: ```bash python run_test.py ``` 3. **Verbose output**: ```bash pytest run_test.py -v ``` ### Test Details The test suite includes: - **`test_health_endpoint()`**: Tests the health endpoint at `https://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: 1. Triggers on pushes to the `master` branch 2. Sets up a Python 3 environment 3. Installs required dependencies (`pytest` and `requests`) 4. 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**: ```json { "results": { "message": "ok" } } ``` ## Contributing 1. Fork the repository 2. Create a feature branch 3. Add or modify tests as needed 4. Ensure all tests pass locally 5. Submit a pull request ## License This project is part of the CleverBrag API testing suite.