fix(runner): Ensure scenario support files (world etc) as always disposed ensure when test throws error

This commit is contained in:
Jon Samwell 2021-09-16 11:37:16 +10:00
parent ed88094462
commit 3c0e1c6270
5 changed files with 49 additions and 43 deletions

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-09-15 14:52:31.748089","version":"2.5.0"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Google\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-09-16 11:36:24.117283","version":"2.5.0"}

View File

@ -1,3 +1,7 @@
## [3.0.0-rc.5] - 22/06/2021
- Ensure scenario support files (world etc) as always disposed ensure when test throws error
## [3.0.0-rc.4] - 21/06/2021 ## [3.0.0-rc.4] - 21/06/2021
- Removed debug code - Removed debug code

View File

@ -150,52 +150,54 @@ abstract class GherkinIntegrationTestRunner {
tester, tester,
); );
await hook.onBeforeScenario( try {
configuration, await hook.onBeforeScenario(
name, configuration,
scenarioTags,
);
await startApp(
tester,
dependencies.world,
);
await hook.onAfterScenarioWorldCreated(
dependencies.world,
name,
scenarioTags,
);
await reporter.onScenarioStarted(
StartedMessage(
Target.scenario,
name, name,
debugInformation,
scenarioTags, scenarioTags,
), );
);
await runTest(dependencies); await startApp(
tester,
dependencies.world,
);
await reporter.onScenarioFinished( await hook.onAfterScenarioWorldCreated(
ScenarioFinishedMessage( dependencies.world,
name, name,
debugInformation, scenarioTags,
true, );
),
);
await hook.onAfterScenario( await reporter.onScenarioStarted(
configuration, StartedMessage(
name, Target.scenario,
scenarioTags, name,
); debugInformation,
scenarioTags,
),
);
cleanupScenarioRun(dependencies); await runTest(dependencies);
} finally {
await reporter.onScenarioFinished(
ScenarioFinishedMessage(
name,
debugInformation,
true,
),
);
if (onAfter != null) { await hook.onAfterScenario(
await onAfter(); configuration,
name,
scenarioTags,
);
if (onAfter != null) {
await onAfter();
}
cleanupScenarioRun(dependencies);
} }
}, },
timeout: scenarioExecutionTimeout, timeout: scenarioExecutionTimeout,

View File

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "25.0.0" version: "26.0.0"
analyzer: analyzer:
dependency: "direct main" dependency: "direct main"
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -249,7 +249,7 @@ packages:
name: pubspec_parse name: pubspec_parse
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.1.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter

View File

@ -1,6 +1,6 @@
name: flutter_gherkin name: flutter_gherkin
description: A Gherkin / Cucumber parser and test runner for Dart and Flutter description: A Gherkin / Cucumber parser and test runner for Dart and Flutter
version: 3.0.0-rc.4 version: 3.0.0-rc.5
homepage: https://github.com/jonsamwell/flutter_gherkin homepage: https://github.com/jonsamwell/flutter_gherkin
environment: environment: