Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
working-directory: tests
script: |
sleep 15
flutter drive --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter test integration_test/e2e_test.dart --dart-define=CI=true

ios:
runs-on: macos-latest
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build ios --no-codesign --simulator --debug --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter build ios --no-codesign --simulator --debug --target=integration_test/e2e_test.dart --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
Expand All @@ -133,7 +133,7 @@ jobs:
sleep 15
# Uncomment following line to have simulator logs printed out for debugging purposes.
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
flutter drive -d "$SIMULATOR" --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --dart-define=CI=true
FLUTTER_DRIVE_EXIT_CODE=$?
xcrun simctl shutdown "$SIMULATOR"
exit $FLUTTER_DRIVE_EXIT_CODE
Expand Down Expand Up @@ -190,14 +190,17 @@ jobs:
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build macos --debug --target=./test_driver/driver_e2e.dart --device-id=macos --dart-define=CI=true
flutter build macos --debug --target=integration_test/e2e_test.dart --device-id=macos --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
run: |
flutter drive -d macos --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter test \
integration_test/e2e_test.dart \
-d macos \
--dart-define=CI=true

web:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -229,6 +232,14 @@ jobs:
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: "E2E Tests"
working-directory: tests
# Web devices are not supported for the `flutter test` command yet. As a
# workaround we can use the `flutter drive` command. Tracking issue:
# https://github.com/flutter/flutter/issues/66264
run: |
chromedriver --port=4444 &
flutter drive --verbose-system-logs --device-id=web-server --target=./test_driver/driver_e2e.dart --dart-define=CI=true
flutter drive \
--verbose-system-logs \
-d web-server \
--driver=test_driver/integration_test.dart \
--target=integration_test/e2e_test.dart \
--dart-define=CI=true
4 changes: 3 additions & 1 deletion tests/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.flutter.plugins.firebase.tests"
minSdkVersion 19
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to use multiDex to fix the flutter test command. Is this a problem that I'm adding multiDex?

Output of the exception (without multiDex): https://github.com/nilsreichardt/flutterfire/runs/6877416338?check_suite_focus=true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think multidex is automatically added with minSdkVersion 21, do we want to keep the 19 version? The Android repartition is really low for this SDK 🤔

Copy link
Member

@Salakar Salakar Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for bumping minSdkVersion to 21 on test apps, multidex <21 has caused headaches for me before on other CI things (though this was a while back and on RNFirebase)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping the minSdkVersion to 21 in 622cd46

}

buildTypes {
Expand All @@ -67,5 +68,6 @@ flutter {
}

dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.

package io.flutter.app;

import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;

/** Extension of {@link io.flutter.app.FlutterApplication}, adding multidex support. */
public class FlutterMultiDexApplication extends FlutterApplication {
/** Extension of {@link android.app.Application}, adding multidex support. */
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
Expand Down
12 changes: 12 additions & 0 deletions tests/integration_test/e2e_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('FlutterFire', () {
test('dummy test', () {
expect(true, true);
});
});
}
2 changes: 2 additions & 0 deletions tests/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ dev_dependencies:
sdk: flutter
flutter_test:
sdk: flutter
integration_test:
sdk: flutter

flutter:
uses-material-design: true
3 changes: 3 additions & 0 deletions tests/test_driver/integration_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:integration_test/integration_test_driver.dart';

Future<void> main() => integrationDriver();