Skip to content

Commit 1dc4862

Browse files
committed
fix tests
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent f181fe8 commit 1dc4862

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

mise.toml

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,21 @@ env = { REQUIRE_PROTO_UP_TO_DATE = "true" }
1919
description = "format source code"
2020
run = "./mvnw spotless:apply"
2121

22+
[tasks.compile]
23+
description = "bare compile, ignoring formatting and linters"
24+
run = "./mvnw install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
25+
2226
[tasks.test]
2327
description = "run unit tests, ignoring formatting and linters"
24-
run = "./mvnw test -DskipTests=true -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
28+
run = "./mvnw test -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
2529

2630
[tasks.test-all]
2731
description = "run all tests"
2832
run = "./mvnw verify"
2933

3034
[tasks.build]
3135
description = "build all modules wihthout tests"
32-
run = "./mvnw clean install -DskipTests"
36+
run = "./mvnw install -DskipTests"
3337

3438
[tasks.acceptance-test]
3539
description = "Run OATs acceptance tests"
@@ -39,7 +43,7 @@ run = "oats -timeout 5m examples/"
3943
[tasks.native-test]
4044
depends = "build"
4145
tools.java = "graalvm-22.3.3+java17"
42-
run = "../../mvnw test -PnativeTest"
46+
run = "../../mvnw test -PnativeTest"
4347
dir = "integration-tests/it-spring-boot-smoke-test"
4448

4549
[settings]

prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java

-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ public OpenMetricsTextFormatWriter build() {
7474
/**
7575
* @param createdTimestampsEnabled whether to include the _created timestamp in the output - This
7676
* will produce an invalid OpenMetrics output, but is kept for backwards compatibility.
77-
* @deprecated this constructor is deprecated and will be removed in the next major version -
78-
* {@link #builder()} or {@link #create()} instead
7977
*/
8078
public OpenMetricsTextFormatWriter(
8179
boolean createdTimestampsEnabled, boolean exemplarsOnAllMetricTypesEnabled) {

prometheus-metrics-exposition-textformats/src/test/java/io/prometheus/metrics/expositionformats/ExpositionFormatsTest.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -2767,17 +2767,23 @@ private void assertOpenMetricsTextWithoutCreated(String expected, MetricSnapshot
27672767

27682768
private void assertPrometheusText(String expected, MetricSnapshot snapshot) throws IOException {
27692769
ByteArrayOutputStream out = new ByteArrayOutputStream();
2770-
PrometheusTextFormatWriter writer =
2771-
PrometheusTextFormatWriter.builder().setIncludeCreatedTimestamps(true).build();
2772-
writer.write(out, MetricSnapshots.of(snapshot));
2770+
2771+
getPrometheusWriter(PrometheusTextFormatWriter.builder().setIncludeCreatedTimestamps(true))
2772+
.write(out, MetricSnapshots.of(snapshot));
27732773
assertThat(out).hasToString(expected);
27742774
}
27752775

2776+
@SuppressWarnings("deprecation")
2777+
private static PrometheusTextFormatWriter getPrometheusWriter(
2778+
PrometheusTextFormatWriter.Builder builder) {
2779+
return builder.setTimestampsInMs(false).build();
2780+
}
2781+
27762782
private void assertPrometheusTextWithoutCreated(String expected, MetricSnapshot snapshot)
27772783
throws IOException {
27782784
ByteArrayOutputStream out = new ByteArrayOutputStream();
2779-
PrometheusTextFormatWriter writer = PrometheusTextFormatWriter.create();
2780-
writer.write(out, MetricSnapshots.of(snapshot));
2785+
getPrometheusWriter(PrometheusTextFormatWriter.builder())
2786+
.write(out, MetricSnapshots.of(snapshot));
27812787
assertThat(out).hasToString(expected);
27822788
}
27832789

0 commit comments

Comments
 (0)