Repository navigation
COG-1142: W0 smoke suite — signup, login, logout, remember-me (MockMvc) - #109
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…member-me) on the canonical Testcontainers harness Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
abaea96 to
a7c02aa
Compare
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 MySQL 8 database connections fail
On MySQL 8, removing mysql.version restores Boot's Connector/J 5.1.42. That driver queries the removed query_cache_size variable, so UserFront cannot connect.
|
Re: Devin Review "MySQL 8 database connections fail" ( |
…s (COG-1179) Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
Summary
W0 regression contract for the Boot 1.5.4 → 4.1 migration:
AuthSmokeTest, a MockMvc smoke suite for signup, form login, logout and remember-me. It adds one test file and changes nothing undersrc/main.Stacked on #335 (COG-1141, the canonical Testcontainers harness). The base branch is
devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154, so the diff shows only this ticket's test. I'll retarget it tomasterwhen #335 merges.Changes from the earlier revision:
AbstractIntegrationTest, thepom.xmlTestcontainers dep, themysql.version5.1.49 bump and theUserFrontApplicationTestsedit are all dropped. COG-1141: Testcontainers MySQL harness for @SpringBootTest (Boot 1.5.4 / Java 8) #335 now owns those.AuthSmokeTest extends AbstractIntegrationTestand uses the inheritedprotected MockMvc mockMvc.authsmoke-user/authsmoke-user@[REDACTED SECRET].com(COG-1144 also usedsmokeuser, and the two collided in one JVM).AccountServiceImpl.nextAccountNumberis a static int that ignores existing rows, so if accounts with the next numbers are already committed, signup'sfindByAccountNumberthrowsNonUniqueResultException. The@Beforenow moves the counter past the highest committed account number (test-side only, viaReflectionTestUtils; the counter only moves forward):@Transactional, so each test's user/accounts roll back and nothing leaks into sibling suites.What the suite asserts (today's behaviour):
POST /signupstores a$2a$BCrypt hash, oneROLE_USERand both accounts. These are re-read from the DB afterflush()/clear().POST /indexredirects to/userFront; a bad password redirects to/index?error.GET /logoutredirects to/index?logoutand expiresremember-me. The test uses GET on purpose: it proveslogoutRequestMatcherstill allows GET once W2 turns CSRF on.remember-me=onissues a cookie that authenticates a fresh session. That cookie still authenticates after logout (token-based remember-me). The test records this; it doesn't endorse it.Verification
Temurin 1.8.0_504 and Docker only (no local MySQL).
All four W0 smoke suites in one JVM. Test files copied in uncommitted, unmodified, from COG-1143
3c92928(MoneyMovementSmokeTest), COG-114490a5636(AppointmentSmokeTest) and COG-11453da5d40(AdminRestSmokeTest,golden/*, fixtures). Command:mvn -B -f UserFront/pom.xml clean verify -Dsurefire.runOrder=<order>alphabetical:reversealphabetical(MoneyMovement runs before Auth):Counter-collision guard, forced. A throwaway local test (not committed), ordered first, commits primary and savings accounts at
nextAccountNumber + 1..4and thenAuthSmokeTestruns:AuthSmokeTest(a7c02aa):Tests run: 5, Failures: 4withIncorrectResultSizeDataAccessException/NonUniqueResultException: result returns more than one elements, BUILD FAILURETests run: 5, Failures: 0, BUILD SUCCESSTicket: COG-1142
Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/2aa363754ec043a3b0798775bb8b94dd
Open in Devin Desktop: https://app.devin.ai/desktop/session/2aa363754ec043a3b0798775bb8b94dd?variant=devin
Requested by: @patrickbradley-cog
Devin Review