No description
Find a file
2025-07-29 17:04:52 -05:00
.forgejo/workflows get rid of misleading name 2025-07-29 17:04:52 -05:00
.gitignore all gucci mane 2025-07-29 16:28:32 -05:00
README.md optionality 2025-07-29 16:46:03 -05:00
run_test.py dedup yaml 2025-07-29 17:01:32 -05:00

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

  1. Clone the repository:
git clone <repository-url>
cd integration-test
  1. Install dependencies:
pip install pytest requests

Usage

Running Tests Locally

You can run the tests in several ways:

  1. Using pytest (recommended):
pytest run_test.py
  1. Running directly with Python:
python run_test.py
  1. Verbose output:
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:
{
  "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.