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 unit tests for Workflow.ts (no-changelog) #9868

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

netroy
Copy link
Member

@netroy netroy commented Jun 26, 2024

Summary

Extracted out of #9858

Review / Merge checklist

  • PR title and summary are descriptive
  • Tests included

@netroy netroy requested a review from despairblue June 26, 2024 09:56
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jun 26, 2024
…abled nodes

1. ignore a node that would otherwise make the function return true
2. disable a node that would make the function return true if it wasn't
disabled
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.

I have one question, the other 2 things I already resolved with a commit.

packages/workflow/test/Workflow.test.ts Outdated Show resolved Hide resolved
packages/workflow/test/Workflow.test.ts Outdated Show resolved Hide resolved
nodeTypes,
});

const issues = workflow.checkReadyForExecution({ startNode: disabledNode.name });
Copy link
Contributor

Choose a reason for hiding this comment

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

You're given a startNode in multiple tests here, but no destinationNode.
All these tests would also work if we didn't pass the start node. So I assume it's to be able to test the branch that calls getChildNodes.
Would it make sense to change one of these tests to pass destinationNode so that we also cover getParentNodes?

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 think we should add a separate group of tests for destinationNode.
But, I can do that in the next PR adding tests for Workflow.

Copy link

cypress bot commented Jun 27, 2024

4 flaky tests on run #5690 ↗︎

0 395 0 0 Flakiness 4

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project: n8n Commit: b0157549d9
Status: Passed Duration: 04:51 💡
Started: Jun 27, 2024 9:08 AM Ended: Jun 27, 2024 9:12 AM
Flakiness  5-ndv.cy.ts • 2 flaky tests

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Screenshots Video
NDV > Stop listening for trigger event from NDV Screenshots Video
Flakiness  12-canvas.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Canvas Node Manipulation and Navigation > should preserve connections after rename & node-view switch Test Replay Screenshots Video
Flakiness  2-credentials.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Credentials > should show multiple credential types in the same dropdown Test Replay Screenshots Video

Review all test suite changes for PR #9868 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy merged commit 9454a85 into master Jun 27, 2024
30 checks passed
@netroy netroy deleted the Workflow-tests branch June 27, 2024 09:21
@janober
Copy link
Member

janober commented Jun 27, 2024

Got released with n8n@1.48.0

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 Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants