Compare commits

..

No commits in common. "6faa9e12a0895ceba718a10561d8961a9f6e18c8" and "c79a5782861c64cb9d7d06ddc5991a62641abb58" have entirely different histories.

5 changed files with 41 additions and 25 deletions

View file

@ -1,6 +0,0 @@
flutter drive \
--target=integration_test/e2e_test.dart \
--driver=test_driver/integration_driver.dart \
--flavor=dev \
--no-dds \
--dart-define cameraStubImage=assets/camera_stub_image.jpg

View file

@ -9,11 +9,19 @@ on:
workflow_dispatch:
workflow_call:
env:
BUILD_ARGS: --flavor dev --dart-define cameraStubImage=assets/camera_stub_image.jpg
TARGET: integration_test/run_all_tests.dart
jobs:
run-integration-tests:
name: Run integration tests
timeout-minutes: 60
runs-on: macos-13
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
@ -34,23 +42,42 @@ jobs:
channel: "stable"
flutter-version: "3.10.0"
- name: Prepare app
- name: Build app
run: |
flutter --version
flutter pub get
flutter pub run intl_utils:generate
flutter analyze lib --fatal-infos
if [ "${{ matrix.os }}" == "macos-13" ]
then
cd ios
pod install
cd ..
fi
flutter build ${{ matrix.os == 'ubuntu-latest' && 'apk --debug' || 'ios --no-codesign --simulator --debug' }} $BUILD_ARGS -t $TARGET
- name: Enable KVM
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Launch Android simulator & Run tests
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 32
target: default
arch: x86_64
profile: pixel_6
script: flutter test $TARGET $BUILD_ARGS
- name: Launch iOS simulator
uses: futureware-tech/simulator-action@v3
if: ${{ matrix.os == 'macos-13' }}
with:
model: "iPhone 15 Pro"
- name: Run tests
run: |
flutter drive \
--target=integration_test/e2e_test.dart \
--driver=test_driver/integration_driver.dart \
--flavor=dev \
--no-dds \
--dart-define cameraStubImage=assets/camera_stub_image.jpg
if: ${{ matrix.os == 'macos-13' }}
run: flutter test $TARGET $BUILD_ARGS

View file

@ -2,7 +2,6 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:lightmeter/data/models/ev_source_type.dart';
import 'package:lightmeter/data/models/metering_screen_layout_config.dart';
import 'package:lightmeter/data/shared_prefs_service.dart';
@ -25,8 +24,6 @@ import 'mocks/paid_features_mock.dart';
import 'utils/expectations.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
setUp(() {
SharedPreferences.setMockInitialValues({
/// Metering values

View file

@ -1,5 +0,0 @@
flutter drive \
--target=integration_test/e2e_test.dart \
--driver=test_driver/integration_driver.dart \
--flavor=dev \
--dart-define cameraStubImage=assets/camera_stub_image.jpg

View file

@ -1,5 +1,8 @@
import 'package:integration_test/integration_test_driver_extended.dart';
import 'utils/grant_camera_permission.dart';
Future<void> main() async {
await grantCameraPermission();
await integrationDriver();
}