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:
-
Application Services:
- Container-Based Services
- Function-Based Services
-
Cloud Services:
- GCP Firestore
- GCP Pub/Sub
- GCP Storage
-
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:
-
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.
-
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
-
Configure artifacts registry for region:
gcloud auth configure-docker europe-west1-docker.pkg.dev
Install micro-test-hub
-
Install micro-test-hub:
pip install micro-test-hub
-
Copy the moc_integration_tests folder from repo to your local machine:
-
change directory to the moc_integration_tests:
cd moc_integration_tests
-
copy your application_default_credentials.json to moc_integration_tests/credentials folder
cp -f ~/.config/gcloud/application_default_credentials.json ./credentials
-
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
- Detached mode (default)
micro-test-hub run-test
- 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:
-
Container/Docker Service:
image_urienvironment vars
-
Function Service:
code repoenvironment vars
-
GCP Service:
- The type of service (Firestore, Pub/Sub, Storage)
-
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc9300347937e5abf32e306c104b74efe224989e7cfc676f1360e6ac243564d2
|
|
| MD5 |
495d43ca9fcdaa48573a0d5693d18b12
|
|
| BLAKE2b-256 |
93f956c7055719a1da78a88181e7ff700f855c00f5ba2604f36890b158e7ba36
|
File details
Details for the file micro_test_hub-0.1.10-py3-none-any.whl.
File metadata
- Download URL: micro_test_hub-0.1.10-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74d621b67b229785cea21b1f1abf07cd6155a30a7e6329b5b395ff9c0c4d6f47
|
|
| MD5 |
50e1aeb1afd9a7751c7efc63353a71dd
|
|
| BLAKE2b-256 |
f13ca4eb510c8fcaab0b095e5e00bbbf5c85ee36f896ea3400be3c191ffd619d
|