Fixed test framework - #82
Conversation
|
Hi @axymthr plz review the changes for test framework, as lot of things we have to mocked so i created a saperate local yml for local setup and application.yml is as it is, also we disable/remove postgress test container and flyway as well. |
|
Hi @anuragSharma1112 why does this PR contain non-test framework related changes? Please raise a separate PR for functional changes. |
|
|
||
| @Service | ||
| @Profile({"dev", "test"}) | ||
| @Profile({"dev", "local"}) |
There was a problem hiding this comment.
Why do we need a 'local' profile?
There was a problem hiding this comment.
Hi @axymthr
We are implementing a 'local' profile to enforce a clean separation between our development and production environments. The main application.yml file will remain our single source of truth for production configuration, ensuring stability and security for our live system. The local profile allows us to override this configuration specifically for testing purposes—using an in-memory SQLite database instead of PostgreSQL, mocking external services like Azure OAuth with hardcoded values, and disabling non-essential components like database migrations. This approach eliminates dependencies on external systems during testing, speeds up development cycles by making tests faster and more reliable, and completely prevents any risk of production configuration being compromised during development activities.
There was a problem hiding this comment.
That wasn't part of the scope for this ticket, please remove all "local" profile changes from this PR.
The standard "local" profile supported by Spring Boot is "dev". We need an application-dev.yml. The prod profile is already is application-prod.yml.
There was a problem hiding this comment.
Revert this change, it doesn't run during tests. We need an app runner to maintain compatibility with Postgresql.
|
|
||
| @SpringBootTest(classes = {WiremockMailServiceImpl.class, TestRestTemplateConfig.class}) | ||
| @ActiveProfiles("local") | ||
| @TestPropertySource(properties = { |
There was a problem hiding this comment.
Move these to application-test.yml or another test specific config file
| @SpringBootTest | ||
| @ActiveProfiles("test") | ||
| @Import(TestcontainersConfiguration.class) | ||
| @ActiveProfiles("local") |
There was a problem hiding this comment.
Why is this test running in a local profile? The default profile would be "test" which should be sufficient
| docker: | ||
| compose: | ||
| lifecycle-management: start_only | ||
| profiles: |
There was a problem hiding this comment.
Remove from this PR, it is the wrong way to do it anyway.
|
|
||
| @Service | ||
| @Profile({"dev", "test"}) | ||
| @Profile({"dev", "local"}) |
There was a problem hiding this comment.
That wasn't part of the scope for this ticket, please remove all "local" profile changes from this PR.
The standard "local" profile supported by Spring Boot is "dev". We need an application-dev.yml. The prod profile is already is application-prod.yml.
Description
Fix all the 26 Test cases, remove Test Container and use SQLite instead.
Fixes # (issue)
Test cases along with the new yml that will fix DEV profile (local running) issue as well.
For:
#77 #75
Please delete options that are not relevant.
How Has This Been Tested?
Checklist:
Screenshots (for UX changes):
NA
Additional Notes:
NA