Skip to main content

A Python project to establish a unified, automated testing framework for microservices.

Project description

CONC-Automation-Test-Tool

This project aims to establish a unified, automated testing framework for feature, nightly, and scale tests tailored to each microservice, eliminating node setup dependencies. It involves key microservice components like Kafka messaging, REST calls, cache, and database interactions, orchestrated to ensure thorough validation of microservice functionalities. The framework utilizes a Test Orchestrator to automate test inputs, execute workflows, and validate outputs by leveraging dynamically generated orchestration XLS files. Additionally, it supports concurrent testing of multiple microservices on virtual machines, enabling faster test execution and seamless integration of new features and regression tests.

Features

  • Modular code structure in the src/ directory.
  • Unit tests in the tests/ folder.
  • Configurations separated in the config/ directory.
  • Comprehensive documentation in docs/.

Setup Instructions

Prerequisites

  1. Python 3.6+: Ensure you have Python 3.6 or higher installed on your machine.
  2. PostgreSQL: Ensure you have PostgreSQL installed and running.

Step-by-Step Instructions

  1. Clone the Repository:

    git clone <repository_url>
    cd conc_automation_test_tool
    
  2. Create and Activate a Virtual Environment:

    python3 -m venv venv
    source venv/bin/activate  # On Windows: .\venv\Scripts\activate
    
  3. Install Dependencies:

    pip install -r requirements.txt
    
  4. Configure Environment Variables: Create a .env file in the root directory of the project. This file will store your environment variables, such as database connection details and secret keys.

    touch .env
    

    Add the following content to the .env file:

    DATABASE_URL=postgresql://myuser:prince123@localhost/test1
    SECRET_KEY=your_secret_key
    

    Replace myuser, prince123, localhost, and test1 with your actual PostgreSQL username, password, host, and database name, respectively. Replace your_secret_key with a secret key of your choice.

  5. Set Up the Database:

    • Define Models: The database schema is defined in the models.py file located in src/apps/app1. Ensure that the models are correctly defined.

    • Create Tables: Run the create_tables.py script to create the tables in the database.

      export PYTHONPATH=$(pwd)/src
      python -m db.create_tables
      
  6. Running the Flask Application: Start the Flask application by running the run.py script.

    python src/run.py
    

    The application will start, and you can access it at http://127.0.0.1:5000.

  7. Accessing API Endpoints: The following API endpoints are available:

    GET Requests

    • GET /api/v1/getDataWorkflow: Fetch data from the WorkFlow table.

      curl http://127.0.0.1:5000/api/v1/getDataWorkflow
      
    • GET /api/v1/getDataSimulatedData: Fetch data from the SimulatedData table.

      curl http://127.0.0.1:5000/api/v1/getDataSimulatedData
      
    Note: The above get responses will be of json format.

    POST Requests

    • POST /api/v1/postDataWorkflow: Insert records into the WorkFlow table by uploading an XLSX file.

      curl -X POST -F "file=@workflow_data.xlsx" http://127.0.0.1:5000/api/v1/postDataWorkflow
      
    • POST /api/v1/postDataSimulatedData: Insert records into the SimulatedData table by uploading an XLSX file.

      curl -X POST -F "file=@simulated_data.xlsx" http://127.0.0.1:5000/api/v1/postDataSimulatedData
      

Flow Diagram

Below is a flow diagram illustrating the process of uploading an XLSX file, validating the data, and inserting it into the database.

graph TD;
    A[Upload XLSX File] --> B[Read XLSX File]
    B --> C[Validate Data]
    C -->|Valid| D[Insert into Database]
    C -->|Invalid| E[Return Error]
    D --> F[Success Response]
    E --> F[Error Response]

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conc_automation_test_tool-0.2.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distributions

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

conc_automation_test_tool-0.2.0-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

conc_automation_test_tool-0.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

CONC_Automation_Test_Tool-0.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file conc_automation_test_tool-0.2.0.tar.gz.

File metadata

File hashes

Hashes for conc_automation_test_tool-0.2.0.tar.gz
Algorithm Hash digest
SHA256 805c038edef4969b59392660973fc9c7a517feb82d09e0156a03b59687ddcb5d
MD5 c976df6dac0ef009e7b3d8f3aaecd528
BLAKE2b-256 4ca32719df18abd4d6ee135654318b45379389d942dd5b0f0d276d09fcff9900

See more details on using hashes here.

File details

Details for the file conc_automation_test_tool-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for conc_automation_test_tool-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd47d79720fe890b0b1c02602f8622f5dbf1af509147c268dc920cf5ea1a97f9
MD5 690ba96e05e43e95e45bd50695662f01
BLAKE2b-256 5e7adb302ca2a1f0f4fd4157dc9fb365fdaf6ae0482b5e297aa3192b6b9bf297

See more details on using hashes here.

File details

Details for the file conc_automation_test_tool-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for conc_automation_test_tool-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8646834edca271639b121f4fddd557bf5eff8aa015bde4110fe6d1150d8d735e
MD5 efef9656ae004fe824fb7128454a3004
BLAKE2b-256 01cfe6a214fab12333815863c93b3102df18044c24ced47ca0dacfa84df33a07

See more details on using hashes here.

File details

Details for the file CONC_Automation_Test_Tool-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for CONC_Automation_Test_Tool-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c7973157f7bc6c0747d015a5e16b71de04777df133d90ff7309c6c9ea0e5578
MD5 52d84d6fa9caafce4d1a9a533b5f0449
BLAKE2b-256 136559dd180da72a38396afdf91e45855f2ddaffd05b82c4554279ff42fe5531

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