jonsamwell/flutter_gherkin

rc.16 / web: Unsupported operation: StdIOUtils._getStdioOutputStream when running integration tests on web

robert-virkus opened this issue · 4 comments

I tried to upgrade from the old rc.9 to the latest rc.16 release.

With rc.9 I can run web integraton tests fine.

With the rc.16 release I retrieve Unsupported operation: StdIOUtils._getStdioOutputStream while running the tests.

The root cause seems to be using dart.io functionality, which is not supported on Flutter web.

Thanks for bringing Gherkins to Flutter!

Full Stacktrace

This is the full stacktrace

``` ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════ The following UnsupportedError was thrown running a test: Unsupported operation: StdIOUtils._getStdioOutputStream

When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 622:5 _getStdioOutputStream
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/io/stdio.dart 357:36 get _stdout
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 839:8 get
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/io/stdio.dart 384:41 get stdout
packages/gherkin/src/reporters/stdout_reporter.dart.js 171:41
packages/gherkin/src/reporters/stdout_reporter.dart.js 152:23 printMessageLine
packages/gherkin/src/feature_file_runner.dart.js 1034:16
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/gherkin/src/feature_file_runner.dart.js 1030:108
packages/gherkin/src/reporters/reporter.dart.js 95:58 invoke
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/gherkin/src/reporters/reporter.dart.js 93:22 invoke
packages/gherkin/src/reporters/aggregated_reporter.dart.js 73:402
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/internal/iterable.dart 391:20 moveNext
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 748:20 next
packages/collection/src/iterable_extensions.dart.js 530:16 IterableNullableExtension.whereNotNull
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future.dart 519:16 wait
packages/gherkin/src/reporters/reporter.dart.js 211:27 invokeReporters
packages/gherkin/src/reporters/aggregated_reporter.dart.js 73:324
packages/gherkin/src/reporters/reporter.dart.js 95:58 invoke
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async
packages/gherkin/src/reporters/reporter.dart.js 93:22 invoke
packages/flutter_gherkin/src/flutter/world/flutter_widget_tester_world.dart.js 647:53
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 60:31
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1450:47 _rootRunBinary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1342:19 runBinary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 162:22 handleError
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 778:46 handleError
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 799:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 574:5 [_completeError]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future.dart 539:22
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1434:47 _rootRunUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1335:19 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 147:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 766:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 795:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 430:9
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1426:13 _rootRun
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1328:19 run
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1236:7 runGuarded
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1276:23 callback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15


</details>

Interesting, I don't think anything has changed in the file since rc.9. There is a comment in the file that a function throws on the web but it should be caught and swallowed so should not affect execution.

Are you able to provide a reproduction repo?

Thanks for your quick response. I assume this affects any Flutter web project. I will try setting up a minimal example.

That would be great

Ok, I found the culprit (it was me). With the new test configuration system I switched from defining reporters myself to the new FlutterTestConfiguration.standard() call. I suggest to add a FlutterTestConfiguration.standardWeb() call that overwrites the reporter's standard behavior, compare PR #244