opensearch-project / opensearch-project/flow-framework

[META] Build a configuration-as-code test system to cover gaps in unit/integ testing

Open
#833 0 comments 0 reactions 1 assignee View on GitHub

@junweid62 is already working on this.

Since Aug 13, 2024.

enhancement Meta
Dominant language
Java
Stars
62
Forks
66
Avg merge
3d 20h
Merged PRs (30d)
20

Description

Is your feature request related to a problem?

This is a more specific plan to implement https://github.com/opensearch-project/flow-framework/issues/795

Flow Framework templates are essentially a configuration-as-code implementation, conceptually not much different than sequencing method calls with the appropriate method/function names (workflow steps) and arguments (required and optional parameters).

Unit and integration tests cover the foundational elements of Flow Framework but are completely lacking in testing the templates themselves. Other than "sanity testing" templates when they are first written and spot checking each relesae, there is no automation to ensure that future changes to their implemented APIs don't break them (such as the addition of a new required parameter, which happened just before the 2.14.0 release).

While https://github.com/opensearch-project/flow-framework/issues/651 can help mitigate some issues with specific APIs, it's the equivalent of "unit testing". In addition to that requirement, we need an equivalent of end-to-end "integration testing" of templates; validating that they execute all their workflow steps and pass the appropriate data to each other.

Further, we need to validate that the expected return values (including error status codes) match what users expect, and permit front-end developers to rely on a documented API to build applications around.

What solution would you like?

OpenSearch has recently migrated its API specification to the OpenAPI format, published at https://github.com/opensearch-project/opensearch-api-specification. As part of this specification, there is a robust testing framework and an open issue to document and test plugin specifications.

This framework is an ideal way to test our use case templates.

It's also a significant effort that needs to start small and build up to eventually reach the goal of fully testing all use case templates. Here are the steps that are needed to reach this goal:

What alternatives have you considered?

Continuing our manual sanity testing when first written, and our laborious bug fixing when we inevitably miss changes because we're human.

Do you have any additional context?

While this issue is focused on testing existing workflow steps and templates, the components built to enable this will also be extremely useful in expanding Flow Framework functionality in the future by allowing more generic execution of any documented OpenSearch API.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.