Skip to content

mdtest output in CI isn't colourised #235

@AlexWaygood

Description

@AlexWaygood

If you run cargo test -p red_knot_python_semantic locally and an mdtest fails, you get nice pretty colours that make the test output much more readable, eg.:

image

But if you run cargo test (rather than cargo test -p red_knot_python_semantic) or cargo nextest (which is what we do in CI), the output isn't colourised, which makes the output much harder to read: https://github.com/astral-sh/ruff/actions/runs/11530541010/job/32100248614?pr=13918

This is because some of the other crates enable the "no_color" feature of the colored dependency, which is how we add colours to the output of mdtest: https://github.com/astral-sh/ruff/blob/b6ffa51c164e3898862c565ec860bbca928ddee9/crates/ruff_linter/Cargo.toml#L77-L78

When you run all the tests together, that feature ends up being enabled, meaning no mdtest colours. It would be great if we could see if there was a way of having coloured output for mdtest in CI without breaking the tests for those other crates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalAn internal refactor or improvementtestingRelated to testing ty itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions