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
f4f33fd1
Unverified
Commit
f4f33fd1
authored
Feb 01, 2021
by
Jenn Magder
Committed by
GitHub
Feb 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dump logs on failing devicelab test to recipe artifact location (#74378)
parent
12016e41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
0 deletions
+100
-0
module_test_ios.dart
dev/devicelab/bin/tasks/module_test_ios.dart
+5
-0
host_agent.dart
dev/devicelab/lib/framework/host_agent.dart
+44
-0
host_agent_test.dart
dev/devicelab/test/host_agent_test.dart
+51
-0
No files found.
dev/devicelab/bin/tasks/module_test_ios.dart
View file @
f4f33fd1
...
...
@@ -5,6 +5,7 @@
import
'dart:io'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/host_agent.dart'
;
import
'package:flutter_devicelab/framework/ios.dart'
;
import
'package:flutter_devicelab/framework/task_result.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
...
...
@@ -292,6 +293,8 @@ Future<void> main() async {
section
(
'Run platform unit tests'
);
await
testWithNewIOSSimulator
(
'TestAdd2AppSim'
,
(
String
deviceId
)
{
simulatorDeviceId
=
deviceId
;
final
String
resultBundlePath
=
path
.
join
(
hostAgent
.
dumpDirectory
.
path
,
'module_test_ios-objc-
${DateTime.now().toLocal().toIso8601String()}
'
);
return
inDirectory
(
objectiveCHostApp
,
()
=>
exec
(
'xcodebuild'
,
...
...
@@ -304,6 +307,8 @@ Future<void> main() async {
'Debug'
,
'-destination'
,
'id=
$deviceId
'
,
'-resultBundlePath'
,
resultBundlePath
,
'test'
,
'CODE_SIGNING_ALLOWED=NO'
,
'CODE_SIGNING_REQUIRED=NO'
,
...
...
dev/devicelab/lib/framework/host_agent.dart
0 → 100644
View file @
f4f33fd1
// 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
'package:file/file.dart'
;
import
'package:file/local.dart'
;
import
'package:meta/meta.dart'
;
import
'package:platform/platform.dart'
;
/// The current host machine running the tests.
HostAgent
get
hostAgent
=>
HostAgent
(
platform:
const
LocalPlatform
(),
fileSystem:
const
LocalFileSystem
());
/// Host machine running the tests.
class
HostAgent
{
HostAgent
({
@required
Platform
platform
,
@required
FileSystem
fileSystem
})
:
_platform
=
platform
,
_fileSystem
=
fileSystem
;
final
Platform
_platform
;
final
FileSystem
_fileSystem
;
/// Creates a directory to dump file artifacts.
Directory
get
dumpDirectory
{
if
(
_dumpDirectory
==
null
)
{
// Set in LUCI recipe.
final
String
directoryPath
=
_platform
.
environment
[
'FLUTTER_LOGS_DIR'
];
if
(
directoryPath
==
null
)
{
_dumpDirectory
=
_fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_test_logs.'
);
print
(
'Created tmp dump directory
${_dumpDirectory.path}
'
);
}
else
{
_dumpDirectory
=
_fileSystem
.
directory
(
directoryPath
)..
createSync
(
recursive:
true
);
print
(
'Found FLUTTER_LOGS_DIR dump directory
${_dumpDirectory.path}
'
);
}
}
return
_dumpDirectory
;
}
static
Directory
_dumpDirectory
;
@visibleForTesting
void
resetDumpDirectory
()
{
_dumpDirectory
=
null
;
}
}
dev/devicelab/test/host_agent_test.dart
0 → 100644
View file @
f4f33fd1
// 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
'package:file/file.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_devicelab/framework/host_agent.dart'
;
import
'package:platform/platform.dart'
;
import
'common.dart'
;
void
main
(
)
{
FileSystem
fs
;
setUp
(()
{
fs
=
MemoryFileSystem
();
hostAgent
.
resetDumpDirectory
();
});
tearDown
(()
{
hostAgent
.
resetDumpDirectory
();
});
group
(
'dump directory'
,
()
{
test
(
'set by environment'
,
()
async
{
final
Directory
environmentDir
=
fs
.
directory
(
fs
.
path
.
join
(
'home'
,
'logs'
));
final
FakePlatform
fakePlatform
=
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_LOGS_DIR'
:
environmentDir
.
path
},
operatingSystem:
'windows'
,
);
final
HostAgent
agent
=
HostAgent
(
platform:
fakePlatform
,
fileSystem:
fs
);
expect
(
agent
.
dumpDirectory
.
existsSync
(),
isTrue
);
expect
(
agent
.
dumpDirectory
.
path
,
environmentDir
.
path
);
});
test
(
'not set by environment'
,
()
async
{
final
FakePlatform
fakePlatform
=
FakePlatform
(
environment:
<
String
,
String
>{},
operatingSystem:
'windows'
);
final
HostAgent
agent
=
HostAgent
(
platform:
fakePlatform
,
fileSystem:
fs
);
expect
(
agent
.
dumpDirectory
.
existsSync
(),
isTrue
);
});
test
(
'is the same between host agent instances'
,
()
async
{
final
FakePlatform
fakePlatform
=
FakePlatform
(
environment:
<
String
,
String
>{},
operatingSystem:
'windows'
);
final
HostAgent
agent1
=
HostAgent
(
platform:
fakePlatform
,
fileSystem:
fs
);
final
HostAgent
agent2
=
HostAgent
(
platform:
fakePlatform
,
fileSystem:
fs
);
expect
(
agent1
.
dumpDirectory
.
path
,
agent2
.
dumpDirectory
.
path
);
});
});
}
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