Repository navigation
COG-1141: Testcontainers MySQL harness for @SpringBootTest (Boot 1.5.4 / Java 8) - #335
Open
patrickbradley-cog wants to merge 4 commits into
Conversation
…4 / Java 8) Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
|
GitHub Actions CI evidence (COG-1149 workflow from #329). The throwaway draft #342 was this branch plus #329's Job
|
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.
Linear: COG-1141
Summary
This is the canonical Testcontainers MySQL harness: with it,
mvn verifyruns with only Docker and no local MySQL. Boot stays on 1.5.4 and Java on 8.com.userFront.AbstractIntegrationTest, with javadoc marking it as the entry point for the smoke suite:UserFrontApplicationTestsnow simplyextends AbstractIntegrationTest.@AutoConfigureMockMvc, the inheritedprotected MockMvc mockMvc, andspring-security-teston the test classpath. Those PRs can rebase by deleting their ownAbstractIntegrationTestand pom entries.spring.datasource.*property, so it also satisfies COG-1158 (COG-1158: Move datasource credentials to DB_USER/DB_PASSWORD env vars #333)spring.datasource.password=${DB_PASSWORD}and its fail-fast check.Non-obvious choices
mysql:5.7.44, not the ticket's 8.0 default. The Boot 1.5 BOM ships Connector/J 5.1.42, which fails against MySQL 8 (Unknown system variable 'query_cache_size') and cannot docaching_sha2_password. Move to 8.0 together with the W3 Connector/J bump (COG-1148 owns the version decision). This PR does not touch runtime dependencies. You can override the image without a code change:-Dtest.mysql.image=....useSSL=falseis appended to the JDBC URL. Current Temurin 8 builds disable TLSv1/1.1, and that is what Connector/J 5.1 negotiates.client version 1.32 is too old). When neitherapi.versionnorDOCKER_API_VERSIONis set, the base class setsapi.version = min(1.44, daemon max). The daemon max comes fromdocker [--context default] version --format {{.Server.APIVersion}}.--context defaultis only added whenDOCKER_HOSTis unset, so the CLI queries the same endpoint Testcontainers uses. If there is no CLI, it falls back to 1.44. Docker 24 (API 1.43) keeps working.org.testcontainers:junitdoes not exist on Maven Central (404). JUnit 4 support ships in the coreorg.testcontainers:testcontainersartifact, so that is what the pom declares, with an explicit1.19.7likeorg.testcontainers:mysql.Verification (Temurin 8u504, Docker only, nothing listening on :3306)
Tests run: 1, Failures: 0, BUILD SUCCESS. The GitHub Actions run of COG-1149: W0 · GitHub Actions workflow running mvn verify on every PR #329's Temurin 8 workflow is on the throwaway draft [throwaway, do not merge] COG-1141 harness x COG-1149 CI workflow probe #342, which will be closed and not merged.dockerCLI that prints 1.43: every request went toGET /v1.43/...and the build passed.Sibling compatibility check: I copied the smoke tests from #106 (
MoneyMovementSmokeTest), #108 (AppointmentSmokeTest) and #109 (AuthSmokeTest) unchanged onto this branch, without theirAbstractIntegrationTestcopies. All three compile against this harness.The
AuthSmokeTestfailures come from test data, not the harness. All classes share one container and one cached context. #108 commits a usersmokeuser, and #109 then tries to sign up the same username./signupreturns 200 ("user exists") where the test expects a redirect. One of those PRs needs to use unique usernames when it rebases.Link to Devin session: https://app.devin.ai/sessions/4e949844d05d4a1a92421b67076d0628
Open in Devin Desktop: https://app.devin.ai/desktop/session/4e949844d05d4a1a92421b67076d0628?variant=devin
Requested by: @patrickbradley-cog
Devin Review