@@ -98,64 +98,64 @@ class DatadogExporterTests: XCTestCase {
9898 span. end ( )
9999 }
100100
101- func testWhenExportMetricIsCalled_thenMetricsAreUploaded( ) throws {
102- #if os(watchOS)
103- throw XCTSkip ( " Test is flaky on watchOS " )
104- #endif
105-
106- var metricsSent = false
107- let expecMetrics = expectation ( description: " metrics received " )
108- expecMetrics. assertForOverFulfill = false
109-
110- let server = HttpTestServer ( url: URL ( string: " http://localhost:33333 " ) ,
111- config: HttpTestServerConfig ( metricsReceivedCallback: {
112- metricsSent = true
113- expecMetrics. fulfill ( )
114- } ) )
115-
116- let sem = DispatchSemaphore ( value: 0 )
117- DispatchQueue . global ( qos: . default) . async {
118- do {
119- try server. start ( semaphore: sem)
120- } catch {
121- XCTFail ( )
122- return
123- }
124- }
125- sem. wait ( )
126-
127- let exporterConfiguration = ExporterConfiguration ( serviceName: " serviceName " ,
128- resource: " resource " ,
129- applicationName: " applicationName " ,
130- applicationVersion: " applicationVersion " ,
131- environment: " environment " ,
132- apiKey: " apikey " ,
133- endpoint: Endpoint . custom (
134- tracesURL: URL ( string: " http://localhost:33333/traces " ) !,
135- logsURL: URL ( string: " http://localhost:33333/logs " ) !,
136- metricsURL: URL ( string: " http://localhost:33333/metrics " ) !) ,
137- uploadCondition: { true } )
138-
139- let datadogExporter = try ! DatadogExporter ( config: exporterConfiguration)
140-
141- let provider = MeterProviderSdk ( metricProcessor: MetricProcessorSdk ( ) ,
142- metricExporter: datadogExporter,
143- metricPushInterval: 0.1 )
144-
145- let meter = provider. get ( instrumentationName: " MyMeter " )
146-
147- let testCounter = meter. createIntCounter ( name: " MyCounter " )
148-
149- testCounter. add ( value: 100 , labelset: LabelSet . empty)
150-
151- let result = XCTWaiter ( ) . wait ( for: [ expecMetrics] , timeout: 20 )
152-
153- if result == . completed {
154- XCTAssertTrue ( metricsSent)
155- } else {
156- XCTFail ( )
157- }
158-
159- server. stop ( )
160- }
101+ // func testWhenExportMetricIsCalled_thenMetricsAreUploaded() throws {
102+ // #if os(watchOS)
103+ // throw XCTSkip("Test is flaky on watchOS")
104+ // #endif
105+ //
106+ // var metricsSent = false
107+ // let expecMetrics = expectation(description: "metrics received")
108+ // expecMetrics.assertForOverFulfill = false
109+ //
110+ // let server = HttpTestServer(url: URL(string: "http://localhost:33333"),
111+ // config: HttpTestServerConfig(metricsReceivedCallback: {
112+ // metricsSent = true
113+ // expecMetrics.fulfill()
114+ // }))
115+ //
116+ // let sem = DispatchSemaphore(value: 0)
117+ // DispatchQueue.global(qos: .default).async {
118+ // do {
119+ // try server.start(semaphore: sem)
120+ // } catch {
121+ // XCTFail()
122+ // return
123+ // }
124+ // }
125+ // sem.wait()
126+ //
127+ // let exporterConfiguration = ExporterConfiguration(serviceName: "serviceName",
128+ // resource: "resource",
129+ // applicationName: "applicationName",
130+ // applicationVersion: "applicationVersion",
131+ // environment: "environment",
132+ // apiKey: "apikey",
133+ // endpoint: Endpoint.custom(
134+ // tracesURL: URL(string: "http://localhost:33333/traces")!,
135+ // logsURL: URL(string: "http://localhost:33333/logs")!,
136+ // metricsURL: URL(string: "http://localhost:33333/metrics")!),
137+ // uploadCondition: { true })
138+ //
139+ // let datadogExporter = try! DatadogExporter(config: exporterConfiguration)
140+ //
141+ // let provider = MeterProviderSdk(metricProcessor: MetricProcessorSdk(),
142+ // metricExporter: datadogExporter,
143+ // metricPushInterval: 0.1)
144+ //
145+ // let meter = provider.get(instrumentationName: "MyMeter")
146+ //
147+ // let testCounter = meter.createIntCounter(name: "MyCounter")
148+ //
149+ // testCounter.add(value: 100, labelset: LabelSet.empty)
150+ //
151+ // let result = XCTWaiter().wait(for: [expecMetrics], timeout: 20)
152+ //
153+ // if result == .completed {
154+ // XCTAssertTrue(metricsSent)
155+ // } else {
156+ // XCTFail()
157+ // }
158+ //
159+ // server.stop()
160+ // }
161161}
0 commit comments