From b6e653e1519cf42040dfeacb9d142036d161c6f5 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 8 Nov 2024 21:58:11 +0100 Subject: [PATCH] Add cleanup step to workflow definition reload test Added a cleanup step in the ReloadWorkflowTests to delete the workflow definition and its versions after the test runs. This ensures that the tests do not leave residual data, maintaining a clean state for subsequent tests. --- .../Scenarios/WorkflowDefinitionReload/ReloadWorkflowTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/component/Elsa.Workflows.ComponentTests/Scenarios/WorkflowDefinitionReload/ReloadWorkflowTests.cs b/test/component/Elsa.Workflows.ComponentTests/Scenarios/WorkflowDefinitionReload/ReloadWorkflowTests.cs index 71804fa7cf..12954bd5f9 100644 --- a/test/component/Elsa.Workflows.ComponentTests/Scenarios/WorkflowDefinitionReload/ReloadWorkflowTests.cs +++ b/test/component/Elsa.Workflows.ComponentTests/Scenarios/WorkflowDefinitionReload/ReloadWorkflowTests.cs @@ -70,6 +70,9 @@ public async Task Reloading_AfterUpdatingSourceProvider_ShouldRefreshCaches() // Assert that the workflow definition service finds the updated workflow version. var definitionV2 = await _workflowDefinitionService.FindWorkflowGraphAsync(definitionId, VersionOptions.Latest); Assert.Equal(definitionVersionId2, definitionV2!.Workflow.Identity.Id); + + // Cleanup: Delete the workflow definition and its versions. + await _workflowDefinitionManager.DeleteByDefinitionIdAsync(definitionId, CancellationToken.None); } [Fact]