Output web test artifacts to out directory. (flutter/engine#40355)
Output web test artifacts to out directory.
This commit is contained in:
@@ -37,9 +37,12 @@ class CleanCommand extends Command<bool> with ArgUtils<bool> {
|
||||
|
||||
@override
|
||||
FutureOr<bool> run() async {
|
||||
// This is the old path that tests used to be built into. Clean this path too.
|
||||
final String legacyBuildPath = path.join(environment.webUiRootDir.path, 'build');
|
||||
final List<io.FileSystemEntity> thingsToBeCleaned = <io.FileSystemEntity>[
|
||||
environment.webUiDartToolDir,
|
||||
environment.webUiBuildDir,
|
||||
io.Directory(legacyBuildPath),
|
||||
io.File(path.join(environment.webUiRootDir.path, '.dart_tool', 'package_config.json')),
|
||||
io.File(path.join(environment.webUiRootDir.path, 'pubspec.lock')),
|
||||
if (_alsoCleanNinja)
|
||||
|
||||
@@ -150,8 +150,8 @@ class Environment {
|
||||
///
|
||||
/// This is where compiled output goes.
|
||||
io.Directory get webUiBuildDir => io.Directory(pathlib.join(
|
||||
webUiRootDir.path,
|
||||
'build',
|
||||
outDir.path,
|
||||
'web_tests',
|
||||
));
|
||||
|
||||
/// Path to the ".dart_tool" directory, generated by various Dart tools.
|
||||
|
||||
@@ -79,13 +79,18 @@ class LicensesCommand extends Command<bool> {
|
||||
}
|
||||
|
||||
List<io.File> _flatListSourceFiles(io.Directory directory) {
|
||||
// This is the old path that tests used to be built into. Ignore anything
|
||||
// within this path.
|
||||
final String legacyBuildPath = path.join(environment.webUiRootDir.path, 'build');
|
||||
|
||||
return directory.listSync(recursive: true).whereType<io.File>().where((io.File f) {
|
||||
if (!f.path.endsWith('.dart') && !f.path.endsWith('.js')) {
|
||||
// Not a source file we're checking.
|
||||
return false;
|
||||
}
|
||||
if (path.isWithin(environment.webUiBuildDir.path, f.path) ||
|
||||
path.isWithin(environment.webUiDartToolDir.path, f.path)) {
|
||||
path.isWithin(environment.webUiDartToolDir.path, f.path) ||
|
||||
path.isWithin(legacyBuildPath, f.path)) {
|
||||
// Generated files.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class CompileTestsStep implements PipelineStep {
|
||||
|
||||
@override
|
||||
Future<void> run() async {
|
||||
await environment.webUiBuildDir.create();
|
||||
await environment.webUiBuildDir.create(recursive: true);
|
||||
if (isWasm) {
|
||||
await copyDart2WasmTestScript();
|
||||
await copySkwasm();
|
||||
|
||||
@@ -74,7 +74,7 @@ class BrowserPlatform extends PlatformPlugin {
|
||||
.add(_packageUrlHandler)
|
||||
.add(_canvasKitOverrideHandler)
|
||||
|
||||
// Serves files from the web_ui/build/ directory at the root (/) URL path.
|
||||
// Serves files from the out/web_tests/ directory at the root (/) URL path.
|
||||
.add(buildDirectoryHandler)
|
||||
.add(_testImageListingHandler)
|
||||
|
||||
@@ -214,7 +214,7 @@ class BrowserPlatform extends PlatformPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
/// Lists available test images under `web_ui/build/test_images`.
|
||||
/// Lists available test images under `out/web_tests/test_images`.
|
||||
Future<shelf.Response> _testImageListingHandler(shelf.Request request) async {
|
||||
const Map<String, String> supportedImageTypes = <String, String>{
|
||||
'.png': 'image/png',
|
||||
@@ -555,7 +555,7 @@ class BrowserPlatform extends PlatformPlugin {
|
||||
_checkNotClosed();
|
||||
|
||||
final Uri suiteUrl = url.resolveUri(p.toUri('${p.withoutExtension(
|
||||
p.relative(path, from: env.environment.webUiBuildDir.path))}.html'));
|
||||
p.relative(path, from: env.environment.webUiRootDir.path))}.html'));
|
||||
_checkNotClosed();
|
||||
|
||||
final BrowserManager? browserManager = await _startBrowserManager();
|
||||
@@ -951,8 +951,8 @@ class BrowserManager {
|
||||
'${p.basename(path)}.browser_test.dart.js.map';
|
||||
final String pathToTest = p.dirname(path);
|
||||
|
||||
final String mapPath = p.join(env.environment.webUiRootDir.path,
|
||||
'build', getBuildDirForRenderer(_renderer), pathToTest, sourceMapFileName);
|
||||
final String mapPath = p.join(env.environment.webUiBuildDir.path,
|
||||
getBuildDirForRenderer(_renderer), pathToTest, sourceMapFileName);
|
||||
|
||||
final Map<String, Uri> packageMap = <String, Uri>{
|
||||
for (Package p in packageConfig.packages) p.name: p.packageUriRoot
|
||||
|
||||
@@ -99,8 +99,9 @@ class Environment {
|
||||
///
|
||||
/// This is where compiled output goes.
|
||||
io.Directory get webUiBuildDir => io.Directory(pathlib.join(
|
||||
webUiRootDir.path,
|
||||
'build',
|
||||
engineSrcDir.path,
|
||||
'out',
|
||||
'web_tests',
|
||||
));
|
||||
|
||||
/// Path to the ".dart_tool" directory, generated by various Dart tools.
|
||||
|
||||
Reference in New Issue
Block a user