Please summarize your feature request
Update testing queues documentation to reflect Swift Testing framework
Describe the functionality you're seeking in more detail
Current documentation for testing queues https://docs.vapor.codes/advanced/queues/#testing could be updated to support Swift Testing framework as Apple is moving towards this methodology anyway see this link.
Steps to Compiling
- In
Package.swift add the following package:
.package(url: "https://github.com/vapor/queues", from: "1.18.0")
- In
Package.swift add to executable package
.product(name: "Queues", package: "queues")
- Add this to the test target as well
.testTarget(
name: "queues_appTests",
dependencies: [
.target(name: "<your_app_name_here>"),
.product(name: "VaporTesting", package: "vapor"),
.product(name: "XCTQueues", package: "queues")
],
swiftSettings: swiftSettings
)
Example Test File That Compiles
import VaporTesting
import Testing
import XCTQueues
@Suite("Queues Tests")
struct QueuesAppTests {
@Test("Setup and Test Queue")
func setupAndTestQueue() async throws {
let app = try await Application.make(.testing)
defer {
Task {
try await app.asyncShutdown()
}
}
app.queues.use(.asyncTest)
try await configure(app)
}
}
Have you considered any alternatives?
There really isn't an alternative that I could find to get my test suite compiling besides digging and configuring the testing harness in a way that made Swift Testing happy.
I tried using the current documentation to setup queues testing in the Swift Testing methodology but it does not compile because it could not find the correct XCTQueues package which provides the .asyncTest provider.
Please summarize your feature request
Update testing queues documentation to reflect Swift Testing framework
Describe the functionality you're seeking in more detail
Current documentation for testing queues https://docs.vapor.codes/advanced/queues/#testing could be updated to support Swift Testing framework as Apple is moving towards this methodology anyway see this link.
Steps to Compiling
Package.swiftadd the following package:Package.swiftadd to executable packageExample Test File That Compiles
Have you considered any alternatives?
There really isn't an alternative that I could find to get my test suite compiling besides digging and configuring the testing harness in a way that made Swift Testing happy.
I tried using the current documentation to setup queues testing in the Swift Testing methodology but it does not compile because it could not find the correct
XCTQueuespackage which provides the.asyncTestprovider.