Skip to content

Tests that are not run due to earlier fatal error should get SKIP status, not FAIL #4170

Description

@dgalezow

With the implementation of SKIP status, it makes more sense to mark Test Cases that were not even started as SKIP instead of FAIL

As @pekkaklarck mentioned on slack it would be good to implement this for all ways to gracefully stop execution like
Fatal Error keyword
--exitonfailure

Activity

  1. added this to the v5.0 milestone on Dec 15, 2021
  2. pekkaklarck commented on Dec 15, 2021

    @pekkaklarck
    Member

    Yeah, SKIP is a much better status than FAIL with tests that aren't run due to an earlier fatal error. In additions to things already listed in the description, also stopping with signals (incl. pressing Ctrl-C) works this way. Ought to be easy to change, probably updating tests is much more work.

  3. changed the title [-]BuiltIn.Fatal Error should mark skipped test cases as SKIP, not FAIL[/-] [+]Tests that are not run due to earlier fatal error should get SKIP status, not FAIL[/+] on Dec 15, 2021
  4. pekkaklarck commented on Dec 15, 2021

    @pekkaklarck
    Member

    When using the --dotted console mode, we actually already now use x on console instead of F with these failures to separate the "real" failure from others. If using SKIP, not FAIL, there would be no need for that functionality anymore.

  5. pekkaklarck commented on Dec 15, 2021

    @pekkaklarck
    Member

    How to handle --exitonerror (#1807) turned out to be a bit tricky:

    • If there's a parsing error (e.g. an invalid setting) no tests are run and all are marked skipped. The whole execution getting SKIP status isn't good.
    • If there's an import error, all tests in that executed suite and in subsequent suites are skipped. If that was the first suite, all tests are skipped and the overall status is SKIP like with parsing errors. If, on the other hand, a suite has been executed successfully before, overall status is PASS which is even worse because lot of tests were skipped and the reason for skipping was an error.

    I'm actually not sure what's the best way to handle this. With import errors we possibly could FAIL all tests in that suite and SKIP tests in subsequent suites. With parsing errors this is trickier. Ideally we should mark tests in the suite containing the parsing error FAILed but that can be hard. Possibly just the fist executed test, regardless did that suite contain errors, could get FAIL status.

  6. pekkaklarck commented on Dec 15, 2021

    @pekkaklarck
    Member

    Need to also handle a situation where a fatal error occurs in suite setup specially. Tests in that suite should get FAIL status, not SKIP. Tests in subsequent suite should get SKIP.

  7. pekkaklarck commented on Jan 19, 2022

    @pekkaklarck
    Member

    This would be nice enhancement but due to the problems caused by --exitonerror this is too big task for RF 5.0. The best way to handle those problems would probably be making errors in data more severe so that, for example, all tests in a suite would fail if there's a failing import or an invalid setting.

    Making errors more severe would somewhat badly backwards incompatible. Doing it in RF 5.1 may thus not be safe but I initially assign this to that release anyway.

  8. modified the milestones: v5.0, v5.1 on Jan 19, 2022
  9. modified the milestones: v5.1, v5.2 on Sep 1, 2022
  10. pekkaklarck commented on Oct 12, 2022

    @pekkaklarck
    Member

    One way to handle --exitonerror with parsing errors would be not running anything. Currently, if you run robot --exitonerror tests.robot and the file contains, for example, an invalid setting, the suite is run and all tests are failed due to the error. We could, instead, decide not to run anything and just report the error. That's the same approach we use normally when you try to run a non-existing file or a file that doesn't contain any tests.

    Even after this change, we still needed to handle, for example, failed library imports properly when --exitonerror is used, but that could be handle same way as a failed suite setup.

  11. modified the milestones: v6.1, v7.0 on Jan 16, 2023
  12. pekkaklarck commented on Jan 16, 2023

    @pekkaklarck
    Member

    This change would change test statuses which can cause backwards compatibility problems. It's safer to do it in RF 7.0.

  13. rikerfi commented on Mar 16, 2023

    @rikerfi
    Contributor

    If I use prerebotmodifier, am I able to separate/detect this SKIP from e.g. usage of Skip keyword?

  14. modified the milestones: v7.0, v8.0 on Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions