I'm building some tests around my pipeline and particularly I have two branches (one where errors are considered, another where successes), on the errors side I have an incrementing counter (ScioMetrics.counter("MetricName").inc()
) and when building the tests for the other branch I want to assert that the errors counter is 0.
JobTest.
...
.counter(ScioMetrics.counter("MetricName"))(_ shouldBe 0)
...
I get a NoSuchelementException
when the test runs successfully with a message explaining that the metric wasn't found as it might not have been accessed inside the pipeline, which is ok as I can assert that the exception is raised, but. Shouldn't there be a "nicer" way of testing that?
Thanks!