Skip to content

Use FormFlow for Close Alert journey #1099

Use FormFlow for Close Alert journey

Use FormFlow for Close Alert journey #1099

GitHub Actions / Support UI test results failed Oct 5, 2023 in 0s

Support UI test results ❌

Tests failed

❌ TeachingRecordSystem/tests/TeachingRecordSystem.SupportUi.Tests/TestResults/_fv-az559-343_2023-10-05_14_56_51.trx

85 tests were completed in 24s with 84 passed, 1 failed and 0 skipped.

Test suite Passed Failed Skipped Time
TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.Alert.IndexTests 5✅ 13s
TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.CloseAlert.ConfirmTests 4✅ 17s
TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.CloseAlert.IndexTests 6✅ 1❌ 15s
TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.EditCase.AcceptTests 6✅ 13s
TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.EditCase.IndexTests 6✅ 14s
TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.EditCase.RejectTests 8✅ 18s
TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.IndexTests 3✅ 722ms
TeachingRecordSystem.SupportUi.Tests.PageTests.Persons.IndexTests 6✅ 13s
TeachingRecordSystem.SupportUi.Tests.PageTests.Persons.PersonDetail.AlertsTests 5✅ 16s
TeachingRecordSystem.SupportUi.Tests.PageTests.Persons.PersonDetail.IndexTests 3✅ 11s
TeachingRecordSystem.SupportUi.Tests.PageTests.Users.AddUser.ConfirmTests 8✅ 10s
TeachingRecordSystem.SupportUi.Tests.PageTests.Users.AddUser.IndexTests 7✅ 8s
TeachingRecordSystem.SupportUi.Tests.PageTests.Users.EditUserTests 14✅ 16s
TeachingRecordSystem.SupportUi.Tests.PageTests.Users.UsersTests 3✅ 9s

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.Alert.IndexTests

✅ Get_ValidRequest_RendersExpectedContent(startDateString: "2021-01-01", endDateString: "2022-03-05", isSpent: True, isActive: False, expectedAlertStatus: Inactive)
✅ Get_ValidRequest_RendersExpectedContent(startDateString: "2021-01-01", endDateString: "2022-03-05", isSpent: True, isActive: True, expectedAlertStatus: Closed)
✅ Get_ValidRequest_RendersExpectedContent(startDateString: "2021-01-01", endDateString: null, isSpent: False, isActive: False, expectedAlertStatus: Inactive)
✅ Get_ValidRequest_RendersExpectedContent(startDateString: "2021-01-01", endDateString: null, isSpent: False, isActive: True, expectedAlertStatus: Active)
✅ Get_WithAlertIdForNonExistentAlert_ReturnsNotFound

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.CloseAlert.ConfirmTests

✅ Get_StateHasNoEndDate_RedirectsToIndex
✅ Get_ValidRequest_RendersExpectedContent
✅ Get_WithAlertIdForNonExistentAlert_ReturnsNotFound
✅ Post_ValidRequest_ClosesAlertAndCompletesJourney

❌ TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.CloseAlert.IndexTests

✅ Get_ValidRequestWithEndDateInJourneyState_PopulatesEndDateFromJourneyState
❌ Get_WithAlertIdForActiveAlert_ReturnsOk
	System.InvalidOperationException : A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
✅ Get_WithAlertIdForEndedAlert_ReturnsNotFound
✅ Get_WithAlertIdForNonExistentAlert_ReturnsNotFound
✅ Post_EmptyEndDate_ReturnsError
✅ Post_EndDateBeforeStartDate_ReturnsError
✅ Post_ValidEndDate_RedirectsToConfirmPage

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.EditCase.AcceptTests

✅ Get_WhenUserDoesNotHaveHelpdeskOrAdministratorRole_ReturnsForbidden
✅ Get_WhenUserHasNoRoles_ReturnsForbidden
✅ Get_WithTicketNumberForInactiveIncident_ReturnsBadRequest
✅ Get_WithTicketNumberForNonExistentIncident_ReturnsNotFound
✅ Post_ValidRequest_RedirectsWithFlashMessage
✅ Post_WhenUserDoesNotHaveHelpdeskOrAdministratorRole_ReturnsForbidden

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.EditCase.IndexTests

✅ Get_UserWithNoRoles_ReturnsForbidden
✅ Get_UserWithoutHelpdeskOrAdministratorRole_ReturnsForbidden
✅ Get_WithTicketNumberForActiveDateOfBirthChangeIncident_RendersExpectedContent
✅ Get_WithTicketNumberForActiveNameChangeIncident_RendersExpectedContent
✅ Get_WithTicketNumberForInactiveIncident_ReturnsBadRequest
✅ Get_WithTicketNumberForNonExistentIncident_ReturnsNotFound

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.EditCase.RejectTests

✅ Get_WhenUserDoesNotHaveHelpdeskOrAdministratorRole_ReturnsForbidden
✅ Get_WhenUserHasNoRoles_ReturnsForbidden
✅ Get_WithTicketNumberForInactiveIncident_ReturnsBadRequest
✅ Get_WithTicketNumberForNonExistentIncident_ReturnsNotFound
✅ Post_WhenRejectionReasonChoiceHasNoSelection_ReturnsError
✅ Post_WhenRejectionReasonChoiceIsChangeNoLongerRequired_RedirectsWithFlashMessage
✅ Post_WhenRejectionReasonChoiceIsNotChangeNoLongerRequired_RedirectsWithFlashMessage
✅ Post_WhenUserDoesNotHaveHelpdeskOrAdministratorRole_ReturnsForbidden

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Cases.IndexTests

✅ Get_UserWithNoRoles_ReturnsForbidden
✅ Get_ValidRequest_RendersExpectedContent
✅ Get_ValidRequestNoActiveCases_RendersExpectedContent

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Persons.IndexTests

✅ Get_WithEmptySearchParameter_DisplaysSearchFormOnly
✅ Get_WithNoQueryParameters_DisplaysSearchFormOnly
✅ Get_WithSearchQueryParameterWithNoMatches_DisplaysNoMatches
✅ Get_WithSearchThatLooksLikeADate_DisplaysMatchesOnDateOfBirth
✅ Get_WithSearchThatLooksLikeAName_DisplaysMatchesOnName
✅ Get_WithSearchThatLooksLikeATrn_DisplaysMatchOnTrn

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Persons.PersonDetail.AlertsTests

✅ Get_WithPersonIdForNonExistentPerson_ReturnsNotFound
✅ Get_WithPersonIdForPersonWithCurrentAndPreviousAlerts_DisplaysExpectedContent
✅ Get_WithPersonIdForPersonWithNoAlerts_DisplaysNoCurrentAlerts
✅ Get_WithPersonIdForPersonWithOnlyCurrentAlerts_DisplaysExpectedContent
✅ Get_WithPersonIdForPersonWithOnlyPreviousAlerts_DisplaysExpectedContent

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Persons.PersonDetail.IndexTests

✅ Get_WithPersonIdForExistingPersonWithAllPropertiesSet_ReturnsExpectedContent
✅ Get_WithPersonIdForExistingPersonWithMissingProperties_ReturnsExpectedContent
✅ Get_WithPersonIdForNonExistentPerson_ReturnsNotFound

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Users.AddUser.ConfirmTests

✅ Get_UserIdDoesNotExist_ReturnsNotFound
✅ Get_UserWithoutAdministratorRole_ReturnsForbidden
✅ Get_ValidRequest_RendersExpectedContent
✅ Post_NoName_RendersError
✅ Post_NoRolesSelected_RendersError
✅ Post_UserIdDoesNotExist_ReturnsNotFound
✅ Post_UserWithoutAdministratorRole_ReturnsForbidden
✅ Post_ValidRequest_CreatesUserEmitsEventAndRedirectsWithFlashMessage

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Users.AddUser.IndexTests

✅ Get_UserWithoutAdministratorRole_ReturnsForbidden
✅ Get_WithAdministratorUser_ReturnsOk
✅ Post_EmailDoesNotHaveSuffix_AppendsEducationSuffixBeforeSearching
✅ Post_NoEmailEntered_RendersErrorMessage
✅ Post_UserFound_RedirectsToConfirmPage
✅ Post_UserNotFound_RendersErrorMessage
✅ Post_UserWithoutAdministratorRole_ReturnsForbidden

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Users.EditUserTests

✅ Get_UserIdDoesNotExist_ReturnsNotFound
✅ Get_UserWithOutAdministratorRole_ReturnsForbidden
✅ Get_ValidRequest_RendersExpectedContent
✅ Post_NoName_RendersError
✅ Post_NoRolesSelected_RendersError
✅ Post_UserExistsButIsAlreadyActive_ReturnsBadRequest
✅ Post_UserExistsButIsAlreadyDeactivated_ReturnsBadRequest
✅ Post_UserIdDoesNotExist_ReturnsNotFound
✅ Post_UserWithoutAdministratorRole_ReturnsForbidden
✅ Post_ValidRequest_ActivatesUsersEmitsEventAndRedirectsWithFlashMessage
✅ Post_ValidRequest_CreatesUserEmitsEventAndRedirectsWithFlashMessage(changeName: False, changeRoles: True, expectedEvent: True, expectedChanges: Roles)
✅ Post_ValidRequest_CreatesUserEmitsEventAndRedirectsWithFlashMessage(changeName: True, changeRoles: False, expectedEvent: True, expectedChanges: Name)
✅ Post_ValidRequest_CreatesUserEmitsEventAndRedirectsWithFlashMessage(changeName: True, changeRoles: True, expectedEvent: True, expectedChanges: Name | Roles)
✅ Post_ValidRequest_DeactivatesUsersEmitsEventAndRedirectsWithFlashMessage

✅ TeachingRecordSystem.SupportUi.Tests.PageTests.Users.UsersTests

✅ Get_UserWithAdministratorRole_ReturnsOk
✅ Get_UserWithOutAdministratorRole_ReturnsForbidden
✅ Get_ValidRequestAndUsersFound_RendersUsers

Annotations

Check failure on line 88 in TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Infrastructure/FormFlow/DbUserInstanceStateProvider.cs

See this annotation in the file changed.

@github-actions github-actions / Support UI test results

TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.CloseAlert.IndexTests ► Get_WithAlertIdForActiveAlert_ReturnsOk

Failed test found in:
  TeachingRecordSystem/tests/TeachingRecordSystem.SupportUi.Tests/TestResults/_fv-az559-343_2023-10-05_14_56_51.trx
Error:
  System.InvalidOperationException : A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
Raw output
System.InvalidOperationException : A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
   at Microsoft.EntityFrameworkCore.Infrastructure.Internal.ConcurrencyDetector.EnterCriticalSection()
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at TeachingRecordSystem.SupportUi.Infrastructure.FormFlow.DbUserInstanceStateProvider.GetInstanceAsync(JourneyInstanceId instanceId, Type stateType) in /home/runner/work/teaching-record-system/teaching-record-system/TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Infrastructure/FormFlow/DbUserInstanceStateProvider.cs:line 88
   at FormFlow.JourneyInstanceProvider.ResolveCurrentInstanceAsync(ActionContext actionContext) in /home/runner/work/teaching-record-system/teaching-record-system/TeachingRecordSystem/lib/formflow/src/FormFlow/JourneyInstanceProvider.cs:line 287
   at FormFlow.Filters.ActivateInstanceFilter.OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next) in /home/runner/work/teaching-record-system/teaching-record-system/TeachingRecordSystem/lib/formflow/src/FormFlow/Filters/ActivateInstanceFilter.cs:line 35
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Joonasw.AspNetCore.SecurityHeaders.Csp.CspMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.TestHost.HttpContextBuilder.<>c__DisplayClass23_0.<<SendAsync>g__RunRequestAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.TestHost.ClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at TeachingRecordSystem.SupportUi.Tests.PageTests.Alerts.CloseAlert.IndexTests.Get_WithAlertIdForActiveAlert_ReturnsOk() in /home/runner/work/teaching-record-system/teaching-record-system/TeachingRecordSystem/tests/TeachingRecordSystem.SupportUi.Tests/PageTests/Alerts/CloseAlert/IndexTests.cs:line 60