(vmServiceUri?: string)
| 28 | }); |
| 29 | |
| 30 | async function attachDebugger(vmServiceUri?: string): Promise<vs.DebugConfiguration & DartVsCodeLaunchArgs> { |
| 31 | const config = await getAttachConfiguration({ |
| 32 | args: [ |
| 33 | // Disable DDS when connecting, because we launch processes with `flutter run` which |
| 34 | // connects a VM Service client, which will prevent DDS from connecting. This should not |
| 35 | // be required if the app was started as a native app (as would usually be the case, outside |
| 36 | // of tests). |
| 37 | "--disable-dds", |
| 38 | // Use pid-file as a convenient way of getting the test name into the command line args |
| 39 | // for easier debugging of processes that hang around on CI (we dump the process command |
| 40 | // line at the end of the test run). |
| 41 | "--pid-file", path.join(os.tmpdir(), fileSafeCurrentTestName), |
| 42 | ], |
| 43 | deviceId: flutterTestDeviceId, |
| 44 | vmServiceUri, |
| 45 | }); |
| 46 | if (!config) |
| 47 | throw new Error(`Could not get attach configuration (got ${config})`); |
| 48 | await dc.start(); |
| 49 | // Make sure any stdErr is logged to console + log file for debugging. |
| 50 | dc.on("output", (event: DebugProtocol.OutputEvent) => { |
| 51 | if (event.body.category === "stderr") |
| 52 | logger.error(event.body.output); |
| 53 | }); |
| 54 | return config; |
| 55 | } |
| 56 | |
| 57 | it("attaches to a Flutter application, collects stdout, remains active, detaches without stopping it", async () => { |
| 58 | const process = await spawnFlutterProcess(flutterHelloWorldMainFile); |
no test coverage detected