Skip to content

fix(backend): add h2 in-memory database to resolve CI application con… - #4

Merged
wonder37-debug merged 1 commit into
devfrom
fix/h2-test-database
Apr 13, 2026
Merged

fix(backend): add h2 in-memory database to resolve CI application con…#4
wonder37-debug merged 1 commit into
devfrom
fix/h2-test-database

Conversation

@wonder37-debug

Copy link
Copy Markdown
Owner

…text crash

Copilot AI review requested due to automatic review settings April 13, 2026 09:00
@wonder37-debug
wonder37-debug merged commit e0c8c5d into dev Apr 13, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the backend test setup so the Spring Boot application context can load successfully in CI by providing an in-memory database for tests instead of disabling JDBC auto-configuration.

Changes:

  • Removed the spring.autoconfigure.exclude=...DataSourceAutoConfiguration override from BackendApplicationTests.
  • Added com.h2database:h2 as a test-scope dependency so tests can bootstrap an embedded datasource.
  • Minor XML formatting changes in backend/pom.xml (single-line element compression).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
backend/src/test/java/com/campushub/backend/BackendApplicationTests.java Re-enables full Spring context loading during tests (no longer excluding datasource auto-config).
backend/pom.xml Adds H2 for tests so the context can start with an embedded DB; also includes some non-functional formatting changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/pom.xml
Comment on lines +17 to 21
<licenses><license/></licenses>
<developers><developer/></developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
<connection/><developerConnection/><tag/><url/>
</scm>

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hunk reformats multiple POM sections into single-line XML (e.g., , , ) without functional changes. Keeping the existing multi-line/indented formatting would reduce diff noise and improve readability/mergeability.

Copilot uses AI. Check for mistakes.
Comment thread backend/pom.xml
Comment on lines 81 to 84
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<goals><goal>compile</goal></goals>
<configuration>

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The element was collapsed to a single line here. To keep the POM consistent and easier to edit, consider keeping this block expanded/indented (unless an auto-formatter enforces this style).

Copilot uses AI. Check for mistakes.
Comment thread backend/pom.xml
Comment on lines 94 to 97
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<goals><goal>testCompile</goal></goals>
<configuration>

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: collapsing to a single line here increases diff noise and makes future edits harder; consider keeping the original multi-line formatting for consistency.

Copilot uses AI. Check for mistakes.
@wonder37-debug
wonder37-debug deleted the fix/h2-test-database branch April 13, 2026 09:39
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.

2 participants