Is there any way to dynamically skip tests (someth...
# testballoon
p
Is there any way to dynamically skip tests (something like JUnit Assumptions) - I'd like to have a BDD style (linear) test suite that skips subsequent steps after a failure, but without those steps registering as failures themselves
It seems adding
TestAboartedException
(or
IncompleteExecutionException
) to the
executionResult
calculation adds support for JUnit Platform Assumptions.
Copy code
private val TestElement.Event.Finished.executionResult: TestExecutionResult
    get() =
        when (throwable) {
            null -> TestExecutionResult.successful()
            is org.opentest4j.TestAbortedException,
            is FailFastException,
                -> TestExecutionResult.aborted(throwable)

            else -> TestExecutionResult.failed(throwable)
        }
o
Yep, it makes sense to support that case, even if it's JUnit 5+ only. Mind adding an issue and a PR?
p
Happy to - wasn't sure where/how best to add a test that actually runs the JUnitPlatformTestFramework beyond in one of the examples
o
Full ecosystem testing is the responsibility of the
integration-test
module. Within the component tests, it's a bit difficult, because "testing a test framework within another test framework". But you don't need to care about this. I can always add such tests in the process or just later on.