Skip to content

Conversation

@rscarvalho
Copy link
Contributor

TL;DR

Adds support for testing SdkDynamicWorkflowTask (dynamic workflows) using SdkTestingExecutor, enabling assertions on their generated DAGs similarly to regular workflows.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

This PR extends SdkTestingExecutor to support dynamic workflows (SdkDynamicWorkflowTask) by wrapping them into a lightweight delegating workflow internally. This allows developers to test the structure and outputs of dynamic workflows using the same mechanisms used to test regular workflows, improving consistency and coverage in unit testing Flyte tasks.

There were no existing issues or tracking requests for this feature — it was implemented to fill a current gap in testing capabilities for dynamic workflows in flytekit-testing.

Tracking Issue

NA

Follow-up issue

NA

@welcome
Copy link

welcome bot commented Apr 30, 2025

Thank you for opening this pull request! 🙌
These tips will help get your PR across the finish line: - Most of the repos have a PR template; if not, fill it out to the best of your knowledge. - Sign off your commits (Reference: DCO Guide).

@rscarvalho rscarvalho force-pushed the rscarvalho/add-dynamic-workflow-testing-support branch from 4e5f640 to 054e2ce Compare April 30, 2025 15:34
}

@Test
public void testDelegatingWorkflow_OddA() {
Copy link
Member

@honnix honnix May 6, 2025

Choose a reason for hiding this comment

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

nit: I think we can keep either OddA or OddB as they are doing the same thing and there isn't much need to have exhaustive tests for of(aConcreteValue % 2 == 0 && bConcreteValue % 2 == 0)) in this case.

@honnix
Copy link
Member

honnix commented May 8, 2025

@rscarvalho Could you please rebase? We fixed the CI issue.

@rscarvalho rscarvalho force-pushed the rscarvalho/add-dynamic-workflow-testing-support branch from 7978853 to 32633e1 Compare May 8, 2025 19:45
@honnix
Copy link
Member

honnix commented May 8, 2025

The last commit was not signed-off. Could you please fix that?

@rscarvalho rscarvalho force-pushed the rscarvalho/add-dynamic-workflow-testing-support branch from 32633e1 to 49defc3 Compare May 8, 2025 19:48
@rscarvalho
Copy link
Contributor Author

There you go, I rebased and signed off all commit!

@honnix honnix enabled auto-merge (squash) May 8, 2025 20:55
auto-merge was automatically disabled May 8, 2025 21:44

Head branch was pushed to by a user without write access

@rscarvalho rscarvalho force-pushed the rscarvalho/add-dynamic-workflow-testing-support branch from 0ffa3c9 to 1bc7fb4 Compare May 8, 2025 21:45
Comment on lines 129 to 131
* @return a new {@link SdkTestingExecutor} instance
*
* <p>Example usage:</p>
* <pre>{@code
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@honnix it seems like there's a conflict between checkstyle's JavadocParagraph module and spotless. When I run mvn verify locally, spotless reformat this snippet to be something like this:

Suggested change
* @return a new {@link SdkTestingExecutor} instance
*
* <p>Example usage:</p>
* <pre>{@code
* @return a new {@link SdkTestingExecutor} instance
* <p>Example usage:
* <pre>{@code

But the lack of that empty line before the <p> tag makes checkstyle very unhappy. Should we remove that module from the checkstyle config?

Copy link
Member

Choose a reason for hiding this comment

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

I will propose a PR to remove checkstyle completely. It has always been creating more troubles than being truly helpful.

Copy link
Member

Choose a reason for hiding this comment

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

We removed checkstyle in #320 . Could you please remove the last commit and rebase again?

Copy link
Member

Choose a reason for hiding this comment

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

I did that for you.

@honnix honnix mentioned this pull request May 9, 2025
8 tasks
honnix added a commit that referenced this pull request May 9, 2025
# TL;DR
Remove checkstyle maven plugin.

## Type
 - [ ] Bug Fix
 - [ ] Feature
 - [ ] Plugin

## Are all requirements met?

 - [x] Code completed
 - [ ] Smoke tested
 - [ ] Unit tests added
 - [ ] Code documentation added
 - [ ] Any pending items have an associated Issue

## Complete description
Checkstyle has always been a pain to use and we can hardly recall it
really helps with anything. In #318, checkstyle disagrees with spotless,
which is very much pointless.

## Tracking Issue
_NA_

## Follow-up issue
_NA_

Signed-off-by: Hongxin Liang <[email protected]>
rscarvalho added 2 commits May 9, 2025 11:05
Addding a javadoc to SdkTestingExecutor

Signed-off-by: Rodolfo Carvalho <[email protected]>
Signed-off-by: Rodolfo Carvalho <[email protected]>
@honnix honnix force-pushed the rscarvalho/add-dynamic-workflow-testing-support branch from 1bc7fb4 to bf04088 Compare May 9, 2025 09:06
@honnix honnix merged commit 1fb4c6a into flyteorg:master May 9, 2025
4 checks passed
@welcome
Copy link

welcome bot commented May 9, 2025

Congrats on merging your first pull request! 🎉

@rscarvalho rscarvalho deleted the rscarvalho/add-dynamic-workflow-testing-support branch May 9, 2025 15:24
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.

2 participants