Skip to content

Commit 8f2b2cb

Browse files
committed
depend on swift-distributed-traing InMemoryTracer for tests
1 parent 0034dca commit 8f2b2cb

File tree

7 files changed

+8
-419
lines changed

7 files changed

+8
-419
lines changed

[email protected]

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ let package = Package(
5757
.package(url: "https://github.com/apple/swift-log.git", from: "1.6.0"),
5858
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.0.2"),
5959
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.0.0"),
60-
.package(url: "https://github.com/apple/swift-distributed-tracing.git", from: "1.0.0"),
60+
.package(url: "https://github.com/apple/swift-distributed-tracing.git", from: "1.3.0"),
6161
],
6262
targets: [
6363
.target(
@@ -105,6 +105,9 @@ let package = Package(
105105
.product(name: "Logging", package: "swift-log"),
106106
.product(name: "Atomics", package: "swift-atomics"),
107107
.product(name: "Algorithms", package: "swift-algorithms"),
108+
// Observability support
109+
.product(name: "Tracing", package: "swift-distributed-tracing", condition: .when(traits: [TracingSupport])),
110+
.product(name: "InMemoryTracing", package: "swift-distributed-tracing", condition: .when(traits: [TracingSupport])),
108111
],
109112
resources: [
110113
.copy("Resources/self_signed_cert.pem"),

Sources/AsyncHTTPClient/HTTPClient.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ let globalRequestID = ManagedAtomic(0)
6161
/// }
6262
/// }
6363
/// ```
64-
// #if TracingSupport
65-
// @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
66-
// #endif
6764
public final class HTTPClient: Sendable {
6865
/// The `EventLoopGroup` in use by this ``HTTPClient``.
6966
///

Tests/AsyncHTTPClientTests/HTTPClientBase.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import Network
3232

3333
#if TracingSupport
3434
import Tracing
35+
import InMemoryTracing
3536
#endif
3637

3738
class XCTestCaseHTTPClientTestsBaseClass: XCTestCase {
@@ -43,7 +44,7 @@ class XCTestCaseHTTPClientTestsBaseClass: XCTestCase {
4344
var defaultClient: HTTPClient!
4445
var backgroundLogStore: CollectEverythingLogHandler.LogStore!
4546
#if TracingSupport
46-
var inMemoryTracer: (InMemoryTestTracer)!
47+
var inMemoryTracer: (InMemoryTracer)!
4748
#endif
4849

4950
var defaultHTTPBinURLPrefix: String {
@@ -74,7 +75,7 @@ class XCTestCaseHTTPClientTestsBaseClass: XCTestCase {
7475
var configuration = HTTPClient.Configuration().enableFastFailureModeForTesting()
7576

7677
#if TracingSupport
77-
self.inMemoryTracer = InMemoryTestTracer()
78+
self.inMemoryTracer = InMemoryTracer()
7879
configuration.tracer = self.inMemoryTracer
7980
#endif // TracingSupport
8081

Tests/AsyncHTTPClientTests/HTTPClientTracingTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import XCTest
2929

3030
#if TracingSupport
3131
import Tracing
32+
import InMemoryTracing
3233
#endif
3334

3435
final class HTTPClientTracingTests: XCTestCaseHTTPClientTestsBaseClass {

Tests/AsyncHTTPClientTests/Tracing/InMemoryTestTracer.swift

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)