Skip to content
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

Error running spec on Windows #14

Open
chimon2000 opened this issue Feb 3, 2022 · 6 comments
Open

Error running spec on Windows #14

chimon2000 opened this issue Feb 3, 2022 · 6 comments
Labels
bug Something isn't working hacktoberfest

Comments

@chimon2000
Copy link

Unhandled exception:
ProcessException: The system cannot find the file specified.

  Command: flutter test --reporter=json --no-pub
#0      _ProcessImpl._start (dart:io-patch/process_patch.dart:401:33)
#1      Process.start (dart:io-patch/process_patch.dart:38:20)
#2      flutterTest.<anonymous closure> (package:dart_test_adapter/src/test_runner.dart:16:19)
#3      _parseTestJsonOutput.<anonymous closure> (package:dart_test_adapter/src/test_runner.dart:64:30)
#4      _parseTestJsonOutput.<anonymous closure> (package:dart_test_adapter/src/test_runner.dart:63:25)
#5      _runGuarded (dart:async/stream_controller.dart:773:24)
#6      _StreamController._subscribe.<anonymous closure> (dart:async/stream_controller.dart:651:7)
#7      _BufferingStreamSubscription._guardCallback (dart:async/stream_impl.dart:417:13)
#8      _StreamController._subscribe (dart:async/stream_controller.dart:650:18)
#9      _ControllerStream._createSubscription (dart:async/stream_controller.dart:786:19)
#10     _StreamImpl.listen (dart:async/stream_impl.dart:473:9)
#11     new TestEventsNotifier.<anonymous closure> (package:spec_cli/src/dart_test.dart:92:25)
<asynchronous suspension>

Steps to reproduce:

  • Install spec using dart pub global activate spec_cli
  • Create a fresh Flutter project
  • Run spec in project

Currently using Flutter 2.10 but I was using the last stable version and getting the same error.

@Salakar Salakar added the bug Something isn't working label Feb 3, 2022
@rrousselGit
Copy link
Contributor

rrousselGit commented Feb 3, 2022

Are the commands flutter and dart available in your terminal? This error make it seems like one of those commands is missing

@chimon2000
Copy link
Author

@rrousselGit I can confirm that both are available:

dart --version && flutter --version
Dart SDK version: 2.16.0 (stable) (Mon Jan 31 15:28:59 2022 +0100) on "windows_x64"
Flutter 2.10.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5f105a6ca7 (3 days ago) • 2022-02-01 14:15:42 -0800
Engine • revision 776efd2034
Tools • Dart 2.16.0 • DevTools 2.9.2

@Salakar
Copy link
Member

Salakar commented Feb 8, 2022

I have a feeling from when I did Melos that runInShell and includeParentEnvironment may need to be set to true on Process.start for Windows to work properly and pickup flutter/dart from path

@rrousselGit
Copy link
Contributor

Wouldn't that slow things quite a bit? Since we'd effectively encapsulate the process in a shell for no reason

@mrverdant13
Copy link

I can confirm that using runInShell: true fixes the issue for Windows.
includeParentEnvironment is true by default.

Besides that, we might also use cmd /c flutter test ..., but it would technically have the same behaviour, and it would be a cumbersome implementation just for the Windows platform.

Another approach is to explicitly use flutter.bat (just for Windows ofc), which would avoid spawning the execution through an OS shell. It worked for me, but I am not entirely sure if it will be enough to overcome this issue.

@kimathi-phil
Copy link

Still having this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants