Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
3360d861
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3360d861
编写于
9月 25, 2019
作者:
Y
Yegor
提交者:
GitHub
9月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[web] filter test targets; cache host.dart compilation (#12445)
* filter test targets; cache host.dart compilation
上级
efb7bf43
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
10 deletion
+41
-10
lib/web_ui/dev/environment.dart
lib/web_ui/dev/environment.dart
+1
-1
lib/web_ui/dev/test_runner.dart
lib/web_ui/dev/test_runner.dart
+39
-8
lib/web_ui/pubspec.yaml
lib/web_ui/pubspec.yaml
+1
-1
未找到文件。
lib/web_ui/dev/environment.dart
浏览文件 @
3360d861
...
...
@@ -85,7 +85,7 @@ class Environment {
));
/// Path to the "web_engine_tester" package.
io
.
Directory
get
golden
TesterRootDir
=>
io
.
Directory
(
pathlib
.
join
(
io
.
Directory
get
webEngine
TesterRootDir
=>
io
.
Directory
(
pathlib
.
join
(
webSdkRootDir
.
path
,
'web_engine_tester'
,
));
...
...
lib/web_ui/dev/test_runner.dart
浏览文件 @
3360d861
...
...
@@ -49,10 +49,10 @@ class TestsCommand extends Command<bool> {
_copyAhemFontIntoWebUi
();
await
_buildHostPage
();
await
_buildTests
();
final
List
<
FilePath
>
targets
=
this
.
targets
.
map
((
t
)
=>
FilePath
.
fromCwd
(
t
)).
toList
();
await
_buildTests
(
targets:
targets
);
if
(
targets
.
isEmpty
)
{
await
_runAllTests
();
}
else
{
...
...
@@ -143,27 +143,52 @@ class TestsCommand extends Command<bool> {
}
}
// TODO(yjbanov): skip rebuild if host.dart hasn't changed.
Future
<
void
>
_buildHostPage
()
async
{
final
String
hostDartPath
=
path
.
join
(
'lib'
,
'static'
,
'host.dart'
);
final
io
.
File
hostDartFile
=
io
.
File
(
path
.
join
(
environment
.
webEngineTesterRootDir
.
path
,
hostDartPath
,
));
final
io
.
File
timestampFile
=
io
.
File
(
path
.
join
(
environment
.
webEngineTesterRootDir
.
path
,
'
$hostDartPath
.js.timestamp'
,
));
final
String
timestamp
=
hostDartFile
.
statSync
().
modified
.
millisecondsSinceEpoch
.
toString
();
if
(
timestampFile
.
existsSync
())
{
final
String
lastBuildTimestamp
=
timestampFile
.
readAsStringSync
();
if
(
lastBuildTimestamp
==
timestamp
)
{
// The file is still fresh. No need to rebuild.
return
;
}
else
{
// Record new timestamp, but don't return. We need to rebuild.
print
(
'
${hostDartFile.path}
timestamp changed. Rebuilding.'
);
}
}
else
{
print
(
'Building
${hostDartFile.path}
.'
);
}
final
int
exitCode
=
await
runProcess
(
environment
.
dart2jsExecutable
,
<
String
>[
'lib/static/host.dart'
,
hostDartPath
,
'-o'
,
'
lib/static/host.dart
.js'
,
'
$hostDartPath
.js'
,
],
workingDirectory:
environment
.
golden
TesterRootDir
.
path
,
workingDirectory:
environment
.
webEngine
TesterRootDir
.
path
,
);
if
(
exitCode
!=
0
)
{
io
.
stderr
.
writeln
(
'Failed to compile
tests
. Compiler exited with exit code
$exitCode
'
);
'Failed to compile
${hostDartFile.path}
. Compiler exited with exit code
$exitCode
'
);
io
.
exit
(
1
);
}
// Record the timestamp to avoid rebuilding unless the file changes.
timestampFile
.
writeAsStringSync
(
timestamp
);
}
Future
<
void
>
_buildTests
()
async
{
// TODO(yjbanov): learn to build only requested tests: https://github.com/flutter/flutter/issues/37810
Future
<
void
>
_buildTests
({
List
<
FilePath
>
targets
})
async
{
final
int
exitCode
=
await
runProcess
(
environment
.
pubExecutable
,
<
String
>[
...
...
@@ -173,6 +198,12 @@ class TestsCommand extends Command<bool> {
'test'
,
'-o'
,
'build'
,
if
(
targets
!=
null
)
for
(
FilePath
path
in
targets
)
...[
'--build-filter=
${path.relativeToWebUi}
.js'
,
'--build-filter=
${path.relativeToWebUi}
.browser_test.dart.js'
,
],
],
workingDirectory:
environment
.
webUiRootDir
.
path
,
);
...
...
lib/web_ui/pubspec.yaml
浏览文件 @
3360d861
...
...
@@ -13,7 +13,7 @@ dev_dependencies:
path
:
1.6.4
test
:
1.6.5
quiver
:
2.0.5
build_runner
:
1.
6.5
build_runner
:
1.
7.0
build_test
:
0.10.8
build_web_compilers
:
2.1.5
yaml
:
2.2.0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录