Repository navigation
Remove criticality - #3662
Remove criticality#3662
Conversation
Since we only have one type of tests, the xx tests total no longer makes sense
|
Only 81 files 🤣 |
|
Some notes about criticality use cases to check if we can cover these also in the future: Criticality seems to be mostly used to control execution return code. Making the execution to return 0 to indicate to continuous integration server or other execution service that operations should continue normally. Static cases:
Dynamic cases:
Any other? |
|
I think |
pekkaklarck
left a comment
There was a problem hiding this comment.
Looks great but I found few smallish things that could be still addressed. Assuming tests pass, this PR is otherwise ready to be merged.
| 'Any Critical Tests Failed') | ||
| if suite.statistics.critical.failed > 0: | ||
| return self.run_keyword(name, *args) | ||
|
|
There was a problem hiding this comment.
These keywords should be deprecated, not removed. They should be basically aliases for the all tests variants. Tests can be removed.
|
|
||
| def __iter__(self): | ||
| return iter([self.critical, self.all]) | ||
| return iter([self.all]) |
There was a problem hiding this comment.
I think this could just be yield self.all.
| For example:: | ||
|
|
||
| 2 critical tests, 1 passed, 1 failed | ||
| 2 tests total, 1 passed, 1 failed |
There was a problem hiding this comment.
Isn't the version we use just 2 tests, ..., not 2 tests total, ...?
| """ | ||
| test_or_task = 'test' if not self._rpa else 'task' | ||
| ctotal, cend, cpass, cfail = self._get_counts(self.critical) | ||
| atotal, aend, apass, afail = self._get_counts(self.all) |
There was a problem hiding this comment.
a prefix can be removed because c variants have been removed.
| settings = RebotSettings(options) | ||
| LOGGER.register_console_logger(**settings.console_output_config) | ||
| if settings['XUnitSkipNonCritical']: | ||
| LOGGER.warn("Command line option --xunitskipnoncritical has been deprecated.") |
There was a problem hiding this comment.
Previously these cli option deprecations have been handled when validating settings (_BaseSettings._process_value if I remember correctly) and I think it would be a bit better with this option as well.
There was a problem hiding this comment.
For some reason, when I added the deprecation warning there, the warning message was echoed twice to console. Something to do with register_console_logger I suppose.
| if not self.parent: | ||
| return True | ||
| return self.parent.criticality.test_is_critical(self) | ||
|
|
There was a problem hiding this comment.
This property could be preserved with this kind of implementation:
warnigs.warn("'TestCase.criticality' has been deprecated and always returns 'True'.",
UserWarning)
return True| if self.parent is not None: | ||
| raise ValueError('Criticality can only be set to the root suite.') | ||
| self._criticality = Criticality(critical_tags, non_critical_tags) | ||
|
|
There was a problem hiding this comment.
Although I think preserving TestCase.critical is a good idea, I would say these methods can be safely removed.
| settings = RobotSettings(options) | ||
| LOGGER.register_console_logger(**settings.console_output_config) | ||
| if settings['XUnitSkipNonCritical']: | ||
| LOGGER.warn("Command line option --xunitskipnoncritical has been deprecated.") |
There was a problem hiding this comment.
Moving deprecation to settings, as I commented earlier, would avoid this duplication.
|
|
||
| def critical_failure_occurred(self): | ||
| self.exit.failure_occurred(critical=True) | ||
| self.exit.failure_occurred() |
There was a problem hiding this comment.
Should probably remove critical_ from the method name.
| -c pass --status ${FAILING} rc=0 | ||
|
|
||
| Non-zero RC when critical tests fail | ||
| Non-zero RC when ests fail |
They must be properly deprected before they can be removed
No description provided.