Hi, I'm migrating some tests to TestBalloon :testb...
# testballoon
l
Hi, I'm migrating some tests to TestBalloon testballoon In the repo we keep a test for debugging failed events, which it is only required when we populate a directory with data which is not committed. Here's a cut down version:
Copy code
val FailedEventsDebugSpec by testSuite {
  ResourceSupport.findAllResourcesInPackage("failed-events", of { it.name.endsWith(".json") })
    .associate { resource ->
      Path(resource.name).name to resource.inputStream.readAllBytes().decodeToString()
    }
    .forEach { (pathName, event) -> test(pathName) { true shouldBe true } }
}
As the directory is usually empty we get the following error during test discovery
java.lang.IllegalStateException: does not contain any child tests or test suites.
Please add at least one test or test suite to this test suite, or remove it.
I've tried
TestConfig.disable()
at the test and testSuite level which doesn't work. I can add
test("ignore me", testConfig = TestConfig.disable()) { }
into the testSuite to get it to run which is a bit or ugly or I could just comment out the test until its needed. Have I missed a simpler config option?
o
Yes, and the error message could be improved to mention this: In a case like yours where an empty test suite is entirely valid, you can add
Copy code
testConfig = TestConfig.addPermits(TestConfig.Permit.SuiteWithoutChildren)
to the
FailedEventsDebugSpec
test suite.
New error message will be
Copy code
java.lang.IllegalStateException: TestSuite('suite1') does not contain any child tests or test suites.
	Please either
	- add at least one test or test suite to TestSuite('suite1'),
	- remove TestSuite('suite1'), or
	- use 'testConfig = TestConfig.addPermits(TestConfig.Permit.SuiteWithoutChildren)' on TestSuite('suite1').
l
thank you color
kodee happy 1