Skip to content

Harden integration-test setup and verification helpers #1758

Closed

Description

@StuartFerguson

Summary

Improve the robustness of the SecurityService.IntegrationTesting.Helpers and related integration-test steps so setup failures and incomplete assertions are detected instead of allowing scenarios to continue with invalid state.

Included changes

  • Enforce requested step counts in collection/table-based integration steps.
  • Verify created API scopes, API resources, clients, identity resources, roles, and users by reading them back from the service.
  • Compare persisted fields and nested collections, including exact collection counts and duplicate detection where applicable.
  • Validate all configured users in the MFA scenario.
  • Validate existing OpenID Connect identity resources instead of silently accepting same-name resources with different configuration.
  • Propagate supplied cancellation tokens through read operations.
  • Harden integration certificate cleanup for partial creation and disposal failures so cleanup does not mask the original failure.

Verification

  • dotnet build SecurityService.IntegrationTests\SecurityService.IntegrationTests.csproj --no-restore -v minimal
  • dotnet build SecurityService.OpenIdConnect.IntegrationTests\SecurityService.OpenIdConnect.IntegrationTests.csproj --no-restore -v minimal
  • git diff --check

Both builds succeeded. Runtime Docker-backed integration tests were not run as part of this change.

Follow-up

  • Resolve existing package vulnerability warnings and nullable warnings separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions