Skip to content

Create an openfn test runner #1315

@josephjclark

Description

@josephjclark

This is a lightweight new Runtime Manager which wraps the compiler and runtime into an API that's convenient for automated testing.

Test runner might not be the right name. It might just be like a lightweight runtime.

I want something like this:

import exec from `@openfn/test-runner`

const result = await exec(workflow, options)

The idea is I can pass in a workflow to execute in any format - a js file, a JSON workflow, a yaml project (@openfn/project can help to load the input into something executable) - and it'll be executed with the options I give.

It returns the final state object as JSON.

Maybe it includes an event emitter hook, so that users can catch any runtime events - step start/complete notifications, logs, etc.

Options includes input state, credential values.

The package might also export some test utilities, like maybe some asserting and mocking APIs

It should auto-install adaptors I guess. Alternatively it could rely on being wrapped in an npm project, and import adaptors from there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Tech Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions