Skip to content

Commit e48116e

Browse files
incertumFranz Busch
andcommitted
fix: Tests given deprecation warnings
Mark tests as deprecated (for now). They will be refactored in the future. Co-authored-by: Franz Busch <[email protected]> Signed-off-by: Melissa Kilby <[email protected]>
1 parent 3cf71ef commit e48116e

File tree

6 files changed

+72
-7
lines changed

6 files changed

+72
-7
lines changed

Tests/PrometheusTests/CounterTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
import Prometheus
1616
import XCTest
1717

18+
@available(
19+
*,
20+
deprecated,
21+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
22+
)
1823
final class CounterTests: XCTestCase {
24+
1925
func testCounterWithoutLabels() {
2026
let client = PrometheusCollectorRegistry()
2127
let counter = client.makeCounter(name: "foo", labels: [])

Tests/PrometheusTests/GaugeTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
import Prometheus
1616
import XCTest
1717

18+
@available(
19+
*,
20+
deprecated,
21+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
22+
)
1823
final class GaugeTests: XCTestCase {
24+
1925
func testGaugeWithoutLabels() {
2026
let client = PrometheusCollectorRegistry()
2127
let gauge = client.makeGauge(name: "foo", labels: [])

Tests/PrometheusTests/HistogramTests.swift

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ import XCTest
1717

1818
final class HistogramTests: XCTestCase {
1919

20+
@available(
21+
*,
22+
deprecated,
23+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
24+
)
2025
func testFactoryDefaultValueHistogramBuckets() {
2126
var factory = PrometheusMetricsFactory()
2227
factory.defaultValueHistogramBuckets = [
@@ -45,7 +50,11 @@ final class HistogramTests: XCTestCase {
4550
String(decoding: buffer, as: Unicode.UTF8.self)
4651
)
4752
}
48-
53+
@available(
54+
*,
55+
deprecated,
56+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
57+
)
4958
func testHistogramWithoutDimensions() {
5059
let client = PrometheusCollectorRegistry()
5160
let histogram = client.makeDurationHistogram(
@@ -156,7 +165,11 @@ final class HistogramTests: XCTestCase {
156165
"""
157166
)
158167
}
159-
168+
@available(
169+
*,
170+
deprecated,
171+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
172+
)
160173
func testHistogramWithOneDimension() {
161174
let client = PrometheusCollectorRegistry()
162175
let histogram = client.makeDurationHistogram(
@@ -263,7 +276,11 @@ final class HistogramTests: XCTestCase {
263276
"""
264277
)
265278
}
266-
279+
@available(
280+
*,
281+
deprecated,
282+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
283+
)
267284
func testHistogramWithTwoDimension() {
268285
let client = PrometheusCollectorRegistry()
269286
let histogram = client.makeDurationHistogram(
@@ -370,7 +387,11 @@ final class HistogramTests: XCTestCase {
370387
"""
371388
)
372389
}
373-
390+
@available(
391+
*,
392+
deprecated,
393+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
394+
)
374395
func testDurationHistogramWithSharedMetricNameDistinctLabelSets() {
375396
let client = PrometheusCollectorRegistry()
376397

@@ -468,7 +489,11 @@ final class HistogramTests: XCTestCase {
468489
"""
469490
)
470491
}
471-
492+
@available(
493+
*,
494+
deprecated,
495+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
496+
)
472497
func testValueHistogramWithSharedMetricNameDistinctLabelSets() {
473498
let client = PrometheusCollectorRegistry()
474499

@@ -565,7 +590,11 @@ final class HistogramTests: XCTestCase {
565590
}
566591

567592
// MARK: - MetricNameDescriptor Histogram Tests
568-
593+
@available(
594+
*,
595+
deprecated,
596+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
597+
)
569598
func testValueHistogramWithMetricNameDescriptorWithFullComponentMatrix() {
570599
// --- Test Constants ---
571600
let helpTextValue = "https://help.url/sub"
@@ -781,7 +810,11 @@ final class HistogramTests: XCTestCase {
781810
}
782811
}
783812
}
784-
813+
@available(
814+
*,
815+
deprecated,
816+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
817+
)
785818
func testDurationHistogramWithMetricNameDescriptorWithFullComponentMatrix() {
786819
// --- Test Constants ---
787820
let helpTextValue = "https://help.url/sub"

Tests/PrometheusTests/PrometheusCollectorRegistryTests.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
import Prometheus
1616
import XCTest
1717

18+
@available(
19+
*,
20+
deprecated,
21+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
22+
)
1823
final class PrometheusCollectorRegistryTests: XCTestCase {
1924
func testAskingForTheSameCounterReturnsTheSameCounter() {
2025
let client = PrometheusCollectorRegistry()
@@ -231,6 +236,11 @@ final class PrometheusCollectorRegistryTests: XCTestCase {
231236
)
232237
}
233238

239+
@available(
240+
*,
241+
deprecated,
242+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
243+
)
234244
func testUnregisterReregisterWithoutLabels() {
235245
let registry = PrometheusCollectorRegistry()
236246
registry.unregisterCounter(registry.makeCounter(name: "name"))

Tests/PrometheusTests/PrometheusMetricsFactoryTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
import Prometheus
1616
import XCTest
1717

18+
@available(
19+
*,
20+
deprecated,
21+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
22+
)
1823
final class PrometheusMetricsFactoryTests: XCTestCase {
1924
func testMakeTimers() {
2025
let registry = PrometheusCollectorRegistry()

Tests/PrometheusTests/ValidNamesTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
import Prometheus
1616
import XCTest
1717

18+
@available(
19+
*,
20+
deprecated,
21+
message: "This test covers deprecated methods. These methods will be refactored in a future version."
22+
)
1823
final class ValidNamesTests: XCTestCase {
1924
func testCounterWithEmoji() {
2025
let client = PrometheusCollectorRegistry()

0 commit comments

Comments
 (0)