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
2ceb371d
Unverified
Commit
2ceb371d
authored
Nov 25, 2020
by
Amir Hardon
Committed by
GitHub
Nov 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pin the version of flutter/plugins to test against (#71166)
parent
99bc4de7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
2 deletions
+65
-2
README.md
bin/internal/README.md
+7
-2
flutter_plugins.version
bin/internal/flutter_plugins.version
+1
-0
test.dart
dev/bots/test.dart
+33
-0
test_test.dart
dev/bots/test/test_test.dart
+24
-0
No files found.
bin/internal/README.md
View file @
2ceb371d
Dart SDK dependency
===================
## Flutter SDK dependency versions
The files in this directory specifies pinned versions of various dependencies of the flutter SDK.
The
`bin/internal/engine.version`
file controls which version of the Flutter engine to use.
The file contains the commit hash of a commit in the
<https://github.com/flutter/engine>
repository.
...
...
@@ -11,3 +12,7 @@ commit for a pull request no matter how many engine commits there are inside
that pull request. If it's
`rebase`
, the number of commits in the framework is
equal to the number of engine commits in the pull request. The latter method
makes it easier to detect regressions but costs more test resources.
Ths
`bin/internal/flutter_plugins.version`
file specifies the version of the
`flutter/plugins`
repository to be used for testing.
Note that
`flutter/plugins`
isn't an upstream dependency of
`flutter/flutter`
it is only used as part of the test suite for verification,
the pinned version here makes sure that tests are deterministic at each
`flutter/flutter`
commit.
bin/internal/flutter_plugins.version
0 → 100644
View file @
2ceb371d
592b5b27431689336fa4c721a099eedf787aeb56
dev/bots/test.dart
View file @
2ceb371d
...
...
@@ -7,6 +7,8 @@ import 'dart:convert';
import
'dart:io'
;
import
'dart:math'
as
math
;
import
'package:file/file.dart'
as
fs
;
import
'package:file/local.dart'
;
import
'package:googleapis/bigquery/v2.dart'
as
bq
;
import
'package:googleapis_auth/auth_io.dart'
as
auth
;
import
'package:http/http.dart'
as
http
;
...
...
@@ -37,6 +39,7 @@ final String pub = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', 'pu
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'
);
final
String
flutterPluginsVersionFile
=
path
.
join
(
flutterRoot
,
'bin'
,
'internal'
,
'flutter_plugins.version'
);
String
get
platformFolderName
{
if
(
Platform
.
isWindows
)
...
...
@@ -861,6 +864,25 @@ Future<void> _runWebLongRunningTests() async {
await
_stopChromeDriver
();
}
/// Returns the commit hash of the flutter/plugins repository that's rolled in.
///
/// The flutter/plugins repository is a downstream dependency, it is only used
/// by flutter/flutter for testing purposes, to assure stable tests for a given
/// flutter commit the flutter/plugins commit hash to test against is coded in
/// the bin/internal/flutter_plugins.version file.
///
/// The `filesystem` parameter specified filesystem to read the plugins version file from.
/// The `pluginsVersionFile` parameter allows specifying an alternative path for the
/// plugins version file, when null [flutterPluginsVersionFile] is used.
Future
<
String
>
getFlutterPluginsVersion
({
fs
.
FileSystem
fileSystem
=
const
LocalFileSystem
(),
String
pluginsVersionFile
,
})
async
{
final
File
versionFile
=
fileSystem
.
file
(
pluginsVersionFile
??
flutterPluginsVersionFile
);
final
String
versionFileContents
=
await
versionFile
.
readAsString
();
return
versionFileContents
.
trim
();
}
/// Executes the test suite for the flutter/plugins repo.
Future
<
void
>
_runFlutterPluginsTests
()
async
{
Future
<
void
>
runAnalyze
()
async
{
...
...
@@ -877,6 +899,17 @@ Future<void> _runFlutterPluginsTests() async {
],
workingDirectory:
checkout
.
path
,
);
final
String
pluginsCommit
=
await
getFlutterPluginsVersion
();
await
runCommand
(
'git'
,
<
String
>[
'-c'
,
'core.longPaths=true'
,
'checkout'
,
pluginsCommit
,
],
workingDirectory:
checkout
.
path
,
);
await
runCommand
(
pub
,
<
String
>[
...
...
dev/bots/test/test_test.dart
View file @
2ceb371d
...
...
@@ -4,7 +4,10 @@
import
'dart:io'
hide
Platform
;
import
'package:file/file.dart'
as
fs
;
import
'package:file/memory.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:path/path.dart'
as
path
;
import
'../test.dart'
;
import
'common.dart'
;
...
...
@@ -56,4 +59,25 @@ void main() {
}
});
});
group
(
'flutter/plugins version'
,
()
{
final
MemoryFileSystem
memoryFileSystem
=
MemoryFileSystem
();
final
fs
.
File
pluginsVersionFile
=
memoryFileSystem
.
file
(
path
.
join
(
'bin'
,
'internal'
,
'flutter_plugins.version'
));
const
String
kSampleHash
=
'592b5b27431689336fa4c721a099eedf787aeb56'
;
setUpAll
(()
{
pluginsVersionFile
.
createSync
(
recursive:
true
);
});
test
(
'commit hash'
,
()
async
{
pluginsVersionFile
.
writeAsStringSync
(
kSampleHash
);
final
String
actualHash
=
await
getFlutterPluginsVersion
(
fileSystem:
memoryFileSystem
,
pluginsVersionFile:
pluginsVersionFile
.
path
);
expect
(
actualHash
,
kSampleHash
);
});
test
(
'commit hash with newlines'
,
()
async
{
pluginsVersionFile
.
writeAsStringSync
(
'
\n
$kSampleHash
\n
'
);
final
String
actualHash
=
await
getFlutterPluginsVersion
(
fileSystem:
memoryFileSystem
,
pluginsVersionFile:
pluginsVersionFile
.
path
);
expect
(
actualHash
,
kSampleHash
);
});
});
}
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