| Metadata | Value |
|---|---|
| Status | Active |
| Version | 1.1.0 |
| Last Updated | 2026-09-10 |
| Author | Sangeetha Grantha Team |
| Document Type | Evidence record |
[!NOTE] Historical evidence: results, counts, commands, and observations below belong to the original work described here. The editorial update date is not a new test or corpus verification. For present behavior, use current quality checks.
Several backend service tests are currently failing at runtime. While the compilation issues related to service refactoring (interfaces and constructor changes) have been resolved, the tests fail during execution when using the H2 in-memory database.
The following tests compile but fail at runtime:
EntityResolutionServiceTestImportServiceTestKrithiServiceTestQualityScoringServiceTestTempleScrapingServiceTestWebScrapingServiceTestThe primary cause of failure is the usage of PostgreSQL-specific features in the Data Access Layer (DAL) that are not natively supported or behave differently in H2:
pgEnum (e.g., language_code_enum, musical_form_enum) fail to create or fail during data conversion in H2.Instead of “hacking” H2 to support PostgreSQL features, we should adopt one of the following production-grade testing strategies:
Migrate the test suite to use Testcontainers with a real PostgreSQL 18+ instance. This ensures:
Configure a dedicated PostgreSQL database for testing (e.g., sangita_grantha_test) that is reset before each test run.
modules/backend/api/build.gradle.kts.TestDatabaseFactory.kt to use PostgreSQLContainer.sangita-cli or a compatible migration tool during test setup to keep schema in sync.The decision has been made to defer fixing these tests for H2. Future efforts should focus on migrating the testing infrastructure to use a real PostgreSQL environment via Testcontainers to ensure high-fidelity verification of business logic and data integrity.