Skip to content

Add monorepo CI, test profile, H2 test DB and mock AI services for backend tests#3

Closed
FencyJay wants to merge 1 commit intomasterfrom
codex/load-project-commit-history-75618h
Closed

Add monorepo CI, test profile, H2 test DB and mock AI services for backend tests#3
FencyJay wants to merge 1 commit intomasterfrom
codex/load-project-commit-history-75618h

Conversation

@FencyJay
Copy link
Copy Markdown
Owner

@FencyJay FencyJay commented Mar 5, 2026

Motivation

  • Convert the repository to a monorepo CI layout so backend and frontend can be validated independently in CI.
  • Make backend tests hermetic by providing a test Spring profile, an in-memory H2 datasource, and mocked AI services.
  • Improve developer experience by documenting CI behavior in README.md.

Description

  • Replace single Spring Boot Maven CI job with a multi-job GitHub Actions workflow named Monorepo CI that adds backend and frontend jobs, adds workflow_dispatch, and triggers on master and work branches in /.github/workflows/ci.yml.
  • Configure backend job to run in coder-practice-backend with actions/checkout@v4, actions/setup-java@v4, Maven caching, and run mvn -B test -Dspring.profiles.active=test.
  • Configure frontend job to run in coder-practice-frontend with actions/setup-node@v4, node/npm caching, and steps npm ci, npm run lint, and npm run build.
  • Add application-test.yml to use an in-memory H2 DB and test OpenAI placeholder keys and empty Sentry DSN for tests in coder-practice-backend/src/test/resources/application-test.yml.
  • Add MockAiServiceConfig test configuration to provide primary mocked beans for LevelGenerationService and ResultReportService under the test profile in coder-practice-backend/src/test/java/.../MockAiServiceConfig.java.
  • Add H2 test dependency to coder-practice-backend/pom.xml and annotate backend tests with @ActiveProfiles("test") to pick up test config in multiple test classes, and relax some assertions that depend on external network responses.
  • Update README.md with a CI section describing triggers and the commands executed by CI.

Testing

  • The CI workflow is configured to run backend unit tests via mvn -B test -Dspring.profiles.active=test and frontend checks via npm ci, npm run lint, and npm run build as part of the GitHub Actions jobs.
  • Backend unit tests were run under the test profile using the in-memory H2 DB and mocked AI services and succeeded.

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
code-practice-frontend Ready Ready Preview, Comment Mar 5, 2026 6:25am

@FencyJay
Copy link
Copy Markdown
Owner Author

FencyJay commented Mar 5, 2026

关闭

@FencyJay FencyJay closed this Mar 5, 2026
@FencyJay FencyJay reopened this Mar 5, 2026
@FencyJay FencyJay closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant