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
87fe3fe0
Unverified
Commit
87fe3fe0
authored
Feb 15, 2022
by
Christopher Fujino
Committed by
GitHub
Feb 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename two unit tests that were not actually being run on CI (#98299)
parent
1ae5dd19
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
590 deletions
+50
-590
analyze.dart
dev/bots/analyze.dart
+50
-0
custom_devices_test.dart
...ols/test/commands.shard/hermetic/custom_devices_test.dart
+0
-530
doctor.dart
packages/flutter_tools/test/general.shard/doctor.dart
+0
-60
No files found.
dev/bots/analyze.dart
View file @
87fe3fe0
...
...
@@ -88,6 +88,9 @@ Future<void> run(List<String> arguments) async {
exitWithError
(<
String
>[
'The analyze.dart script must be run with --enable-asserts.'
]);
}
print
(
'
$clock
All tool test files end in _test.dart...'
);
await
verifyToolTestsEndInTestDart
(
flutterRoot
);
print
(
'
$clock
No sync*/async*'
);
await
verifyNoSyncAsyncStar
(
flutterPackages
);
await
verifyNoSyncAsyncStar
(
flutterExamples
,
minimumMatches:
200
);
...
...
@@ -197,6 +200,53 @@ Future<void> run(List<String> arguments) async {
// TESTS
/// Verify tool test files end in `_test.dart`.
///
/// The test runner will only recognize files ending in `_test.dart` as tests to
/// be run: https://github.com/dart-lang/test/tree/master/pkgs/test#running-tests
Future
<
void
>
verifyToolTestsEndInTestDart
(
String
workingDirectory
)
async
{
final
String
toolsTestPath
=
path
.
join
(
workingDirectory
,
'packages'
,
'flutter_tools'
,
'test'
,
);
final
List
<
String
>
violations
=
<
String
>[];
// detect files that contains calls to test(), testUsingContext(), and testWithoutContext()
final
RegExp
callsTestFunctionPattern
=
RegExp
(
r'(test\(.*\)|testUsingContext\(.*\)|testWithoutContext\(.*\))'
);
await
for
(
final
File
file
in
_allFiles
(
toolsTestPath
,
'dart'
,
minimumMatches:
300
))
{
final
bool
isValidTestFile
=
file
.
path
.
endsWith
(
'_test.dart'
);
if
(
isValidTestFile
)
{
continue
;
}
final
bool
isTestData
=
file
.
path
.
contains
(
r'test_data'
);
if
(
isTestData
)
{
continue
;
}
final
bool
isInTestShard
=
file
.
path
.
contains
(
r'.shard/'
);
if
(!
isInTestShard
)
{
continue
;
}
final
bool
callsTestFunction
=
file
.
readAsStringSync
().
contains
(
callsTestFunctionPattern
);
if
(!
callsTestFunction
)
{
continue
;
}
violations
.
add
(
file
.
path
);
}
if
(
violations
.
isNotEmpty
)
{
exitWithError
(<
String
>[
'
${bold}
Found flutter_tools tests that do not end in `_test.dart`; these will not be run by the test runner
$reset
'
,
...
violations
,
]);
}
}
Future
<
void
>
verifyNoSyncAsyncStar
(
String
workingDirectory
,
{
int
minimumMatches
=
2000
})
async
{
final
RegExp
syncPattern
=
RegExp
(
r'\s*?a?sync\*\s*?{'
);
final
RegExp
ignorePattern
=
RegExp
(
r'^\s*?// The following uses a?sync\* because:? '
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/custom_devices.dart
→
packages/flutter_tools/test/commands.shard/hermetic/custom_devices
_test
.dart
View file @
87fe3fe0
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/general.shard/doctor.dart
deleted
100644 → 0
View file @
1ae5dd19
// 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.
// @dart = 2.8
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/linux/linux_doctor.dart'
;
import
'package:flutter_tools/src/web/web_validator.dart'
;
import
'package:flutter_tools/src/windows/visual_studio_validator.dart'
;
import
'../src/common.dart'
;
import
'../src/fakes.dart'
;
import
'../src/testbed.dart'
;
void
main
(
)
{
Testbed
testbed
;
setUp
(()
{
testbed
=
Testbed
();
});
test
(
'doctor validators includes desktop when features are enabled'
,
()
=>
testbed
.
run
(()
{
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
contains
(
isA
<
LinuxDoctorValidator
>()));
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
contains
(
isA
<
VisualStudioValidator
>()));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
,
isWindowsEnabled:
true
,
),
}));
test
(
'doctor validators does not include desktop when features are enabled'
,
()
=>
testbed
.
run
(()
{
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
isNot
(
contains
(
isA
<
LinuxDoctorValidator
>())));
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
isNot
(
contains
(
isA
<
VisualStudioValidator
>())));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(),
}));
test
(
'doctor validators includes web when feature is enabled'
,
()
=>
testbed
.
run
(()
{
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
contains
(
isA
<
ChromiumValidator
>()));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
true
,
),
}));
test
(
'doctor validators does not include web when feature is disabled'
,
()
=>
testbed
.
run
(()
{
expect
(
DoctorValidatorsProvider
.
defaultInstance
.
validators
,
isNot
(
contains
(
isA
<
ChromiumValidator
>())));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(),
}));
}
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