Closed Goutte closed 10 years ago
I added some more code to make sure a feature can still be executed without a worker.
I'm considering an API change in dherkin.
Runners could return classes like this :
/// Feedback from one feature's execution.
class FeatureStatus {
/// The feature that generated this status information.
Feature feature;
/// Was this feature skipped because of mismatching tags ?
bool skipped = false;
/// Has the [feature] passed ? (all scenarios passed)
bool get passed => failedScenariosCount == 0;
/// Has the [feature] failed ? (any scenario failed)
bool get failed => failedScenariosCount > 0;
/// Scenarios. (could also add zapped scenarios)
List<ScenarioStatus> passedScenarios = [];
List<ScenarioStatus> failedScenarios = [];
int get passedScenariosCount => passedScenarios.length;
int get failedScenariosCount => failedScenarios.length;
/// Text buffer for the feature runner to write in.
/// Should contain all lines added by the feature's execution, and only them.
ResultBuffer buffer;
}
/// Feedback from one scenario's execution.
class ScenarioStatus {
/// The [scenario] that generated this status information.
Scenario scenario;
/// Was the [scenario] skipped because of mismatching tags ?
bool skipped = false;
/// Has the [scenario] passed ? (all steps passed)
bool get passed => failedStepsCount == 0;
/// Has the [scenario] failed ? (any step failed)
bool get failed => failedStepsCount > 0;
/// Steps.
List<Step> passedSteps = [];
List<Step> failedSteps = [];
int get passedStepsCount => passedSteps.length;
int get failedStepsCount => failedSteps.length;
/// Text buffer for the scenario runner to write in.
/// Should contain all lines added by the scenario's execution, and only them.
ResultBuffer buffer;
}
/// Feedback from one step's execution.
class StepStatus {
/// The [step] that generated this status information.
Step step;
/// Has the [step] passed ?
bool get passed => error == null;
/// Has the [step] failed ?
bool get failed => error != null;
/// Has the [step] crashed ?
bool get crashed => error != null && !(error is AssertionError);
Exception error;
StackTrace trace;
/// Text buffer for the step runner to write in.
/// Should contain all lines added by the step's execution, and only them.
ResultBuffer buffer;
}
That could allow us to be really flexible on how we manage the output of the runners. Dherkin would still provide a default runner configuration (the same as right now, but refactoring the output of the runner with these classes will allow us to highly customize our runners)
What do you think ?
I'd rather do a merge once the full dartium support is achieved
2014-06-20 22:35 GMT-04:00 Antoine Goutenoir notifications@github.com:
I'm considering an API change in dherkin.
Runners could return classes like this :
/// Feedback from one feature's execution.class FeatureStatus { /// The feature that generated this status information. Feature feature; /// Was this feature skipped because of mismatching tags ? bool skipped = false; /// Has the [feature] passed ? (all scenarios passed) bool get passed => failedScenariosCount == 0; /// Has the [feature] failed ? (any scenario failed) bool get failed => failedScenariosCount > 0; /// Scenarios. (could also add zapped scenarios) List
passedScenarios = []; List failedScenarios = []; int get passedScenariosCount => passedScenarios.length; int get failedScenariosCount => failedScenarios.length; /// Text buffer for the feature runner to write in. /// Should contain all lines added by the feature's execution, and only them. ResultBuffer buffer;} /// Feedback from one scenario's execution.class ScenarioStatus { /// The [scenario] that generated this status information. Scenario scenario; /// Was the [scenario] skipped because of mismatching tags ? bool skipped = false; /// Has the [scenario] passed ? (all steps passed) bool get passed => failedStepsCount == 0; /// Has the [scenario] failed ? (any step failed) bool get failed => failedStepsCount > 0; /// Steps. List
passedSteps = []; List failedSteps = []; int get passedStepsCount => passedSteps.length; int get failedStepsCount => failedSteps.length; /// Text buffer for the scenario runner to write in. /// Should contain all lines added by the scenario's execution, and only them. ResultBuffer buffer;} /// Feedback from one step's execution.class StepStatus { /// The [step] that generated this status information. Step step; /// Has the [step] passed ? bool get passed => error == null; /// Has the [step] failed ? bool get failed => error != null; /// Has the [step] crashed ? bool get crashed => error != null && !(error is AssertionError);
Exception error; StackTrace trace;
/// Text buffer for the step runner to write in. /// Should contain all lines added by the step's execution, and only them. ResultBuffer buffer;}
That could allow us to be really flexible on how we manage the output of the runners. Dherkin would still provide a default runner configuration (the same as right now, but refactoring the output of the runner with these classes will allow us to highly customize our runners)
What do you think ?
— Reply to this email directly or view it on GitHub https://github.com/dkornishev/dherkin/pull/16#issuecomment-46742462.
This is a big one.
ColoredFragmentsBuffer
internally.If you add code to dherkin as of now, you should base it upon this commit, as merging might be a pain.
I think I've got enough flexibility to run my jungle in Dartium, but there still is a lot to do for full support. If I craft things that make sense to be in dherkin, I'll bring them back here !
Extracted gherkin parsing logic from task, so that we may use it without Isolates. Custom fork of worker only removes the dep to dart:io (and therefore the
Platform.numberOfProcessors
feature)Looks like the pool of
Isolates
inWorker
can be bigger thanPlatform.numberOfProcessors
, by the way.