Skip to content

[Phase 2] Regression suite on Java 21 / Boot 3.5 + Next 15: REST/GraphQL/repository/migration/serialization/unit tests, frontend Vitest regression, Selenium critical path, regression.yml - #231

Merged
devin-ai-integration[bot] merged 3 commits into
devin/1791491209-modernization-integrationfrom
devin/1791491209-modernization-regression-suite
Oct 8, 2026
Merged

devin-ai-integration[bot] merged 3 commits into
devin/1791491209-modernization-integrationfrom
devin/1791491209-modernization-regression-suite

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Summary

Cross-cutting regression suite (session 6), now rebased onto the fully migrated integration branch (Java 21 / Boot 3.5.16 / jakarta / DGS 10 / java.time + Next 15 / React 19 / Vitest 5). Three commits, no production code (src/main/**), no build.gradle / gradle.yml / frontend config changes, no existing test files touched.

Backend (src/test/java/io/spring/regression/**, selenium/**) — 181 new JUnit 5 tests on top of the other sessions' 203 → 384 tests, 0 failures, 94.2% JaCoCo instruction coverage (threshold 0.80 untouched, no new exclusions):

  • regression/RegressionIntegrationTestBase: @SpringBootTest(RANDOM_PORT) + REST-Assured against the real SQLite DB with the Flyway seed; fresh file-backed DB per class via @DynamicPropertySource (build/regression-db/regression-<uuid>.db), port via @Value("${local.server.port}").
  • regression/rest/*ContractTest + SecurityMatrixTest: every REST endpoint (status, envelope, field types, 422 field errors, 404, malformed JSON, ownership 403) and the 401/403 matrix (missing header, Token/Bearer/raw/empty/garbage/tampered/unknown-subject tokens).
  • regression/graphql/GraphqlContractTest: Query/Mutation introspection, queries/mutations, cursor pagination, filters, auth errors, malformed documents.
  • regression/repository/*, regression/migration/FlywayMigrationTest, regression/serialization/JsonSerializationTest, regression/unit/*: CRUD/constraints/rollback, Flyway V1+V2 on a temp SQLite file (schema, indexes, seed counts), ISO-8601 UTC millis Z / root-unwrapped requests / null bio/image, domain + DTO + pager unit tests.
  • selenium/pages/* + selenium/tests/CriticalPathSmokeTest: home feed, wrong-password error, register → login → create article → view → comment → favorite → logout (headless Chrome, ./gradlew seleniumTest, excluded from test).

Frontend (frontend/__tests__/regression/**, 7 files, 41 tests) on top of the frontend session's 10 Vitest files (110 tests) → 151 tests, 0 failures; coverage 94.23/89.38/88.88/95.52 → 97.42% statements / 92.24% branches / 94.15% functions / 98.72% lines (thresholds 85/80/80/85 untouched). Files: forms, api, context, pagination, markdown, session, routes .regression.test.ts(x) — RegisterForm/LoginForm/SettingsForm error paths and errors.body nesting, API client URL encoding/default paging/auth headers/4xx-as-return-value, PageContext/PageCountContext functional updates + sessionStorage rehydration, getPageInfo/getRange/Pagination controls (<</</>/>> + SWR revalidate), markdown GFM + DOMPurify sanitising, fetcher/storage/ArticlePreview favorite/profile follow-unfollow/ProfileTab, and route smoke through pages/_app (guest vs authenticated navbar, login/register pages).

CI: .github/workflows/regression.yml — backend-gate (JDK 21 full gate), frontend-gate (Node 22 npm ci/lint/typecheck/test/build, uploads frontend/coverage), e2e-selenium (starts bootRun + next start, runs seleniumTest, uploads build/reports/selenium).

Migration notes

  • Phase 2 port of the Phase 1 tests (commit d39a869): Joda DateTime → java.time.Instant in RegressionFixtures; RepositoryTransactionRollbackTest moved from WebEnvironment.NONE to MOCK because Spring GraphQL's GraphQlHttpConfiguration requires a WebGraphQlHandler under Boot 3.5; GraphQL introspection split into two requests (Query fields / Mutation fields) to stay under graphql-java's "good faith introspection" guard; unauthenticated me now asserts data.me == null with no errors (DGS 10 behaviour).
  • No javax.*, @MockBean or @LocalServerPort in the new tests; REST-Assured 5.5 / Selenium 4.33 / TestNG 7.11 APIs only.
  • Frontend tests reuse test/setup.ts, test/utils.tsx (renderWithProviders), test/fixtures.ts, test/mockRouter.ts; the only module-level mock added is vi.mock("swr", …) for mutate in pagination.regression.test.tsx.
  • Contract facts pinned: POST /users → 201, POST /articles and POST /articles/{slug}/comments → 200; article JSON exposes id/cursor; POST /users/login with a bad password → 422 {"message":"invalid email or password"} (the Next 15 toErrorMap fallback now renders it, so the Selenium wrong-password test passes).

Verification

On the rebased branch (integration head with #227/#228/#229/#230 merged):

export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
./gradlew clean test spotlessCheck jacocoTestReport jacocoTestCoverageVerification
# BUILD SUCCESSFUL — 384 tests, 0 failures; JaCoCo instruction coverage 94.2% (>= 0.80)

cd frontend && source ~/.nvm/nvm.sh && nvm use 22   # Node v22.23.3
npm ci && npm run lint && npm run typecheck && npm test && npm run build
# all green — Test Files 17 passed, Tests 151 passed
# coverage: 97.42% statements / 92.24% branches / 94.15% functions / 98.72% lines

# E2E: ./gradlew bootRun (JDK 21) + `npm run build && npm start` (Next 15, port 3000)
JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 ./gradlew seleniumTest
# 5 tests completed, 0 failed (homeFeedLoads, loginWithWrongPasswordShowsError,
#   registerLoginCreateArticleCommentFavoriteLogout, testBrowserLaunches, testWebDriverManagerSetup)

PR CI (gradle.yml Backend/Frontend + regression.yml backend-gate/frontend-gate/e2e-selenium): all 5 checks green.

Known production findings (not fixed here — outside this PR's ownership)

  • POST /users/login bad credentials returns {"message": …} rather than the {"errors": {...}} envelope used everywhere else.
  • ArticleMapper.update does not write updated_at.
  • GraphQL updateUser without auth returns data: null with no errors entry (other mutations raise AuthenticationException).
  • RegisterForm treats status !== 200 as an error path although POST /users returns 201 (harmless because toErrorMap of a success body is {}, but the branch is wrong).
  • getPageInfo yields an empty page window when total < limit (no numbered page is rendered for a single short page); pinned as current behaviour.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/4da7f7c2d222447884300eea943396e3
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/4da7f7c2d222447884300eea943396e3?variant=devin
Requested by: @mbatchelor81

@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

…ialization/unit), Selenium critical path, regression.yml
… fixtures, DGS 10 introspection split, MOCK web env for rollback test)
…ion, markdown, session, route smoke) under frontend/__tests__/regression
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1791491209-modernization-regression-suite branch from 700e7a0 to 31f79a4 Compare October 8, 2026 21:22
@devin-ai-integration devin-ai-integration Bot changed the title [Phase 1] Regression suite: REST/GraphQL/repository/migration/serialization/unit tests, Selenium critical path, regression.yml [Phase 2] Regression suite on Java 21 / Boot 3.5 + Next 15: REST/GraphQL/repository/migration/serialization/unit tests, frontend Vitest regression, Selenium critical path, regression.yml Oct 8, 2026
@devin-ai-integration
devin-ai-integration Bot merged commit 48e7828 into devin/1791491209-modernization-integration Oct 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant