如何按顺序执行 运行 ZIO 测试
How to enforce to run ZIO Tests sequentially
我想 运行 依次进行两个集成测试。如何在 ZIO 测试?
中实现
这是套房:
suite("Undeploy a Package")(
testM("There is a Package") {
PackageDeployer.deploy(pckg) *> // first deploy
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NoContent))
},
testM(s"There is no Package") {
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NotFound))
})
ZIO 测试 运行 并行进行两个测试。有没有办法强制它们在序列中是 运行?
是的!您可以为此使用 TestAspect.sequential
:
suite("Undeploy a Package")(
testM("There is a Package") {
PackageDeployer.deploy(pckg) *> // first deploy
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NoContent))
},
testM(s"There is no Package") {
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NotFound))
}) @@ sequential
我想 运行 依次进行两个集成测试。如何在 ZIO 测试?
中实现这是套房:
suite("Undeploy a Package")(
testM("There is a Package") {
PackageDeployer.deploy(pckg) *> // first deploy
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NoContent))
},
testM(s"There is no Package") {
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NotFound))
})
ZIO 测试 运行 并行进行两个测试。有没有办法强制它们在序列中是 运行?
是的!您可以为此使用 TestAspect.sequential
:
suite("Undeploy a Package")(
testM("There is a Package") {
PackageDeployer.deploy(pckg) *> // first deploy
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NoContent))
},
testM(s"There is no Package") {
assertM(PackageUndeployer.undeploy(pckg), equalTo(StatusCode.NotFound))
}) @@ sequential