Skip to main content

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

Metadata

Release files for micro-test-hub 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for micro-test-hub 0.1.10
File Size Uploaded
micro_test_hub-0.1.10.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for micro-test-hub 0.1.10
File Interpreter ABI Platform
micro_test_hub-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 43.5 kB

Release files / micro_test_hub-0.1.10.tar.gz

Download URL micro_test_hub-0.1.10.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dc9300347937e5abf32e306c104b74efe224989e7cfc676f1360e6ac243564d2
BLAKE2b-256 checksum
How to use checksums
93f956c7055719a1da78a88181e7ff700f855c00f5ba2604f36890b158e7ba36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release files / micro_test_hub-0.1.10-py3-none-any.whl

Download URL micro_test_hub-0.1.10-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74d621b67b229785cea21b1f1abf07cd6155a30a7e6329b5b395ff9c0c4d6f47
BLAKE2b-256 checksum
How to use checksums
f13ca4eb510c8fcaab0b095e5e00bbbf5c85ee36f896ea3400be3c191ffd619d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page