Skip to content

Commit

Permalink
Fix jlink windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tvallin committed Nov 20, 2024
1 parent a76c64d commit 9254e0b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/actions/common/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,17 @@ private static final class JlinkRunner extends ProcessRunner {
@Override
protected List<String> command(List<String> opts, List<String> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -29,7 +27,6 @@ ExecMode execMode() {
}

@Test
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "application is not a valid Win32 application")
void testApp() {
doTestApp();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/packaging/se-1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<groupId>io.helidon.build-tools</groupId>
<artifactId>helidon-maven-plugin</artifactId>
<configuration>
<defaultJvmOptions>-Dapp.static.path=../../web</defaultJvmOptions>
<defaultJvmOptions>-Dapp-static-path=../../web</defaultJvmOptions>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private ProcessMonitor process(Map<String, ?> 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();
}
Expand Down

0 comments on commit 9254e0b

Please sign in to comment.