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

Create E2E tests for batch jobs #232

Merged
merged 4 commits into from
May 11, 2023
Merged

Create E2E tests for batch jobs #232

merged 4 commits into from
May 11, 2023

Conversation

feedmeapples
Copy link
Contributor

What was changed

Added tests for

temporal workflow terminate --query ...
temporal workflow cancel --query ...
temporal workflow signal --query ...

Why?

proper tests coverage for batch jobs. Needed to add now to address failing CIs here #201

Checklist

  1. Closes

  2. How was this tested:

CI

  1. Any docs updates needed?

tests/workflow_test.go Outdated Show resolved Hide resolved
Comment on lines 209 to 216
w1 := c.GetWorkflowHistory(context.Background(), "1", "", false, enums.HISTORY_EVENT_FILTER_TYPE_ALL_EVENT)
s.True(checkForEventType(w1, enums.EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED), "Workflow 1 should have received a signal")

w2 := c.GetWorkflowHistory(context.Background(), "2", "", false, enums.HISTORY_EVENT_FILTER_TYPE_ALL_EVENT)
s.True(checkForEventType(w2, enums.EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED), "Workflow 2 should have received a signal")

w3 := c.GetWorkflowHistory(context.Background(), "3", "", false, enums.HISTORY_EVENT_FILTER_TYPE_ALL_EVENT)
s.False(checkForEventType(w3, enums.EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED), "Workflow 3 should not have received a signal")
Copy link
Member

Choose a reason for hiding this comment

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

You can use a workflow that waits on a signal and check that it completed. It's a bit cleaner than inspecting the event history.

Copy link
Member

Choose a reason for hiding this comment

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

Same for cancelation above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right!

@feedmeapples feedmeapples merged commit 855c281 into main May 11, 2023
@feedmeapples feedmeapples deleted the e2e-batch-jobs branch May 11, 2023 18:02
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