Add monorepo CI, test profile, H2 test DB and mock AI services for backend tests#3
Closed
Add monorepo CI, test profile, H2 test DB and mock AI services for backend tests#3
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
关闭 |
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.
Motivation
testSpring profile, an in-memory H2 datasource, and mocked AI services.README.md.Description
Spring Boot Maven CIjob with a multi-job GitHub Actions workflow namedMonorepo CIthat addsbackendandfrontendjobs, addsworkflow_dispatch, and triggers onmasterandworkbranches in/.github/workflows/ci.yml.backendjob to run incoder-practice-backendwithactions/checkout@v4,actions/setup-java@v4, Maven caching, and runmvn -B test -Dspring.profiles.active=test.frontendjob to run incoder-practice-frontendwithactions/setup-node@v4, node/npm caching, and stepsnpm ci,npm run lint, andnpm run build.application-test.ymlto use an in-memory H2 DB and test OpenAI placeholder keys and empty Sentry DSN for tests incoder-practice-backend/src/test/resources/application-test.yml.MockAiServiceConfigtest configuration to provide primary mocked beans forLevelGenerationServiceandResultReportServiceunder thetestprofile incoder-practice-backend/src/test/java/.../MockAiServiceConfig.java.coder-practice-backend/pom.xmland 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.README.mdwith aCIsection describing triggers and the commands executed by CI.Testing
mvn -B test -Dspring.profiles.active=testand frontend checks vianpm ci,npm run lint, andnpm run buildas part of the GitHub Actions jobs.testprofile using the in-memory H2 DB and mocked AI services and succeeded.Codex Task