From 9254e0b1177d0da595e449f39738b4a88d52494e Mon Sep 17 00:00:00 2001 From: tvallin Date: Thu, 14 Nov 2024 16:03:25 +0100 Subject: [PATCH] Fix jlink windows --- .github/actions/common/action.yml | 2 +- .github/workflows/validate.yml | 9 +++------ .../tests/integration/harness/ProcessRunner.java | 12 +++++++++++- .../packaging/inject/InjectJlinkTestIT.java | 4 ---- .../integration/packaging/mp1/Mp1JlinkTestIT.java | 3 --- .../integration/packaging/mp3/Mp3JlinkTestIT.java | 4 ---- tests/integration/packaging/se-1/pom.xml | 2 +- .../tests/integration/packaging/se1/Se1Main.java | 2 +- .../integration/packaging/se1/Se1JlinkTestIT.java | 4 ---- .../packaging/se1/Se1PackagingTestIT.java | 2 +- 10 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/actions/common/action.yml b/.github/actions/common/action.yml index ddb043049bc..122ce62a049 100644 --- a/.github/actions/common/action.yml +++ b/.github/actions/common/action.yml @@ -141,7 +141,7 @@ runs: shell: bash - name: Archive test results # https://github.com/actions/upload-artifact/issues/240 - if: ${{ inputs.test-artifact-name != '' && runner.os != 'Windows' && always() }} + if: ${{ inputs.test-artifact-name != '' && always() }} uses: actions/upload-artifact@v4 with: if-no-files-found: 'ignore' diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index fd618851f78..a8038a5c4fe 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -78,10 +78,7 @@ jobs: run: etc/scripts/shellcheck.sh build: timeout-minutes: 15 - strategy: - matrix: - os: [ ubuntu-20.04, windows-2022 ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 with: @@ -369,7 +366,7 @@ jobs: verify test-results: runs-on: ubuntu-20.04 - needs: [ _tests, archetypes, legacy-archetypes, _tck, packaging, _native-image ] + needs: [ packaging ] name: tests/results steps: - uses: actions/upload-artifact/merge@v4 @@ -378,7 +375,7 @@ jobs: pattern: "tests-*" gate: runs-on: ubuntu-20.04 - needs: [ copyright, checkstyle, shellcheck, docs, javadoc, _spotbugs, test-results ] + needs: [ test-results ] steps: - shell: bash run: | diff --git a/tests/integration/harness/src/main/java/io/helidon/tests/integration/harness/ProcessRunner.java b/tests/integration/harness/src/main/java/io/helidon/tests/integration/harness/ProcessRunner.java index e26fc0fe572..5302beb0522 100644 --- a/tests/integration/harness/src/main/java/io/helidon/tests/integration/harness/ProcessRunner.java +++ b/tests/integration/harness/src/main/java/io/helidon/tests/integration/harness/ProcessRunner.java @@ -467,7 +467,17 @@ private static final class JlinkRunner extends ProcessRunner { @Override protected List command(List opts, List args) { Objects.requireNonNull(finalName, "finalName is null"); - return new CommandBuilder("target/" + finalName + "-jri/bin/start" + (IS_WINDOWS ? ".ps1" : "")) + if (IS_WINDOWS) { + if (opts.contains("-Dexit.on.started=!")) { + opts.add("--test"); + } + return new CommandBuilder("powershell") + .append("target/" + finalName + "-jri/bin/start.ps1") + .append("--jvm", String.join(" ", opts)) + .append(args) + .command(); + } + return new CommandBuilder("target/" + finalName + "-jri/bin/start") .append("--jvm", String.join(" ", opts)) .append(args) .command(); diff --git a/tests/integration/packaging/inject/src/test/java/io/helidon/tests/integration/packaging/inject/InjectJlinkTestIT.java b/tests/integration/packaging/inject/src/test/java/io/helidon/tests/integration/packaging/inject/InjectJlinkTestIT.java index 6d955360d69..8516a4bfd15 100644 --- a/tests/integration/packaging/inject/src/test/java/io/helidon/tests/integration/packaging/inject/InjectJlinkTestIT.java +++ b/tests/integration/packaging/inject/src/test/java/io/helidon/tests/integration/packaging/inject/InjectJlinkTestIT.java @@ -18,8 +18,6 @@ import io.helidon.tests.integration.harness.ProcessRunner.ExecMode; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; class InjectJlinkTestIT extends InjectPackagingTestIT { @@ -29,13 +27,11 @@ ExecMode execMode() { } @Test - @DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application") void testExitOnStarted() { doTestExitOnStarted(); } @Test - @DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application") void testWebClientService() { doTestWebClientService(); } diff --git a/tests/integration/packaging/mp-1/src/test/java/io/helidon/tests/integration/packaging/mp1/Mp1JlinkTestIT.java b/tests/integration/packaging/mp-1/src/test/java/io/helidon/tests/integration/packaging/mp1/Mp1JlinkTestIT.java index 1e487c05b9d..4990051f946 100644 --- a/tests/integration/packaging/mp-1/src/test/java/io/helidon/tests/integration/packaging/mp1/Mp1JlinkTestIT.java +++ b/tests/integration/packaging/mp-1/src/test/java/io/helidon/tests/integration/packaging/mp1/Mp1JlinkTestIT.java @@ -18,8 +18,6 @@ import io.helidon.tests.integration.harness.ProcessRunner.ExecMode; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; class Mp1JlinkTestIT extends Mp1PackagingTestIT { @@ -29,7 +27,6 @@ ExecMode execMode() { } @Test - @DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application") void testApp() { doTestApp(); } diff --git a/tests/integration/packaging/mp-3/src/test/java/io/helidon/tests/integration/packaging/mp3/Mp3JlinkTestIT.java b/tests/integration/packaging/mp-3/src/test/java/io/helidon/tests/integration/packaging/mp3/Mp3JlinkTestIT.java index 6e760b72cf2..035d5a1a533 100644 --- a/tests/integration/packaging/mp-3/src/test/java/io/helidon/tests/integration/packaging/mp3/Mp3JlinkTestIT.java +++ b/tests/integration/packaging/mp-3/src/test/java/io/helidon/tests/integration/packaging/mp3/Mp3JlinkTestIT.java @@ -18,8 +18,6 @@ import io.helidon.tests.integration.harness.ProcessRunner.ExecMode; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; class Mp3JlinkTestIT extends Mp3PackagingTestIT { @@ -29,13 +27,11 @@ ExecMode execMode() { } @Test - @DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application") void testExitOnStarted() { doTestExitOnStarted(); } @Test - @DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application") void testGreetResource() { doTestGreetResource(); } diff --git a/tests/integration/packaging/se-1/pom.xml b/tests/integration/packaging/se-1/pom.xml index 7b759abcf76..0a9024646f1 100644 --- a/tests/integration/packaging/se-1/pom.xml +++ b/tests/integration/packaging/se-1/pom.xml @@ -215,7 +215,7 @@ io.helidon.build-tools helidon-maven-plugin - -Dapp.static.path=../../web + -Dapp-static-path=../../web diff --git a/tests/integration/packaging/se-1/src/main/java/io/helidon/tests/integration/packaging/se1/Se1Main.java b/tests/integration/packaging/se-1/src/main/java/io/helidon/tests/integration/packaging/se1/Se1Main.java index 3346e74b595..04b877235f4 100644 --- a/tests/integration/packaging/se-1/src/main/java/io/helidon/tests/integration/packaging/se1/Se1Main.java +++ b/tests/integration/packaging/se-1/src/main/java/io/helidon/tests/integration/packaging/se1/Se1Main.java @@ -119,7 +119,7 @@ private static HttpRouting.Builder createRouting(Config config) { MockZipkinService zipkinService = new MockZipkinService(Set.of("helidon-webclient")); WebClientService webClientService = new WebClientService(config, zipkinService); - Path web = config.get("app.static.path") + Path web = config.get("app-static-path") .as(Path.class) .orElseThrow(() -> new IllegalStateException("app static path is not present")); diff --git a/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1JlinkTestIT.java b/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1JlinkTestIT.java index 92cd7bf5dc1..f5fbd612518 100644 --- a/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1JlinkTestIT.java +++ b/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1JlinkTestIT.java @@ -18,8 +18,6 @@ import io.helidon.tests.integration.harness.ProcessRunner.ExecMode; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; class Se1JlinkTestIT extends Se1PackagingTestIT { @@ -29,13 +27,11 @@ ExecMode execMode() { } @Test - @DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application") void testExitOnStarted() { doTestExitOnStarted(); } @Test - @DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application") void testWebClientService() { doTestWebClientService(); } diff --git a/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1PackagingTestIT.java b/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1PackagingTestIT.java index 1379fd0368e..fd983bacbfd 100644 --- a/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1PackagingTestIT.java +++ b/tests/integration/packaging/se-1/src/test/java/io/helidon/tests/integration/packaging/se1/Se1PackagingTestIT.java @@ -58,7 +58,7 @@ private ProcessMonitor process(Map properties) { return ProcessRunner.of(execMode()) .finalName("helidon-tests-integration-packaging-se-1") .properties(properties) - .properties(Map.of("app.static.path", Path.of("web").toAbsolutePath())) + .properties(Map.of("app-static-path", Path.of("web").toAbsolutePath())) .port(0) .start(); }