mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 12:58:05 +00:00
Switch integration tests to use a snapshot for the analysis server.
Bug: https://github.com/dart-lang/sdk/issues/33189 Change-Id: I27ac08545c36c1cc1c7718b945f298b6286731b9 Reviewed-on: https://dart-review.googlesource.com/57300 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
This commit is contained in:
parent
cc9c8f93f5
commit
fe3bba8b03
|
@ -74,11 +74,7 @@ class AnalysisServerMemoryUsageTest
|
|||
outOfTestExpect(serverConnected.isCompleted, isFalse);
|
||||
serverConnected.complete();
|
||||
});
|
||||
return startServer(
|
||||
servicesPort: vmServicePort,
|
||||
cfe: useCFE,
|
||||
checked: false,
|
||||
).then((_) {
|
||||
return startServer(servicesPort: vmServicePort, cfe: useCFE).then((_) {
|
||||
server.listenToOutput(dispatchNotification);
|
||||
server.exitCode.then((_) {
|
||||
skipShutdown = true;
|
||||
|
|
|
@ -70,14 +70,9 @@ class AnalysisDomainGetErrorsTest
|
|||
}
|
||||
|
||||
@override
|
||||
Future startServer(
|
||||
{bool checked: true,
|
||||
int diagnosticPort,
|
||||
int servicesPort,
|
||||
bool cfe: false}) {
|
||||
Future startServer({int diagnosticPort, int servicesPort, bool cfe: false}) {
|
||||
String sdkPath = createNonStandardSdk();
|
||||
return server.start(
|
||||
checked: checked,
|
||||
diagnosticPort: diagnosticPort,
|
||||
sdkPath: sdkPath,
|
||||
servicesPort: servicesPort,
|
||||
|
|
|
@ -21,13 +21,11 @@ main() {
|
|||
@reflectiveTest
|
||||
class AnalysisHighlightsTest extends AbstractAnalysisServerIntegrationTest {
|
||||
Future startServer({
|
||||
bool checked: true,
|
||||
int diagnosticPort,
|
||||
int servicesPort,
|
||||
bool cfe: false,
|
||||
}) {
|
||||
return server.start(
|
||||
checked: checked,
|
||||
diagnosticPort: diagnosticPort,
|
||||
servicesPort: servicesPort,
|
||||
useAnalysisHighlight2: true,
|
||||
|
|
|
@ -263,13 +263,11 @@ abstract class AbstractAnalysisServerIntegrationTest
|
|||
* Start [server].
|
||||
*/
|
||||
Future startServer({
|
||||
bool checked: true,
|
||||
int diagnosticPort,
|
||||
int servicesPort,
|
||||
bool cfe: false,
|
||||
}) {
|
||||
return server.start(
|
||||
checked: checked,
|
||||
diagnosticPort: diagnosticPort,
|
||||
servicesPort: servicesPort,
|
||||
useCFE: cfe || useCFE);
|
||||
|
@ -664,7 +662,6 @@ class Server {
|
|||
* to be used.
|
||||
*/
|
||||
Future start({
|
||||
bool checked: true,
|
||||
int diagnosticPort,
|
||||
String instrumentationLogFile,
|
||||
bool profileServer: false,
|
||||
|
@ -678,9 +675,28 @@ class Server {
|
|||
}
|
||||
_time.start();
|
||||
String dartBinary = Platform.executable;
|
||||
|
||||
// The integration tests run 3x faster when run from snapshots (you need to
|
||||
// run test.py with --use-sdk).
|
||||
final bool useSnapshot = true;
|
||||
String serverPath;
|
||||
|
||||
if (useSnapshot) {
|
||||
// Look for snapshots/analysis_server.dart.snapshot.
|
||||
serverPath = normalize(join(dirname(Platform.resolvedExecutable),
|
||||
'snapshots', 'analysis_server.dart.snapshot'));
|
||||
|
||||
if (!FileSystemEntity.isFileSync(serverPath)) {
|
||||
// Look for dart-sdk/bin/snapshots/analysis_server.dart.snapshot.
|
||||
serverPath = normalize(join(dirname(Platform.resolvedExecutable),
|
||||
'dart-sdk', 'bin', 'snapshots', 'analysis_server.dart.snapshot'));
|
||||
}
|
||||
} else {
|
||||
String rootDir =
|
||||
findRoot(Platform.script.toFilePath(windows: Platform.isWindows));
|
||||
String serverPath = normalize(join(rootDir, 'bin', 'server.dart'));
|
||||
serverPath = normalize(join(rootDir, 'bin', 'server.dart'));
|
||||
}
|
||||
|
||||
List<String> arguments = [];
|
||||
//
|
||||
// Add VM arguments.
|
||||
|
@ -701,9 +717,6 @@ class Server {
|
|||
if (Platform.packageConfig != null) {
|
||||
arguments.add('--packages=${Platform.packageConfig}');
|
||||
}
|
||||
if (checked) {
|
||||
arguments.add('--checked');
|
||||
}
|
||||
//
|
||||
// Add the server executable.
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue