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

refactor(core): Add more workflow engine tests (no-changelog) #12385

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

netroy
Copy link
Member

@netroy netroy commented Dec 27, 2024

Summary

Workflow engine continues to lack enough tests. This PR is attempt at chipping away code out of the engine into smaller testable methods, and then adding tests for those methods.

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@netroy netroy changed the title refactor(core): Add more workflow engine tests (no-changelog). refactor(core): Add more workflow engine tests (no-changelog) Dec 27, 2024
@netroy netroy force-pushed the more-workflow-engine-tests branch from 9ef188f to 96bb42a Compare December 27, 2024 14:15
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Dec 27, 2024
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 82.08955% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/core/src/WorkflowExecute.ts 82.08% 7 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@despairblue despairblue left a comment

Choose a reason for hiding this comment

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

The extractions make sense and the tests cover the current logic. Good job 💪

* @remarks
* - Metadata from multiple runs is preserved using run indices
* - Existing metadata in runData is preserved and merged with new metadata
* - If no metadata exists or runData is missing, the operation is a no-op
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* - If no metadata exists or runData is missing, the operation is a no-op
* - If no metadata exists, the operation is a no-op

I think runData is always defined and if it isn't that function does not check for that case. Unless I'm misunderstanding the comment.

Copy link

cypress bot commented Dec 27, 2024

n8n    Run #8488

Run Properties:  status check passed Passed #8488  •  git commit 96bb42a38a: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project n8n
Branch Review more-workflow-engine-tests
Run status status check passed Passed #8488
Run duration 04m 42s
Commit git commit 96bb42a38a: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Committer कारतोफ्फेलस्क्रिप्ट™
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 483
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants