scala - 如何强制按顺序运行 ZIO 测试
问题描述
我想按顺序运行两个集成测试。这如何在ZIO Test中实现?
这是套房:
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 Test并行运行这两个测试。有没有办法强制它们按顺序运行?
解决方案
是的!您可以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
推荐阅读
- data-mining - 词关联挖掘如何泛化n-gram语言模型
- javascript - 天气 api 密钥不起作用
- google-contacts-api - Google GCM 弃用 - 使用 GCM 令牌的旧移动客户端
- ubuntu - sed 和重命名文件
- javascript - $(this) 不在委托事件处理程序中选择子元素
- c# - 从 ResourceDirectory 绑定到 ViewModel 中的属性
- sql - 如何在 Croud Repository 中查找特定列不同的最后 10 个实体?
- android - 如果我设置的触发时间已经过去,如何让 AlarmManager 不执行我的通知?
- c - Eclipse-Photon 三元算子编译错误
- java - 从迭代器中删除数组中元素的最佳方法是什么?