Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System tests for transforms #2242

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Nov 22, 2024

Check that transforms can work properly once installed, after documents are ingested. It ensures that the transform is executed at least once while monitoring its behaviour and looks for failures in transform stats and audit messages.

It doesn't check the validity of documents by now, we do this with the preview API, maybe in a future change we can do this validation at this point too, with real documents.

These tests would be intended to earlier prevent issues like the ones mentioned in #2218.

Fixes #859

@jsoriano jsoriano self-assigned this Nov 22, 2024
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 22, 2024

💔 Build Failed

Failed CI Steps

History

cc @jsoriano

running := false

// Reset transform to clean any previous state.
/* XXX: It fails to create the index after reset :?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing now because it tries to create indexes with a name that is matched by a data stream template, and transforms need to use indexes, not data streams.

⚠️ This may be an actual issue because this means that the reset API breaks these transforms. We may need to review how transform indexes are named in packages to avoid these conflicts.


func (r *tester) checkTransformAuditMessages(ctx context.Context, transformId string) error {
// XXX: This is an internal API, are these audit messages available somewhere else?
const internalTransformsPath = "/internal/transform/transforms"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have found that some failures only appear in the audit messages, but these messages seem to be available only on internal APIs, that I guess don't have compatibility guarantees, nor will be available in all deployments.

We have to look for some other API.

@kpollich do you know how safe these internal APIs are to use? Or do you know if there are alternatives?

Though the errors found here also make the transform to fail with real-time data, so maybe this is an issue with test data that is discarded by being old. Then we'd have to review the test data too.

@jsoriano
Copy link
Member Author

test integrations

@elastic-vault-github-plugin-prod

Created or updated PR in integrations repository to test this version. Check elastic/integrations#11831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test transforms
2 participants