Skip to content

Make a distinction between load errors in the test file being loaded vs. in other namespaces. #27

@plexus

Description

@plexus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ergonomicsMaking Kaocha delightful to work with and people more efficientimprovementIncremental improvement of an existing feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Candidate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions