diff --git a/.github/workflows/native-image.yml b/.github/workflows/native-image.yml index 6d8dcae..592b3f7 100644 --- a/.github/workflows/native-image.yml +++ b/.github/workflows/native-image.yml @@ -35,5 +35,5 @@ jobs: run: | mvn clean install -DskipTests cd test-native-image - mvn clean package -Pnative - ./target/test-native-image + mvn clean package -DskipTests -Pnative + mvn test diff --git a/test-native-image/src/test/java/org/example/StartPostgresContainerTest.java b/test-native-image/src/test/java/org/example/StartPostgresContainerTest.java index 01246da..631f0ae 100644 --- a/test-native-image/src/test/java/org/example/StartPostgresContainerTest.java +++ b/test-native-image/src/test/java/org/example/StartPostgresContainerTest.java @@ -3,6 +3,12 @@ import org.junit.jupiter.api.Test; import io.ebean.test.containers.*; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.util.List; + class StartPostgresContainerTest { @Test @@ -13,4 +19,20 @@ void test() { .build() .start(); } + + @Test + void run() throws Exception { + File out = new File("out"); + + Process process = new ProcessBuilder() + .command("./target/test-native-image") + .redirectErrorStream(true) + .redirectOutput(ProcessBuilder.Redirect.to(out)) + .start(); + + int code = process.waitFor(); + System.out.println("exit " + code); + + Files.lines(out.toPath()).forEach(System.out::println); + } }