Commit 089ce483 authored by Devon Carew's avatar Devon Carew

Merge pull request #2427 from devoncarew/fix_mac_test

fix a mac test
parents e2a6b488 c1caa269
...@@ -128,7 +128,10 @@ All done! In order to run your application, type: ...@@ -128,7 +128,10 @@ All done! In order to run your application, type:
void _renderTemplates(String projectName, String dirPath, void _renderTemplates(String projectName, String dirPath,
String flutterPackagesDirectory, { bool renderDriverTest: false }) { String flutterPackagesDirectory, { bool renderDriverTest: false }) {
String relativeFlutterPackagesDirectory = path.relative(flutterPackagesDirectory, from: dirPath); String relativePackagesDirectory = path.relative(
flutterPackagesDirectory,
from: path.join(dirPath, 'pubspec.yaml')
);
printStatus('Creating project ${path.basename(projectName)}:'); printStatus('Creating project ${path.basename(projectName)}:');
...@@ -139,7 +142,7 @@ All done! In order to run your application, type: ...@@ -139,7 +142,7 @@ All done! In order to run your application, type:
'androidIdentifier': _createAndroidIdentifier(projectName), 'androidIdentifier': _createAndroidIdentifier(projectName),
'iosIdentifier': _createUTIIdentifier(projectName), 'iosIdentifier': _createUTIIdentifier(projectName),
'description': description, 'description': description,
'flutterPackagesDirectory': relativeFlutterPackagesDirectory, 'flutterPackagesDirectory': relativePackagesDirectory,
'androidMinApiLevel': android.minApiLevel 'androidMinApiLevel': android.minApiLevel
}; };
......
...@@ -27,34 +27,28 @@ defineTests() { ...@@ -27,34 +27,28 @@ defineTests() {
temp.deleteSync(recursive: true); temp.deleteSync(recursive: true);
}); });
// This test consistently times out on our windows bot. The code is already // Verify that we create a project that is well-formed.
// covered on the linux one. testUsingContext('flutter-simple', () async {
// Also fails on mac, with create --out returning '69' ArtifactStore.flutterRoot = '../..';
// TODO(devoncarew): https://github.com/flutter/flutter/issues/1709 CreateCommand command = new CreateCommand();
if (Platform.isLinux) { CommandRunner runner = new CommandRunner('test_flutter', '')
// Verify that we create a project that is well-formed. ..addCommand(command);
testUsingContext('flutter-simple', () async { await runner.run(['create', '--out', temp.path])
ArtifactStore.flutterRoot = '../..'; .then((int code) => expect(code, equals(0)));
CreateCommand command = new CreateCommand();
CommandRunner runner = new CommandRunner('test_flutter', '') String mainPath = path.join(temp.path, 'lib', 'main.dart');
..addCommand(command); expect(new File(mainPath).existsSync(), true);
await runner.run(['create', '--out', temp.path]) ProcessResult exec = Process.runSync(
.then((int code) => expect(code, equals(0))); sdkBinaryName('dartanalyzer'), ['--fatal-warnings', mainPath],
workingDirectory: temp.path
String mainPath = path.join(temp.path, 'lib', 'main.dart'); );
expect(new File(mainPath).existsSync(), true); if (exec.exitCode != 0) {
ProcessResult exec = Process.runSync( print(exec.stdout);
sdkBinaryName('dartanalyzer'), ['--fatal-warnings', mainPath], print(exec.stderr);
workingDirectory: temp.path }
); expect(exec.exitCode, 0);
if (exec.exitCode != 0) { },
print(exec.stdout); // This test can take a while due to network requests.
print(exec.stderr); timeout: new Timeout(new Duration(minutes: 2)));
}
expect(exec.exitCode, 0);
},
// This test can take a while due to network requests.
timeout: new Timeout(new Duration(minutes: 2)));
}
}); });
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment