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
5a3e1004
Unverified
Commit
5a3e1004
authored
Apr 22, 2022
by
Christopher Fujino
Committed by
GitHub
Apr 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Add test that "Unresolve URI" warnings from DWDS are filtered from logs (#102399)
parent
a3a9a23e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
devfs_web.dart
packages/flutter_tools/lib/src/isolated/devfs_web.dart
+3
-2
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+30
-0
No files found.
packages/flutter_tools/lib/src/isolated/devfs_web.dart
View file @
5a3e1004
...
...
@@ -275,7 +275,7 @@ class WebAssetServer implements AssetReader {
}
logging
.
Logger
.
root
.
level
=
logging
.
Level
.
ALL
;
logging
.
Logger
.
root
.
onRecord
.
listen
(
_
log
);
logging
.
Logger
.
root
.
onRecord
.
listen
(
log
);
// In debug builds, spin up DWDS and the full asset server.
final
Dwds
dwds
=
await
dwdsLauncher
(
...
...
@@ -1004,7 +1004,8 @@ class ReleaseAssetServer {
}
}
void
_log
(
logging
.
LogRecord
event
)
{
@visibleForTesting
void
log
(
logging
.
LogRecord
event
)
{
final
String
error
=
event
.
error
==
null
?
''
:
'Error:
${event.error}
'
;
if
(
event
.
level
>=
logging
.
Level
.
SEVERE
)
{
globals
.
printError
(
'
${event.loggerName}
:
${event.message}$error
'
,
stackTrace:
event
.
stackTrace
);
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
5a3e1004
...
...
@@ -8,6 +8,7 @@ import 'dart:io' hide Directory, File;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/build_system/targets/web.dart'
;
...
...
@@ -16,6 +17,7 @@ import 'package:flutter_tools/src/convert.dart';
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/isolated/devfs_web.dart'
;
import
'package:flutter_tools/src/web/compile.dart'
;
import
'package:logging/logging.dart'
as
logging
;
import
'package:package_config/package_config.dart'
;
import
'package:shelf/shelf.dart'
;
import
'package:test/fake.dart'
;
...
...
@@ -39,6 +41,7 @@ void main() {
PackageConfig
packages
;
Platform
windows
;
FakeHttpServer
httpServer
;
BufferLogger
logger
;
setUpAll
(()
async
{
packages
=
PackageConfig
(<
Package
>[
...
...
@@ -50,6 +53,7 @@ void main() {
httpServer
=
FakeHttpServer
();
linux
=
FakePlatform
(
environment:
<
String
,
String
>{});
windows
=
FakePlatform
(
operatingSystem:
'windows'
,
environment:
<
String
,
String
>{});
logger
=
BufferLogger
.
test
();
testbed
=
Testbed
(
setup:
()
{
webAssetServer
=
WebAssetServer
(
httpServer
,
...
...
@@ -67,9 +71,35 @@ void main() {
webBuildDirectory:
null
,
basePath:
null
,
);
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
logger
,
});
});
test
(
'.log() filters events'
,
()
=>
testbed
.
run
(()
{
// harmless warning that should be filtered out
const
String
harmlessMessage
=
'Unresolved uri: dart:ui'
;
// serious warning
const
String
seriousMessage
=
'Something bad happened'
;
final
List
<
logging
.
LogRecord
>
events
=
<
logging
.
LogRecord
>[
logging
.
LogRecord
(
logging
.
Level
.
WARNING
,
harmlessMessage
,
'DartUri'
,
),
logging
.
LogRecord
(
logging
.
Level
.
WARNING
,
seriousMessage
,
'DartUri'
,
),
];
events
.
forEach
(
log
);
expect
(
logger
.
warningText
,
contains
(
seriousMessage
));
expect
(
logger
.
warningText
,
isNot
(
contains
(
harmlessMessage
)));
}));
test
(
'Handles against malformed manifest'
,
()
=>
testbed
.
run
(()
async
{
final
File
source
=
globals
.
fs
.
file
(
'source'
)
..
writeAsStringSync
(
'main() {}'
);
...
...
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