GithubHelp home page GithubHelp logo

zeebe-test's Introduction

Introduction

The SUT Zeebe is the process automation engine powering Camunda 8.

The Zeebe cluster is deployed with docker-compose, resulting in a standalone gateway and 3 brokers. The gateway ports 9600 and 26500 are exposed to the host machine.

The easiest test case is to check the gateway status, which can be done with a simple HTTP GET request to the gateway health endpoint. The caveat is that the gateway health endpoint has different response for embedded and standalone gateway. The embedded gateway is used by default, and the standalone gateway can be enabled by setting the ZEEBE_STANDALONE_GATEWAY environment variable to true. But the health status is not UP until other brokers are connected to the gateway.

Following that, processes are also tested, including process deployment and process instance creation. Zeebe client zbctl is used to interact with the Zeebe cluster, since it's well maintained and easy to use, compared to the Python clients. Of course, Zeebe gRPC API can also be used, but it requires more effort to implement the client.

The worker is also tested, which is created and running in the background. The worker is terminated after the test cases are executed, by maintaining a list of worker subprocesses.

As examples, The following test cases are implemented in this projects:

  • Zeebe gateway status should be healthy
  • Deploy an empty process and create a process instance
  • Create a process instance with non-existing process
  • Deploy an advanced process and create a process instance
  • Deploy an advanced process and create a process instance without a worker

More details can be found in the test_zeebe.robot file.

Robot Framework is adopted as the test automation framework, due to its simplicity and extensibility.

The project is well structured, and setup with pre-commit hooks, which will run flake8, black, and robotframework-lint. The Makefile is also provided for easy execution for the common tasks.

Libraries and Dependencies

The following libraries and dependencies are used in this project. More details can be found in the pyproject.toml file.

  • poetry: Python dependency management
  • requests: HTTP client
  • robotframework: test automation framework
  • robotframework-lint: linting for Robot Framework
  • flake8: linting for Python
  • black: code formatting for Python
  • pre-commit: git hooks

Instructions

The instructions are tested on MacOS 13.5.2.

Pre-requisites

  • Python (>=3.8.1)
  • Node (>=18)
  • Docker

Quick Start

A single command to install all dependencies, deploy Zeebe cluster, and run the test cases, as well as depose the Zeebe cluster.

make

Test Run

Useful Commands

  1. Setup Python Virtual Environment (will install Poetry and all Python dependencies)
    make setup
    
  2. Deploy Zeebe cluster (requires Docker to be installed)
    make deploy_zeebe
    
  3. Run Robot test
    make test
    
  4. Depose Zeebe
    make depose_zeebe
    

Example Test Report

The test reports are generated in the results directory, and can be viewed in a browser.

zeebe-test's People

Contributors

likair avatar mikkohilpinen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.