Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* `test()` and `group()` functions now take an optional `TestLocation` that will
be used as the location of the test in JSON reporters instead of being parsed
from the call stack.
* Set a debug name for test isolates.

## 0.6.8

Expand Down
20 changes: 16 additions & 4 deletions pkgs/test_core/lib/src/runner/vm/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,14 @@ stderr: ${processResult.stderr}''');

/// Runs [uri] in an isolate, passing [message].
Future<Isolate> _spawnIsolateWithUri(Uri uri, SendPort message) async {
return await Isolate.spawnUri(uri, [], message,
packageConfig: await packageConfigUri, checked: true);
return await Isolate.spawnUri(
uri,
[],
message,
packageConfig: await packageConfigUri,
checked: true,
debugName: 'test_main',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these surfaced?

Is there any reason to not put more detail in here? WDYT About

Suggested change
debugName: 'test_main',
debugName: 'test_suite:$uri',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're surfaced in the VM service API. They're designed to be human readable names and are handy for debugging. So yeah, it definitely makes sense to include the test URI.

);
}

Future<Isolate> _spawnPrecompiledIsolate(String testPath, SendPort message,
Expand Down Expand Up @@ -284,8 +290,14 @@ stderr: ${processResult.stderr}''');
packageConfig = null;
}
}
return await Isolate.spawnUri(testUri, [], message,
packageConfig: packageConfig?.uri, checked: true);
return await Isolate.spawnUri(
testUri,
[],
message,
packageConfig: packageConfig?.uri,
checked: true,
debugName: 'test_main',
);
}

/// Bootstraps the test at [testPath] and writes its contents to a temporary
Expand Down