Skip to content

Commit

Permalink
Merge branch 'main' of github.com:flutter/packages into wkwebview_aut…
Browse files Browse the repository at this point in the history
…h_list
  • Loading branch information
bparrishMines committed Feb 27, 2025
2 parents 277aba8 + 9744c9d commit 9e0a009
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
911aa7547ed732052f98b79f7b1584bd137bda43
2e570ca393c844ada4d77b0210ce6a5bc20bcf82
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import android.util.Log;
import androidx.lifecycle.Lifecycle;
import dev.flutter.plugins.integration_test.IntegrationTestPlugin;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
Expand All @@ -19,8 +18,8 @@ public class MainActivity extends FlutterActivity {

@Override
public void configureFlutterEngine(FlutterEngine flutterEngine) {
super.configureFlutterEngine(flutterEngine);
flutterEngine.getPlugins().add(new TestPlugin());
flutterEngine.getPlugins().add(new IntegrationTestPlugin());
}

private static class TestPlugin implements FlutterPlugin, ActivityAware {
Expand Down
33 changes: 17 additions & 16 deletions script/tool/lib/src/firebase_test_lab_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,23 @@ class FirebaseTestLabCommand extends PackageLoopingCommand {
///
/// Returns true if either gradlew was already present, or the build succeeds.
Future<bool> _ensureGradleWrapperExists(GradleProject project) async {
if (!project.isConfigured()) {
print('Running flutter build apk...');
final String experiment = getStringArg(kEnableExperiment);
final int exitCode = await processRunner.runAndStream(
flutterCommand,
<String>[
'build',
'apk',
'--config-only',
if (experiment.isNotEmpty) '--enable-experiment=$experiment',
],
workingDir: project.androidDirectory);

if (exitCode != 0) {
return false;
}
// Unconditionally re-run build with --debug --config-only, to ensure that
// the project is in a debug state even if it was previously configured.
print('Running flutter build apk...');
final String experiment = getStringArg(kEnableExperiment);
final int exitCode = await processRunner.runAndStream(
flutterCommand,
<String>[
'build',
'apk',
'--debug',
'--config-only',
if (experiment.isNotEmpty) '--enable-experiment=$experiment',
],
workingDir: project.androidDirectory);

if (exitCode != 0) {
return false;
}
return true;
}
Expand Down
46 changes: 44 additions & 2 deletions script/tool/test/firebase_test_lab_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ public class MainActivityTest {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
const <String>['build', 'apk', '--debug', '--config-only'],
plugin1
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'gcloud',
'auth activate-service-account --key-file=/path/to/key'
Expand All @@ -185,6 +193,14 @@ public class MainActivityTest {
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin1/buildId/testRunId/example/0/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin1/example'),
ProcessCall(
'flutter',
const <String>['build', 'apk', '--debug', '--config-only'],
plugin2
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'/packages/plugin2/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
Expand Down Expand Up @@ -245,6 +261,14 @@ public class MainActivityTest {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
const <String>['build', 'apk', '--debug', '--config-only'],
plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
Expand Down Expand Up @@ -669,8 +693,12 @@ class MainActivityTest {
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
'build apk --config-only'.split(' '),
'/packages/plugin/example/android',
'build apk --debug --config-only'.split(' '),
plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path,
),
ProcessCall(
'/packages/plugin/example/android/gradlew',
Expand Down Expand Up @@ -841,6 +869,20 @@ class MainActivityTest {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
const <String>[
'build',
'apk',
'--debug',
'--config-only',
'--enable-experiment=exp1'
],
plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.path),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true -Pextra-front-end-options=--enable-experiment%3Dexp1 -Pextra-gen-snapshot-options=--enable-experiment%3Dexp1'
Expand Down

0 comments on commit 9e0a009

Please sign in to comment.