Skip to content

Commit 52de888

Browse files
committed
2 parents 5af756c + 9778d70 commit 52de888

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

1515
- name: Set up JDK 11
16-
uses: actions/setup-java@v3
16+
uses: actions/setup-java@v4
1717
with:
1818
java-version: '11'
1919
distribution: 'temurin'
20+
cache: 'maven'
2021

2122
- name: Run tests
22-
run: mvn compile && mvn test
23+
run: mvn compile test

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<protobuf.version>4.27.2</protobuf.version>
1919
<grpc.version>1.65.0</grpc.version>
2020
<logback-classic.version>1.4.12</logback-classic.version>
21-
<testcontainers.version>1.20.0</testcontainers.version>
21+
<testcontainers.version>1.20.1</testcontainers.version>
2222
<junit.jupiter.version>5.10.3</junit.jupiter.version>
2323
<junit.platform.version>1.8.2</junit.platform.version>
2424
<surefire.plugin.version>3.0.0-M5</surefire.plugin.version>

src/test/java/io/eigr/spawn/AbstractContainerBaseTest.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package io.eigr.spawn;
22

3-
import com.github.dockerjava.api.model.HostConfig;
4-
import com.github.dockerjava.api.model.PortBinding;
53
import io.eigr.spawn.api.Spawn;
64
import io.eigr.spawn.api.TransportOpts;
75
import io.eigr.spawn.api.exceptions.SpawnException;
@@ -24,16 +22,13 @@ public abstract class AbstractContainerBaseTest {
2422
private static GenericContainer<?> SPAWN_CONTAINER;
2523
private static final String spawnProxyImage = "eigr/spawn-proxy:1.4.1-rc.1";
2624
private static final String userFunctionPort = "8091";
27-
private static final String spawnProxyPort = "9004";
2825
protected static Spawn spawnSystem;
2926
protected static final String spawnSystemName = "spawn-system-test";
3027

3128
static {
3229
Testcontainers.exposeHostPorts(8091);
3330

3431
SPAWN_CONTAINER = new GenericContainer<>(DockerImageName.parse(spawnProxyImage))
35-
.withCreateContainerCmdModifier(e -> e.withHostConfig(HostConfig.newHostConfig()
36-
.withPortBindings(PortBinding.parse("9004:9004"))))
3732
.waitingFor(new LogMessageWaitStrategy()
3833
.withRegEx(".*Proxy Application started successfully.*"))
3934
.withEnv("SPAWN_PROXY_LOGGER_LEVEL", "DEBUG")
@@ -44,13 +39,12 @@ public abstract class AbstractContainerBaseTest {
4439
.withEnv("NODE_COOKIE", "cookie-9ce3712b0c3ee21b582c30f942c0d4da-HLuZyQzy+nt0p0r/PVVFTp2tqfLom5igrdmwkYSuO+Q=")
4540
.withEnv("POD_NAMESPACE", spawnSystemName)
4641
.withEnv("POD_IP", spawnSystemName)
47-
.withEnv("PROXY_HTTP_PORT", spawnProxyPort)
42+
.withEnv("PROXY_HTTP_PORT", "9004")
4843
.withEnv("USER_FUNCTION_PORT", userFunctionPort)
49-
.withEnv("USER_FUNCTION_HOST", "host.docker.internal") // Docker
50-
.withExtraHost("host.docker.internal", "host-gateway") // Docker
51-
// .withEnv("USER_FUNCTION_HOST", "host.containers.internal") // Podman
52-
// .withExtraHost("host.containers.internal", "host-gateway") // Podman
53-
.withExposedPorts(9004);
44+
.withEnv("USER_FUNCTION_HOST", "host.testcontainers.internal")
45+
.withExtraHost("host.testcontainers.internal", "host-gateway")
46+
.withExposedPorts(9004)
47+
.withAccessToHost(true);
5448
SPAWN_CONTAINER.start();
5549

5650
DependencyInjector injector = SimpleDependencyInjector.createInjector();
@@ -65,8 +59,9 @@ public abstract class AbstractContainerBaseTest {
6559
.withActor(StatelessNamedActor.class)
6660
.withTerminationGracePeriodSeconds(5)
6761
.withTransportOptions(TransportOpts.builder()
62+
.host(SPAWN_CONTAINER.getHost())
6863
.port(8091)
69-
.proxyPort(9004)
64+
.proxyPort(SPAWN_CONTAINER.getMappedPort(9004))
7065
.build())
7166
.build();
7267

0 commit comments

Comments
 (0)