Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
22239f41
Unverified
Commit
22239f41
authored
May 04, 2020
by
Dan Field
Committed by
GitHub
May 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test engine version hash, but skip for Dart HHH bot (#55223)
parent
c32d1387
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
6 deletions
+48
-6
run_command.dart
dev/bots/run_command.dart
+1
-1
test.dart
dev/bots/test.dart
+46
-4
utils.dart
dev/bots/utils.dart
+1
-1
No files found.
dev/bots/run_command.dart
View file @
22239f41
...
...
@@ -80,7 +80,7 @@ Future<void> runCommand(String executable, List<String> arguments, {
);
final
String
commandDescription
=
'
${path.relative(executable, from: workingDirectory)}
${arguments.join(' ')}
'
;
final
String
relativeWorkingDir
=
path
.
relative
(
workingDirectory
);
final
String
relativeWorkingDir
=
path
.
relative
(
workingDirectory
??
Directory
.
current
.
path
);
if
(
skip
)
{
printProgress
(
'SKIPPING'
,
relativeWorkingDir
,
commandDescription
);
return
;
...
...
dev/bots/test.dart
View file @
22239f41
...
...
@@ -28,12 +28,26 @@ typedef ShardRunner = Future<void> Function();
/// appropriate error message.
typedef
OutputChecker
=
String
Function
(
CapturedOutput
);
final
String
exe
=
Platform
.
isWindows
?
'.exe'
:
''
;
final
String
bat
=
Platform
.
isWindows
?
'.bat'
:
''
;
final
String
flutterRoot
=
path
.
dirname
(
path
.
dirname
(
path
.
dirname
(
path
.
fromUri
(
Platform
.
script
))));
final
String
flutter
=
path
.
join
(
flutterRoot
,
'bin'
,
Platform
.
isWindows
?
'flutter.bat'
:
'flutter
'
);
final
String
dart
=
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
Platform
.
isWindows
?
'dart.exe'
:
'dart
'
);
final
String
pub
=
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
Platform
.
isWindows
?
'pub.bat'
:
'pub
'
);
final
String
flutter
=
path
.
join
(
flutterRoot
,
'bin'
,
'flutter
$bat
'
);
final
String
dart
=
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'dart
$exe
'
);
final
String
pub
=
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'pub
$bat
'
);
final
String
pubCache
=
path
.
join
(
flutterRoot
,
'.pub-cache'
);
final
String
toolRoot
=
path
.
join
(
flutterRoot
,
'packages'
,
'flutter_tools'
);
final
String
engineVersionFile
=
path
.
join
(
flutterRoot
,
'bin'
,
'internal'
,
'engine.version'
);
String
get
platformFolderName
{
if
(
Platform
.
isWindows
)
return
'windows-x64'
;
if
(
Platform
.
isMacOS
)
return
'darwin-x64'
;
if
(
Platform
.
isLinux
)
return
'linux-x64'
;
throw
UnsupportedError
(
'The platform
${Platform.operatingSystem}
is not supported by this script.'
);
}
final
String
flutterTester
=
path
.
join
(
flutterRoot
,
'bin'
,
'cache'
,
'artifacts'
,
'engine'
,
platformFolderName
,
'flutter_tester
$exe
'
);
/// The arguments to pass to `flutter test` (typically the local engine
/// configuration) -- prefilled with the arguments passed to test.dart.
...
...
@@ -118,8 +132,37 @@ Future<void> main(List<String> args) async {
print
(
'
$clock
${bold}
Test successful.
$reset
'
);
}
/// Verify the Flutter Engine is the revision in
/// bin/cache/internal/engine.version.
Future
<
void
>
_validateEngineHash
()
async
{
final
String
luciBotId
=
Platform
.
environment
[
'SWARMING_BOT_ID'
]
??
''
;
if
(
luciBotId
.
startsWith
(
'luci-dart-'
))
{
// The Dart HHH bots intentionally modify the local artifact cache
// and then use this script to run Flutter's test suites.
// Because the artifacts have been changed, this particular test will return
// a false positive and should be skipped.
print
(
'
${yellow}
Skipping Flutter Engine Version Validation for swarming '
'bot
$luciBotId
.'
);
return
;
}
final
String
expectedVersion
=
File
(
engineVersionFile
).
readAsStringSync
().
trim
();
final
CapturedOutput
flutterTesterOutput
=
CapturedOutput
();
await
runCommand
(
flutterTester
,
<
String
>[
'--help'
],
output:
flutterTesterOutput
,
outputMode:
OutputMode
.
capture
);
final
String
actualVersion
=
flutterTesterOutput
.
stderr
.
split
(
'
\n
'
).
firstWhere
((
final
String
line
)
{
return
line
.
startsWith
(
'Flutter Engine Version:'
);
});
if
(!
actualVersion
.
contains
(
expectedVersion
))
{
print
(
'
${red}
Expected "Flutter Engine Version:
$expectedVersion
", '
'but found "
$actualVersion
".'
);
exit
(
1
);
}
}
Future
<
void
>
_runSmokeTests
()
async
{
print
(
'
${green}
Running smoketests...
$reset
'
);
await
_validateEngineHash
();
// Verify that the tests actually return failure on failure and success on
// success.
final
String
automatedTests
=
path
.
join
(
flutterRoot
,
'dev'
,
'automated_tests'
);
...
...
@@ -1249,7 +1292,6 @@ int get prNumber {
}
Future
<
String
>
_getAuthors
()
async
{
final
String
exe
=
Platform
.
isWindows
?
'.exe'
:
''
;
final
String
author
=
await
runAndGetStdout
(
'git
$exe
'
,
<
String
>[
'-c'
,
'log.showSignature=false'
,
'log'
,
gitHash
,
'--pretty="%an <%ae>"'
],
workingDirectory:
flutterRoot
,
...
...
dev/bots/utils.dart
View file @
22239f41
...
...
@@ -12,7 +12,7 @@ final bool hasColor = stdout.supportsAnsiEscapes;
final
String
bold
=
hasColor
?
'
\
x1B[1m'
:
''
;
// used for shard titles
final
String
red
=
hasColor
?
'
\
x1B[31m'
:
''
;
// used for errors
final
String
green
=
hasColor
?
'
\
x1B[32m'
:
''
;
// used for section titles, commands
final
String
yellow
=
hasColor
?
'
\
x1B[33m'
:
''
;
// u
nused
final
String
yellow
=
hasColor
?
'
\
x1B[33m'
:
''
;
// u
sed for skips
final
String
cyan
=
hasColor
?
'
\
x1B[36m'
:
''
;
// used for paths
final
String
reverse
=
hasColor
?
'
\
x1B[7m'
:
''
;
// used for clocks
final
String
reset
=
hasColor
?
'
\
x1B[0m'
:
''
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment