Integration tests - #141
Merged
Merged
Conversation
Added documentation for the NAM Backend Integration Test Agent, outlining the scope, requirements, and standards for integration tests.
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
…-environment-again Integration tests - Add persistence coverage for core municipality entities
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Co-authored-by: AntoMars14 <155200677+AntoMars14@users.noreply.github.com>
Add HTTP integration coverage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a minimal, robust integration testing setup for the backend, focusing on HTTP-level API and database persistence tests. It establishes clear guidelines for integration test scope and structure, adds foundational test infrastructure, and migrates existing tests to NUnit for consistency and maintainability.
Integration test infrastructure and guidelines:
.github/agents/backend-integrationtests-agent.md: Added a comprehensive agent profile and requirements document, specifying integration test scope, placement, standards, and determinism rules for backend API and database testing.API integration tests:
ServerTests/Integration/Api/BasicReachabilityTests.cs: Introduced a basic HTTP-level API integration test usingNamTestFactoryand NUnit to verify the/healthendpoint is reachable and returns 200 OK.ServerTests/Integration/Shared/NamTestFactory.cs: Added a customWebApplicationFactoryimplementation for test server setup, using SQLite in-memory database and test authentication, to support stable, isolated API integration tests.ServerTests/Integration/Shared/TestAuthHandler.cs: Implemented a test authentication handler to enable fake user authentication in integration tests.Database integration tests:
ServerTests/Integration/Database/PersistenceTests.cs: Added database integration tests using SQLite in-memory, verifying persistence and retrieval of various entities (User,MapMarker,MapData,MunicipalityCard) across contexts.Test framework consistency:
ServerTests/NamServer/Endpoints/Auth/AuthLoginTests.cs,ServerTests/NamServer/Endpoints/Auth/RegistrationTests.cs: Migrated existing MSTest-based tests to NUnit, updating attributes and assertions for consistency; removed MSTest parallelization settings. [1] [2] [3] [4] [5]These changes lay the foundation for reliable backend integration testing, ensuring coverage at the HTTP boundary and database layer, and enforcing consistent test standards across the codebase.