If an exception occurs while Kaocha loads a test namespace, then a warning is printed, the :kaocha.type/namespace test is marked as failed, and loading/running continues.
This is so that when you have a typo which prevents a test namespace from loading, this doesn't stop the world. Instead it just runs the rest of the tests, and reports a failure pointing at the syntax error.
The problem with this approach is that loading a namespace could fail because a dependent namespace has issues. In the degenerate case a source namespace that is used indirectly in every test fails to load, causing a failure to be reported for every test namespace. This is especially easy to do (and annoying to encounter) in --watch mode.
Instead when loading a test namespace we should first evaluate its ns form. If that causes issues then we hard abort the test run. Only after the ns form has loaded do we load the full namespace, and turn load errors into test failures.
If an exception occurs while Kaocha loads a test namespace, then a warning is printed, the
:kaocha.type/namespacetest is marked as failed, and loading/running continues.This is so that when you have a typo which prevents a test namespace from loading, this doesn't stop the world. Instead it just runs the rest of the tests, and reports a failure pointing at the syntax error.
The problem with this approach is that loading a namespace could fail because a dependent namespace has issues. In the degenerate case a source namespace that is used indirectly in every test fails to load, causing a failure to be reported for every test namespace. This is especially easy to do (and annoying to encounter) in
--watchmode.Instead when loading a test namespace we should first evaluate its
nsform. If that causes issues then we hard abort the test run. Only after thensform has loaded do we load the full namespace, and turn load errors into test failures.