-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Fail-fast option #413
Comments
It can be even better. If Intern natively supports retries, it doesn't have to repeat the entire lot of suites or even restart the process. In my ideal setup, CI would probably retry a test once or twice before considering it truly failed and once that had been decided, would not continue. So combining these is indeed powerful, especially if it's handled within Intern itself. |
@csnover in #368 (comment) you mentioned that in Intern 3 it should be possible to pause flow, what this help this issue? |
Yes it will help, it should be much easier to bail out of running any more tests now |
any pointers on how to do that? I think @miketaylr wanted to hook that up
|
In |
- Add a new config option `failFast`. Setting this to a truthy value will cause all subsequent tests after a failing test to be skipped. - Support a new `skipped` property on suites. This property behaves similarly to `Test#skipped`. Setting it to a non-null value will cause the remainder of a suite (all tests and nested suites) to be skipped. References theintern#413
A new config option `bail` is available. Setting this to a truthy value will cause all subsequent tests (in all suites) after a failing test to be skipped. Resolves theintern#413
Any way I can enable fail fast but not have my terminal spammed with all the skipped tests? NVM, i made my own reporter: // ./test/e2e/support/FailFastReporter.js
/* global define */
define([
'intern/lib/reporters/Runner',
], function (Runner) {
function extend (target, source) {
target.prototype = Object.create(source.prototype);
target.prototype.constructor = target;
return source.prototype;
}
var FailFastReporter = function (config) {
Runner.call(this, config);
};
var parent = extend(FailFastReporter, Runner);
FailFastReporter.prototype.testSkip = function () {};
return FailFastReporter;
}); |
That's the spirit! That's a good idea -- having an option to hide skipped tests would actually be pretty handy. |
Problem
For users of Continuous Integration / Delivery systems, the excess testing and build time caused by multiple test failures can be very undesirable, such as for a shared dev branch where speed is important and time-to-deploy is compounded and queued many times over. It can also consume precious resources from per-hour test clouds like BrowserStack and SauceLabs.
Solution
Provide an opt-in configuration option to halt at the first test failure. A relevant reference is the fail_fast option for RSpec or Mocha's
--bail
.Suggested requirements
Stretch goal: make it configurable so that it can be told to only abort the rest of the current suite or only the rest of the unit tests, but not functional tests, etc.
The text was updated successfully, but these errors were encountered: