GithubHelp home page GithubHelp logo

workflow-cicd's Introduction

Conductor Workflow Testing Guide

Unit and Regression testing workflows

Unit Tests

Conductor workflows can be unit tested using POST /workflow/test endpoint. The approach is similar to how you unit test using Mock objects in Java or similar languages.

Why Unit Test Workflows?

Unit tests allows you to test for the correctness of the workflow definition ensuring:

  1. Given a specific input workflow reaches the terminal state in COMPLETED or FAILED state
  2. Given a specific input, the workflow executes specific set of tasks. This is useful for testing branching and dynamic forks
  3. Task inputs are wired correctly - e.g. if a task receives its input from the output of another task, this can be verified using the unit test.

Unit Testing Workflows

Java SDK provides the following method that allows testing a workflow definition against mock inputs:

    public abstract Workflow testWorkflow(WorkflowTestRequest testRequest);

The actual workflow is executed on a real Conductor server ensuring you are testing the behavior that will match the ACTUAL executon of the server.

Setting up Conductor server for testing

Tests can be run against a remote server (useful when running integration tests) or local containerized instance. Recommended approach is to use testcontainers.

Examples

Unit Test

Regression Test

Workflows can be regression tested with golden inputs and outputs. This approach is useful when modifying workflows that are running in production to ensure the behavior remains correct.

See RegressionTest.java for an example, which uses previously captured workflow execution as golden input/output to verify the workflow execution.

workflow-cicd's People

Contributors

v1r3n 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.