Skip to content

Warnings-as-errors or similar #3598

@msimberg

Description

@msimberg

Sometimes tests get excluded with a warning because of issues with the tests. Some examples we've encountered recently:

  • Name conflicts (WARNING: skipping test file 'a.py': name conflict error: test 'Foo' from 'a.py' is already defined in 'b.py')
  • Version mismatch (WARNING: skipping test file 'a.py': attribute error: module 'reframe' has no attribute 'xfail')
  • Other test test issues (WARNING: skipping test file 'a.py': permission error: [Errno 13] Permission denied: '/a/b/c'; the test setup makes assumptions about the system)

Reframe warns about these which is great. However, in automated testing (e.g. CI) none of these are actually noticed without manually looking at logs because the tests are silently ignored instead of causing a failure.

As far as I could tell, there's no way to ask for this currently when running tests. Did I miss it or would it be possible to add such a mode (--warnings-as-errors)?

What I'm thinking of is perhaps not failing immediately on warnings (i.e. still run the tests that are discovered) but exit at the end with an error, even if all tests were otherwise successful.

Similarly, if no tests are found it'd be great to have a way to ask reframe to make that a failure to avoid silently having no tests run.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions