Skip to content

Commit

Permalink
Only use test containers for the Broker
Browse files Browse the repository at this point in the history
  • Loading branch information
ununhexium committed May 13, 2024
1 parent eb71a96 commit 5eba542
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 23 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ jobs:
permissions:
contents: read
packages: write

services:
postgres:
image: postgres:15
env:
POSTGRES_USER: edc
POSTGRES_PASSWORD: edc
POSTGRES_DB: edc
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: FranzDiebold/github-env-vars-action@v2
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion extensions/broker-server-api/api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
implementation(libs.jakarta.validationApi)
}

val openapiFileDir = "${project.buildDir}/swagger"
val openapiFileDir = project.layout.buildDirectory.get().asFile.resolve("swagger").path
val openapiFileFilename = "broker-server.yaml"
val openapiFile = "$openapiFileDir/$openapiFileFilename"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.testcontainers.containers.PostgreSQLContainer

val jooqDbType = "org.jooq.meta.postgres.PostgresDatabase"
val jdbcDriver = "org.postgresql.Driver"
val postgresContainer = "postgres:11-alpine"
val postgresContainer = "postgres:15-alpine"

val migrationsDir = "src/main/resources/db/migration"
val testDataDir = "src/main/resources/db/testdata"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@
public class TestDatabaseFactory {

/**
* Returns a JUnit 5 Extension that either connects to a test database or launches a testcontainer.
* Returns a JUnit 5 Extension that launches a testcontainer.
*
* @return {@link TestDatabase}
*/
public static TestDatabase getTestDatabase() {
if (TestDatabaseViaEnv.isSkipTestcontainers()) {
return new TestDatabaseViaEnv();
}

return new TestDatabaseViaTestcontainers();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
import org.apache.commons.lang3.Validate;
import org.junit.jupiter.api.extension.ExtensionContext;

/**
* @deprecated Use test containers wherever possible
*/
@Deprecated
public class TestDatabaseViaEnv implements TestDatabase {
public static final String SKIP_TESTCONTAINERS = "SKIP_TESTCONTAINERS";
public static final String TEST_POSTGRES_JDBC_URL = "TEST_POSTGRES_JDBC_URL";
Expand Down
35 changes: 35 additions & 0 deletions launchers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,41 @@ Our sovity Community Edition EDC is built as several docker image variants in di
</ul>
</td>
</tr>
<tr>
<td>
<a href="https://github.com/sovity/edc-broker-server-extension/pkgs/container/broker-server-dev">broker-dev</a>
</td>
<td>Development</td>
<td>
<ul>
<li>Local Deployment via our `docker-compose.yaml`</li>
<li>E2E Testing</li>
</ul>
</td>
<td>
<ul>
<li>Broker Server Extension(s)</li>
<li>PostgreSQL Persistence & Flyway</li>
<li>Mock IAM</li>
</ul>
</td>
</tr>
<tr>
<td>broker-ce</td>
<td>Community Edition</td>
<td>
<ul>
<li>Productive Deployment</li>
</ul>
</td>
<td>
<ul>
<li>Broker Server Extension(s)</li>
<li>PostgreSQL Persistence & Flyway</li>
<li>DAPS Authentication</li>
</ul>
</td>
</tr>
</table>

## Image Tags
Expand Down

0 comments on commit 5eba542

Please sign in to comment.