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
1ff5665f
Unverified
Commit
1ff5665f
authored
May 12, 2021
by
Jenn Magder
Committed by
GitHub
May 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force LANG=en_US.UTF-8 in test runner (#82308)
parent
7d46d436
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
bot_test.dart
dev/bots/test/bot_test.dart
+0
-13
utils.dart
dev/devicelab/lib/framework/utils.dart
+2
-2
build_test_task_test.dart
dev/devicelab/test/tasks/build_test_task_test.dart
+26
-0
No files found.
dev/bots/test/bot_test.dart
deleted
100644 → 0
View file @
7d46d436
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
;
import
'common.dart'
;
void
main
(
)
{
test
(
'BOT variable is set on bots'
,
()
{
expect
(
Platform
.
environment
[
'BOT'
],
'true'
);
},
skip:
true
);
}
dev/devicelab/lib/framework/utils.dart
View file @
1ff5665f
...
@@ -279,10 +279,10 @@ Future<Process> startProcess(
...
@@ -279,10 +279,10 @@ Future<Process> startProcess(
assert
(
isBot
!=
null
);
assert
(
isBot
!=
null
);
final
String
command
=
'
$executable
${arguments?.join(" ") ?? ""}
'
;
final
String
command
=
'
$executable
${arguments?.join(" ") ?? ""}
'
;
final
String
finalWorkingDirectory
=
workingDirectory
??
cwd
;
final
String
finalWorkingDirectory
=
workingDirectory
??
cwd
;
print
(
'
\n
Executing:
$command
in
$finalWorkingDirectory
'
+
(
environment
!=
null
?
' with environment
$environment
'
:
''
));
final
Map
<
String
,
String
>
newEnvironment
=
Map
<
String
,
String
>.
from
(
environment
??
<
String
,
String
>{});
final
Map
<
String
,
String
>
newEnvironment
=
Map
<
String
,
String
>.
from
(
environment
??
<
String
,
String
>{});
newEnvironment
[
'BOT'
]
=
isBot
?
'true'
:
'false'
;
newEnvironment
[
'BOT'
]
=
isBot
?
'true'
:
'false'
;
newEnvironment
[
'LANG'
]
=
'en_US.UTF-8'
;
print
(
'
\n
Executing:
$command
in
$finalWorkingDirectory
with environment
$newEnvironment
'
);
final
Process
process
=
await
_processManager
.
start
(
final
Process
process
=
await
_processManager
.
start
(
<
String
>[
executable
,
...
arguments
],
<
String
>[
executable
,
...
arguments
],
environment:
newEnvironment
,
environment:
newEnvironment
,
...
...
dev/devicelab/test/tasks/build_test_task_test.dart
View file @
1ff5665f
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter_devicelab/framework/runner.dart'
;
import
'package:flutter_devicelab/framework/runner.dart'
;
import
'package:flutter_devicelab/framework/task_result.dart'
;
import
'package:flutter_devicelab/framework/task_result.dart'
;
...
@@ -43,6 +45,30 @@ void main() {
...
@@ -43,6 +45,30 @@ void main() {
expect
(
result
.
data
[
'benchmark'
],
'data'
);
expect
(
result
.
data
[
'benchmark'
],
'data'
);
});
});
test
(
'sets environment'
,
()
async
{
final
StringBuffer
capturedPrintLines
=
StringBuffer
();
await
runZoned
<
Future
<
void
>>(
()
async
{
await
runTask
(
'smoke_test_build_test'
,
taskArgs:
<
String
>[
'--test'
],
deviceId:
'FAKE_SUCCESS'
,
isolateParams:
isolateParams
,
);
},
zoneSpecification:
ZoneSpecification
(
// Intercept printing from the task.
print:
(
Zone
self
,
ZoneDelegate
parent
,
Zone
zone
,
String
line
)
async
{
capturedPrintLines
.
writeln
(
line
);
},
),
);
final
String
capturedPrint
=
capturedPrintLines
.
toString
();
expect
(
capturedPrint
,
contains
(
'with environment {FLUTTER_DEVICELAB_DEVICEID: FAKE_SUCCESS, BOT: true, LANG: en_US.UTF-8}'
));
expect
(
capturedPrint
,
contains
(
'exit code: 0'
));
});
test
(
'throws exception when build and test arg are given'
,
()
async
{
test
(
'throws exception when build and test arg are given'
,
()
async
{
final
TaskResult
result
=
await
runTask
(
final
TaskResult
result
=
await
runTask
(
'smoke_test_build_test'
,
'smoke_test_build_test'
,
...
...
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