Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-ricks committed Oct 23, 2024
1 parent 3070943 commit 3ec9a4b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
1 change: 1 addition & 0 deletions Tests/Workflows.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"testTargets" : [
{
"parallelizable" : false,
"target" : {
"containerPath" : "container:",
"identifier" : "WorkflowsTests",
Expand Down
6 changes: 1 addition & 5 deletions Tests/WorkflowsTests/Helpers/Clock+Yield.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import Clocks

extension TestClock {
func run(afterYield: Bool) async {
if afterYield {
await Task.yield()
}

await run()
await run(timeout: .seconds(5))
}
}
17 changes: 9 additions & 8 deletions Tests/WorkflowsTests/Helpers/ValueWorkflow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct ValueWorkflow<Value: Sendable & Hashable>: Workflow {
log("starting run")
if delay != .zero {
log("sleeping for \(delay)")
print("Starting Sleep")
try? await clock.sleep(for: delay)
log("finished sleeping.")
}
Expand All @@ -71,13 +72,13 @@ struct ValueWorkflow<Value: Sendable & Hashable>: Workflow {
}

private func log(_ message: String) {
let prefix = switch result {
case .success(let value):
"[ INFO ] ValueWorkflow(value: \(value))"
case .failure(let error):
"[ INFO ] ValueWorkflow(throwing: \(error))"
}

print("\(prefix) \(message)")
// let prefix = switch result {
// case .success(let value):
// "[ INFO ] ValueWorkflow(value: \(value))"
// case .failure(let error):
// "[ INFO ] ValueWorkflow(throwing: \(error))"
// }
//
// print("\(prefix) \(message)")
}
}
1 change: 0 additions & 1 deletion Tests/WorkflowsTests/ZipWorkflowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import Testing
#expect(one == 1)
#expect(two == "foo")
#expect(three == true)
print(await trace.store)
#expect(await trace == Array("foo", true, 1))
}
}
Expand Down

0 comments on commit 3ec9a4b

Please sign in to comment.