Tagging
Weaver provides some constructs to dynamically tag tests as ignored
or cancelled
:
import weaver._
import cats.effect.IO
import cats.syntax.all._
object TaggingSuite extends SimpleIOSuite {
test("Only on CI") {
for {
onCI <- IO(sys.env.get("CI").isDefined)
_ <- ignore("not on CI").unlessA(onCI)
x <- IO.delay(1)
y <- IO.delay(2)
} yield expect(x == y)
}
test("Another on CI") {
for {
onCI <- IO(sys.env.get("CI").isDefined)
_ <- cancel("not on CI").unlessA(onCI)
x <- IO.delay(1)
y <- IO.delay(2)
} yield expect(x == y)
}
}
repl.MdocSessionMdocAppTaggingSuite
- Only on CI 17ms
- Another on CI 8ms
*************FAILURES*************
repl.MdocSessionMdocAppTaggingSuite
- Only on CI 17ms
assertion failed (tagging.md:25)
} yield expect(x == y)
| | |
1 | 2
false
- Another on CI 8ms
assertion failed (tagging.md:34)
} yield expect(x == y)
| | |
1 | 2
false
Total 2, Failed 2, Passed 0, Ignored 0, Cancelled 0