Skip to main content

A system to support the creation of integration tests for MOC microservices

Project description

Introduction to Micro-Test-Hub

Micro-Test-Hub is a versatile CLI tool designed to facilitate debugging and the creation of integration tests for systems built on the microservices architecture. It offers robust support for testing various types of services, categorized as follows:

  1. Application Services:

    • Container-Based Services
    • Function-Based Services
  2. Cloud Services:

    • GCP Firestore
    • GCP Pub/Sub
    • GCP Storage
  3. Databases:

    • PostgreSQL

Micro-Test-Hub is designed with cross-platform compatibility in mind, making it adaptable to various environments where services may be deployed. Currently, the tool supports Docker Compose, with plans to extend support to additional platforms, including:

  • GCP Platform
  • Amazon Platform
  • Minikube

To get started with Micro-Test-Hub, simply install the CLI tool using the following command:

pip install micro-test-hub

Run your first integration tests

You can start using Micro-Test-Hub by running the sample project, which includes basic integration tests for the moc system. Follow these steps:

GCP Artifacts Registry authentication

To authenticate with Google Cloud Platform's Artifact Registry, follow these steps:

  1. Install the Google Cloud SDK: If you haven't already, download and install the Google Cloud SDK from https://cloud.google.com/sdk/docs/install.

  2. Authenticate your Google Cloud account: Run the following command and follow the on-screen instructions to log in with your Google account:

    gcloud auth login
    
  3. Configure artifacts registry for region:

    gcloud auth configure-docker europe-west1-docker.pkg.dev
    

Install micro-test-hub

  1. Install micro-test-hub:

    pip install micro-test-hub
    
  2. Copy the moc_integration_tests folder from repo to your local machine:

  3. change directory to the moc_integration_tests:

    cd moc_integration_tests
    
  4. copy your application_default_credentials.json to moc_integration_tests/credentials folder

    cp -f ~/.config/gcloud/application_default_credentials.json ./credentials
    
  5. copy the ouput of the following command and add it to gateway_sfm_sm_postgress.microhub file (line 13)

    export gcloud_id_token=$(gcloud auth print-identity-token) && echo $gcloud_id_token
    

Run micro-test-hub

  1. Detached mode (default)
micro-test-hub run-test
  1. Attached mode
micro-test-hub run-test --mode attached

Build Your Own Project from Scratch

With Micro-Test-Hub, you can create your own project from scratch, defining the services, their types, and the dependencies they require. You can also specify a path for your Python tests, which must have main.py as the entry point module. Here’s a summary of the dependencies you need to define for each type of service:

  1. Container/Docker Service:

    • image_uri
    • environment vars
  2. Function Service:

    • code repo
    • environment vars
  3. GCP Service:

    • The type of service (Firestore, Pub/Sub, Storage)
  4. Database:

    • The initialization SQL file

You can start by using the help command to see the supported commands:

micro-test-hub --help

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

micro_test_hub-0.1.10.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

micro_test_hub-0.1.10-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file micro_test_hub-0.1.10.tar.gz.

File metadata

  • Download URL: micro_test_hub-0.1.10.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for micro_test_hub-0.1.10.tar.gz
Algorithm Hash digest
SHA256 dc9300347937e5abf32e306c104b74efe224989e7cfc676f1360e6ac243564d2
MD5 495d43ca9fcdaa48573a0d5693d18b12
BLAKE2b-256 93f956c7055719a1da78a88181e7ff700f855c00f5ba2604f36890b158e7ba36

See more details on using hashes here.

File details

Details for the file micro_test_hub-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for micro_test_hub-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 74d621b67b229785cea21b1f1abf07cd6155a30a7e6329b5b395ff9c0c4d6f47
MD5 50e1aeb1afd9a7751c7efc63353a71dd
BLAKE2b-256 f13ca4eb510c8fcaab0b095e5e00bbbf5c85ee36f896ea3400be3c191ffd619d

See more details on using hashes here.

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