Skip to content

Commit 798edc2

Browse files
committed
Add windows OS to pipeline
1 parent eb7bc8f commit 798edc2

File tree

24 files changed

+147
-106
lines changed

24 files changed

+147
-106
lines changed

.github/actions/common/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ inputs:
5454
runs:
5555
using: "composite"
5656
steps:
57-
- if: ${{ inputs.free-space == 'true' }}
57+
- if: ${{ inputs.free-space == 'true' && runner.os != 'Windows'}}
5858
# See https://github.com/actions/runner-images/issues/2840
5959
name: Free disk space
6060
shell: bash
@@ -141,7 +141,7 @@ runs:
141141
shell: bash
142142
- name: Archive test results
143143
# https://github.com/actions/upload-artifact/issues/240
144-
if: ${{ inputs.test-artifact-name != '' && runner.os != 'Windows' && always() }}
144+
if: ${{ inputs.test-artifact-name != '' && always() }}
145145
uses: actions/upload-artifact@v4
146146
with:
147147
if-no-files-found: 'ignore'

.github/workflows/validate.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,21 @@ jobs:
9999
timeout-minutes: 30
100100
strategy:
101101
matrix:
102-
os: [ ubuntu-20.04 ]
102+
os: [ ubuntu-20.04, windows-2022 ]
103103
moduleSet: [ core, it, dbclient, dbclient-oracle, others ]
104104
include:
105105
- { os: ubuntu-20.04, platform: linux }
106+
- { os: windows-2022, platform: windows }
106107
runs-on: ${{ matrix.os }}
107-
name: tests/${{ matrix.moduleSet }}
108+
name: tests/${{ matrix.moduleSet }}-${{matrix.platform}}
108109
steps:
109110
- uses: actions/checkout@v4
110111
with:
111112
ref: ${{ inputs.ref }}
112113
- uses: ./.github/actions/common
113114
with:
114115
build-cache: read-only
115-
test-artifact-name: tests-${{ matrix.moduleSet }}
116+
test-artifact-name: tests-${{ matrix.moduleSet }}-${{ matrix.platform }}
116117
run: |
117118
mvn ${MAVEN_ARGS} \
118119
-DreactorRule=tests \
@@ -311,11 +312,12 @@ jobs:
311312
timeout-minutes: 30
312313
strategy:
313314
matrix:
314-
os: [ ubuntu-20.04, macos-14 ]
315+
os: [ ubuntu-20.04, macos-14, windows-2022 ]
315316
packaging: [ jar, jlink ]
316317
include:
317318
- { os: ubuntu-20.04, platform: linux }
318319
- { os: macos-14, platform: macos }
320+
- { os: windows-2022, platform: windows }
319321
runs-on: ${{ matrix.os }}
320322
name: tests/packaging-${{ matrix.packaging }}-${{ matrix.platform }}
321323
steps:
@@ -337,11 +339,12 @@ jobs:
337339
timeout-minutes: 30
338340
strategy:
339341
matrix:
340-
os: [ ubuntu-20.04, macos-14 ]
342+
os: [ ubuntu-20.04, macos-14, windows-2022 ]
341343
module: [ mp-1, mp-2, mp-3, se-1, inject ]
342344
include:
343345
- { os: ubuntu-20.04, platform: linux }
344346
- { os: macos-14, platform: macos }
347+
- { os: windows-2022, platform: windows }
345348
runs-on: ${{ matrix.os }}
346349
name: tests/native-image-${{ matrix.module }}-${{ matrix.platform }}
347350
steps:

builder/tests/builder/src/test/java/io/helidon/builder/test/CustomNamedTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2022, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,7 +56,11 @@ void testIt() throws Exception {
5656
.build();
5757
DefaultPrettyPrinter printer = new DefaultPrettyPrinter();
5858
String json = mapper.writer(printer).writeValueAsString(customNamed);
59-
assertThat(json, equalTo("{\n" + " \"stringSet\" : [ \"b\", \"a\", \"y\" ]\n" + "}"));
59+
assertThat(json, equalTo("{"
60+
+ System.lineSeparator()
61+
+ " \"stringSet\" : [ \"b\", \"a\", \"y\" ]"
62+
+ System.lineSeparator()
63+
+ "}"));
6064
}
6165

6266
}

integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProvider.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package io.helidon.integrations.oci.sdk.runtime;
1818

19+
import java.io.File;
1920
import java.io.IOException;
2021
import java.io.UncheckedIOException;
2122
import java.nio.file.Path;
@@ -159,7 +160,14 @@ static boolean canReadPath(String pathName) {
159160
}
160161

161162
static String userHomePrivateKeyPath(OciConfig ociConfig) {
162-
return Paths.get(System.getProperty("user.home"), ".oci", ociConfig.authKeyFile()).toString();
163+
return normalizePath(Paths.get(System.getProperty("user.home"), ".oci", ociConfig.authKeyFile()).toString());
164+
}
165+
166+
private static String normalizePath(String value) {
167+
if (value == null) {
168+
return null;
169+
}
170+
return value.replace(File.separator, "/");
163171
}
164172

165173

microprofile/telemetry/src/test/java/io/helidon/microprofile/telemetry/TestTracerAtStartup.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2024, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
1919
import io.helidon.microprofile.testing.junit5.HelidonTest;
2020

2121
import org.junit.jupiter.api.Test;
22+
import org.junit.jupiter.api.condition.DisabledOnOs;
23+
import org.junit.jupiter.api.condition.OS;
2224

2325
import static org.hamcrest.MatcherAssert.assertThat;
2426
import static org.hamcrest.Matchers.containsString;
@@ -29,6 +31,7 @@
2931
class TestTracerAtStartup {
3032

3133
@Test
34+
@DisabledOnOs(value = OS.WINDOWS, disabledReason = "https://github.com/helidon-io/helidon/issues/9513")
3235
void checkForFullFeaturedTracerAtStartup() {
3336
assertThat("Global tracer from start-up extension",
3437
TestExtension.globalTracerAtStartup.unwrap(io.opentelemetry.api.trace.Tracer.class).getClass().getName(),

microprofile/testing/testng/src/main/java/io/helidon/microprofile/testing/testng/HelidonTestNgListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2022, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -106,6 +106,7 @@ public void onBeforeClass(ITestClass iTestClass) {
106106
testClass = iTestClass.getRealClass();
107107
HelidonTest testAnnot = testClass.getAnnotation(HelidonTest.class);
108108
if (testAnnot == null) {
109+
helidonTest = false;
109110
return;
110111
}
111112
helidonTest = true;

microprofile/tests/telemetry/src/test/java/io/helidon/microprofile/telemetry/InMemorySpanExporter.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2023, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,26 +13,24 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package io.helidon.microprofile.telemetry;
1817

19-
import static java.util.Comparator.comparingLong;
20-
import static java.util.concurrent.TimeUnit.SECONDS;
21-
import static org.hamcrest.MatcherAssert.assertThat;
22-
2318
import java.util.Collection;
2419
import java.util.List;
2520
import java.util.concurrent.CopyOnWriteArrayList;
2621
import java.util.stream.Collectors;
2722

28-
import org.awaitility.Awaitility;
29-
3023
import io.opentelemetry.sdk.common.CompletableResultCode;
3124
import io.opentelemetry.sdk.trace.data.SpanData;
3225
import io.opentelemetry.sdk.trace.export.SpanExporter;
3326
import jakarta.enterprise.context.ApplicationScoped;
27+
import org.awaitility.Awaitility;
3428
import org.hamcrest.Matchers;
3529

30+
import static java.util.Comparator.comparingLong;
31+
import static java.util.concurrent.TimeUnit.SECONDS;
32+
import static org.hamcrest.MatcherAssert.assertThat;
33+
3634
@ApplicationScoped
3735
public class InMemorySpanExporter implements SpanExporter {
3836
private boolean isStopped = false;
@@ -48,7 +46,8 @@ public List<SpanData> getFinishedSpanItems(int spanCount) {
4846
}
4947

5048
public void assertSpanCount(int spanCount) {
51-
Awaitility.await().pollDelay(3, SECONDS).atMost(10, SECONDS)
49+
Awaitility.await()
50+
.pollDelay(3, SECONDS).atMost(10, SECONDS)
5251
.untilAsserted(() -> assertThat(finishedSpanItems.size(), Matchers.is(spanCount)));
5352
}
5453

@@ -57,6 +56,7 @@ public void reset() {
5756
}
5857

5958
@Override
59+
@SuppressWarnings("NullableProblems")
6060
public CompletableResultCode export(Collection<SpanData> spans) {
6161
if (isStopped) {
6262
return CompletableResultCode.ofFailure();

microprofile/tests/telemetry/src/test/java/io/helidon/microprofile/telemetry/InMemorySpanExporterProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2023, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,14 +13,14 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package io.helidon.microprofile.telemetry;
1817

1918
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
2019
import io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider;
2120
import io.opentelemetry.sdk.trace.export.SpanExporter;
2221
import jakarta.enterprise.inject.spi.CDI;
2322

23+
@SuppressWarnings("NullableProblems")
2424
public class InMemorySpanExporterProvider implements ConfigurableSpanExporterProvider {
2525
@Override
2626
public SpanExporter createExporter(final ConfigProperties config) {
@@ -31,4 +31,4 @@ public SpanExporter createExporter(final ConfigProperties config) {
3131
public String getName() {
3232
return "in-memory";
3333
}
34-
}
34+
}

microprofile/tests/telemetry/src/test/java/io/helidon/microprofile/telemetry/RestSpanHierarchyTest.java

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2023, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,31 +13,25 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
17-
1816
package io.helidon.microprofile.telemetry;
1917

2018
import java.util.List;
2119

22-
import io.helidon.http.Status;
23-
import io.helidon.microprofile.telemetry.InMemorySpanExporterProvider;
2420
import io.helidon.microprofile.testing.junit5.AddBean;
25-
import io.helidon.microprofile.testing.junit5.AddConfig;
26-
import io.helidon.microprofile.testing.junit5.AddExtension;
21+
import io.helidon.microprofile.testing.junit5.AddConfigBlock;
2722
import io.helidon.microprofile.testing.junit5.HelidonTest;
23+
import io.helidon.tracing.Span;
24+
import io.helidon.tracing.Tracer;
2825

2926
import io.opentelemetry.api.common.AttributeKey;
3027
import io.opentelemetry.instrumentation.annotations.WithSpan;
3128
import io.opentelemetry.sdk.trace.data.SpanData;
3229
import jakarta.enterprise.context.ApplicationScoped;
3330
import jakarta.inject.Inject;
34-
import jakarta.ws.rs.ApplicationPath;
3531
import jakarta.ws.rs.GET;
3632
import jakarta.ws.rs.Path;
3733
import jakarta.ws.rs.client.WebTarget;
38-
import jakarta.ws.rs.core.Application;
3934
import jakarta.ws.rs.core.Response;
40-
import org.junit.jupiter.api.AfterEach;
4135
import org.junit.jupiter.api.BeforeEach;
4236
import org.junit.jupiter.api.Test;
4337

@@ -53,10 +47,12 @@
5347
@AddBean(RestSpanHierarchyTest.SpanResource.class)
5448
@AddBean(InMemorySpanExporter.class)
5549
@AddBean(InMemorySpanExporterProvider.class)
56-
@AddConfig(key = "otel.service.name", value = "helidon-mp-telemetry")
57-
@AddConfig(key = "otel.sdk.disabled", value = "false")
58-
@AddConfig(key = "telemetry.span.full.url", value = "false")
59-
@AddConfig(key = "otel.traces.exporter", value = "in-memory")
50+
@AddConfigBlock("""
51+
otel.service.name=helidon-mp-telemetry
52+
otel.sdk.disabled=false
53+
otel.traces.exporter=in-memory
54+
telemetry.span.full.url=false
55+
""")
6056
public class RestSpanHierarchyTest {
6157

6258
@Inject
@@ -72,7 +68,6 @@ void setup() {
7268

7369
@Test
7470
void spanHierarchy() {
75-
7671
assertThat(webTarget.path("mixed").request().get().getStatus(), is(Response.Status.OK.getStatusCode()));
7772

7873
List<SpanData> spanItems = spanExporter.getFinishedSpanItems(4);
@@ -81,12 +76,10 @@ void spanHierarchy() {
8176
assertThat(spanItems.get(0).getAttributes().get(AttributeKey.stringKey("attribute")), is("value"));
8277
assertThat(spanItems.get(0).getParentSpanId(), is(spanItems.get(1).getSpanId()));
8378

84-
8579
assertThat(spanItems.get(1).getKind(), is(INTERNAL));
8680
assertThat(spanItems.get(1).getName(), is("mixed_parent"));
8781
assertThat(spanItems.get(1).getParentSpanId(), is(spanItems.get(2).getSpanId()));
8882

89-
9083
assertThat(spanItems.get(2).getKind(), is(SERVER));
9184
assertThat(spanItems.get(2).getName(), is("/mixed"));
9285
}
@@ -119,17 +112,16 @@ void spanHierarchyInjected() {
119112
public static class SpanResource {
120113

121114
@Inject
122-
private io.helidon.tracing.Tracer helidonTracerInjected;
123-
115+
private Tracer helidonTracerInjected;
124116

125117
@GET
126118
@Path("mixed")
127119
@WithSpan("mixed_parent")
128120
public Response mixedSpan() {
129121

130-
io.helidon.tracing.Tracer helidonTracer = io.helidon.tracing.Tracer.global();
131-
io.helidon.tracing.Span mixedSpan = helidonTracer.spanBuilder("mixed_inner")
132-
.kind(io.helidon.tracing.Span.Kind.SERVER)
122+
Tracer helidonTracer = Tracer.global();
123+
Span mixedSpan = helidonTracer.spanBuilder("mixed_inner")
124+
.kind(Span.Kind.SERVER)
133125
.tag("attribute", "value")
134126
.start();
135127
mixedSpan.end();
@@ -142,8 +134,8 @@ public Response mixedSpan() {
142134
@WithSpan("mixed_parent_injected")
143135
public Response mixedSpanInjected() {
144136

145-
io.helidon.tracing.Span mixedSpan = helidonTracerInjected.spanBuilder("mixed_inner_injected")
146-
.kind(io.helidon.tracing.Span.Kind.SERVER)
137+
Span mixedSpan = helidonTracerInjected.spanBuilder("mixed_inner_injected")
138+
.kind(Span.Kind.SERVER)
147139
.tag("attribute", "value")
148140
.start();
149141
mixedSpan.end();

0 commit comments

Comments
 (0)