entur / tiamat

Module also known as the backend for Stop Place Register ("nasjonalt stoppestedregister - nsr")
https://stoppested.entur.org
European Union Public License 1.2
15 stars 7 forks source link

Use Testcontainers for Integration testing instead of H2 #147

Closed assadriaz closed 11 months ago

assadriaz commented 11 months ago

This pull request introduces Testcontainers to replace the H2 in-memory database for integration testing purposes. Testcontainers provides a more robust and realistic testing environment by running actual database containers.

Changes Made

Database Replacement: Replaced the H2 in-memory database with Testcontainers. Improved Testing Environment: Utilized Testcontainers to create Dockerized instances of the database for integration tests. Realistic Integration Tests: Ensures that integration tests are conducted in an environment more closely resembling the production database setup. Dependencies: Added necessary dependencies for Testcontainers integration. CircleCI: Updated CircleCI config to run docker test contains ActiveMQ: Minor Moved activemq jms changlelog bean from test to main, this will help to run tiamat without google pubsub XerceImple**: Updated xercesImpl version from 2.12.0.SP03-RB to 2.12.2. Note 2.12.0.SP03-RB was note an official version and note available in maven central. This will help external user to compile tiamat without Entur specific dependencies. How to Test

Ensure Docker is installed on your machine.

Additional Notes

This change enhances the reliability and accuracy of integration tests. Testcontainers provides a convenient way to manage and use Docker containers during testing. Some test has been updated and ignored. Flyway script has been updated. Requires manual update in database to deploy this version

sonarcloud[bot] commented 11 months ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

40.0% 40.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint