Skip to content

Commit

Permalink
Merge pull request #7 from penguineer/fix-tests
Browse files Browse the repository at this point in the history
Fix that tests would fail with database issues
  • Loading branch information
penguineer authored Jul 19, 2024
2 parents 2f3c0e7 + c67f9f8 commit db83e3b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Run Maven Build
run: mvn clean package -DskipTests -Pproduction
run: mvn clean package -Pproduction

- name: Determine Docker tags
id: meta
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Run tests
run: mvn --batch-mode --update-snapshots clean verify
run: mvn --batch-mode --update-snapshots -Pproduction clean verify
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@
<version>3.7.1</version>
<type>maven-plugin</type>
</dependency>

<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.7.3</version>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.penguineering.gartenplus;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class GartenplusApplicationTests {

@Test
void contextLoads() {
}

}
17 changes: 17 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
management:
endpoints:
enabled-by-default: false

spring:
application:
name: GartenPlus Test

datasource:
url: jdbc:hsqldb:mem:testdb;sql.syntax_mys=true
username: sa
password:
driverClassName: org.hsqldb.jdbc.JDBCDriver
jpa:
database-platform: org.hibernate.dialect.HSQLDialect
hibernate:
ddl-auto: create-drop

0 comments on commit db83e3b

Please sign in to comment.