This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Enable Firebase Test Lab testing of package_info package #2025
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3cd3bb0
Enable Android testing of package_info package
collinjackson 0cc6c9d
Put Firebase Test Lab stuff back on CI
collinjackson 5144071
Fix version dependency
collinjackson 51517ac
Support for running instrumentation adapter tests with Flutter driver
collinjackson 34d06fd
Support for running tests with Flutter driver
collinjackson cc1c6d8
Fix analyzer issues
collinjackson 04adbcd
Reformat
collinjackson 3d94829
Merge branch 'flutter_driver_support' into package_info_enable
collinjackson 6d165da
Update to point to latest instrumentation_adapter
collinjackson 4701e3c
Move test location
collinjackson 8aeae1e
Merge remote-tracking branch 'origin/master' into package_info_enable
collinjackson 2d70a4b
Combine commands
collinjackson 538a21d
Merge remote-tracking branch 'origin/master' into package_info_enable
collinjackson 29bb051
Require 0.1.3 version of instrumentation_adapter to ensure that iOS t…
collinjackson c7c648b
Redo Dockerfile
collinjackson c24fbe0
Add test_driver stub pointing to the test
collinjackson 000221d
Bump for release
collinjackson f0115f0
Merge remote-tracking branch 'origin/master' into package_info_enable
collinjackson 577a4e0
Merge remote-tracking branch 'origin/master' into package_info_enable
collinjackson 7e717ad
Merge remote-tracking branch 'origin/master' into package_info_enable
collinjackson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...roid/app/src/androidTest/java/io/flutter/plugins/packageinfoexample/MainActivityTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Copyright 2019 The Chromium Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| package io.flutter.plugins.packageinfoexample; | ||
|
|
||
| import androidx.test.rule.ActivityTestRule; | ||
| import dev.flutter.plugins.instrumentationadapter.FlutterRunner; | ||
| import org.junit.Rule; | ||
| import org.junit.runner.RunWith; | ||
|
|
||
| @RunWith(FlutterRunner.class) | ||
| public class MainActivityTest { | ||
| @Rule public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class); | ||
| } |
31 changes: 31 additions & 0 deletions
31
packages/package_info/example/instrumentation_adapter/package_info.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Copyright 2019 The Chromium 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 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:instrumentation_adapter/instrumentation_adapter.dart'; | ||
| import 'package:package_info/package_info.dart'; | ||
|
|
||
| void main() { | ||
| InstrumentationAdapterFlutterBinding.ensureInitialized(); | ||
| group('package_info test', () { | ||
| testWidgets('test package info result', (_) async { | ||
| final PackageInfo info = await PackageInfo.fromPlatform(); | ||
| // These tests are based on the example app. The tests should be updated if any related info changes. | ||
| if (Platform.isAndroid) { | ||
| expect(info.appName, 'package_info_example'); | ||
| expect(info.buildNumber, '1'); | ||
| expect(info.packageName, 'io.flutter.plugins.packageinfoexample'); | ||
| expect(info.version, '1.0'); | ||
| } else if (Platform.isIOS) { | ||
| expect(info.appName, 'Package Info Example'); | ||
| expect(info.buildNumber, '1'); | ||
| expect(info.packageName, 'io.flutter.plugins.packageInfoExample'); | ||
| expect(info.version, '1.0'); | ||
| } else { | ||
| throw (UnsupportedError('platform not supported')); | ||
| } | ||
| }); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 2 additions & 28 deletions
30
packages/package_info/example/test_driver/package_info.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,5 @@ | ||
| import 'dart:async'; | ||
| import 'dart:io'; | ||
| import 'package:flutter_driver/driver_extension.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:package_info/package_info.dart'; | ||
| import '../instrumentation_adapter/package_info.dart' as test; | ||
|
|
||
| void main() { | ||
| final Completer<String> completer = Completer<String>(); | ||
| enableFlutterDriverExtension(handler: (_) => completer.future); | ||
| tearDownAll(() => completer.complete(null)); | ||
|
|
||
| group('package_info test driver', () { | ||
| test('test package info result', () async { | ||
| final PackageInfo info = await PackageInfo.fromPlatform(); | ||
| // These tests are based on the example app. The tests should be updated if any related info changes. | ||
| if (Platform.isAndroid) { | ||
| expect(info.appName, 'package_info_example'); | ||
| expect(info.buildNumber, '1'); | ||
| expect(info.packageName, 'io.flutter.plugins.packageinfoexample'); | ||
| expect(info.version, '1.0'); | ||
| } else if (Platform.isIOS) { | ||
| expect(info.appName, 'Package Info Example'); | ||
| expect(info.buildNumber, '1'); | ||
| expect(info.packageName, 'io.flutter.plugins.packageInfoExample'); | ||
| expect(info.version, '1.0'); | ||
| } else { | ||
| throw (UnsupportedError('platform not supported')); | ||
| } | ||
| }); | ||
| }); | ||
| test.main(); | ||
| } |
13 changes: 6 additions & 7 deletions
13
packages/package_info/example/test_driver/package_info_test.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| import 'dart:async'; | ||
|
|
||
| import 'package:flutter_driver/flutter_driver.dart'; | ||
| import 'package:test/test.dart'; | ||
|
|
||
| void main() { | ||
| test('package_info', () async { | ||
| final FlutterDriver driver = await FlutterDriver.connect(); | ||
| await driver.requestData(null, timeout: const Duration(minutes: 1)); | ||
| driver.close(); | ||
| }); | ||
| Future<void> main() async { | ||
| final FlutterDriver driver = await FlutterDriver.connect(); | ||
| await driver.requestData(null, timeout: const Duration(minutes: 1)); | ||
| driver.close(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ description: Flutter plugin for querying information about the application | |
| package, such as CFBundleVersion on iOS or versionCode on Android. | ||
| author: Flutter Team <[email protected]> | ||
| homepage: https://github.com/flutter/plugins/tree/master/packages/package_info | ||
| version: 0.4.0+7 | ||
| version: 0.4.0+8 | ||
|
|
||
| flutter: | ||
| plugin: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, fewer RUNs could reduce Docker image size.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, I combined a couple of the run commands.
If we really wanted to be efficient we'd probably be building the Docker image and putting it in the cloud like the flutter/flutter repo does: https://github.com/flutter/flutter/blob/master/.cirrus.yml#L2
Not sure how much of a priority that is though.