-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add a test for PurgeAllInstancesAsync #3021
base: dev
Are you sure you want to change the base?
Conversation
- Fix bug with PurgeOrchestrationHistory relating to null start date
Assert.Matches(responseRegex, actualMessage); | ||
Assert.Equal(expectedStatusCode, response.StatusCode); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other test cases that we can add? Maybe a test to cover the changes you made in ProtobufUtils.cs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test actually does cover that case - starttime is null in the function app code for this test, and before my change, it threw instead of returning.
Would love to add more tests, though. I think a good set to start with would be
- A test with empty end date
- A test with a start and end date
- Purging from (now + 1 minute) to (now + 1 day) should delete 0 records
- Starting an orchestration, then purging from >1 day ago should not purge the new orchestration's history
- Starting an orchestration, waiting for it to complete, then purging all history should delete that orchestration's history
Does this seem reasonable? Other scenarios I should cover? @bachuv @cgillum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me. For the last three bullets, I remember Chris has a sample test for reference, I also referred to this when adding purge test at DTS
Issue describing the changes in this PR
resolves #2702
Pull request checklist
pending_docs.md
release_notes.md
/src/Worker.Extensions.DurableTask/AssemblyInfo.cs
dev
andmain
branches and will not be merged into thev2.x
branch.