mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-04 21:30:39 +00:00
Compare commits
7 commits
c79a578286
...
6faa9e12a0
Author | SHA1 | Date | |
---|---|---|---|
|
6faa9e12a0 | ||
|
60dd9549e8 | ||
|
1d6cc13d7d | ||
|
6d1fd9e05a | ||
|
cd5949470b | ||
|
20b4c387c1 | ||
|
ed45052317 |
5 changed files with 25 additions and 41 deletions
6
.github/scripts/run_integration_tests.sh
vendored
Normal file
6
.github/scripts/run_integration_tests.sh
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
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
|
49
.github/workflows/run_integration_tests.yml
vendored
49
.github/workflows/run_integration_tests.yml
vendored
|
@ -9,19 +9,11 @@ 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: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-13]
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -42,42 +34,23 @@ jobs:
|
|||
channel: "stable"
|
||||
flutter-version: "3.10.0"
|
||||
|
||||
- name: Build app
|
||||
- name: Prepare 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
|
||||
if: ${{ matrix.os == 'macos-13' }}
|
||||
run: flutter test $TARGET $BUILD_ARGS
|
||||
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
|
||||
|
|
|
@ -2,6 +2,7 @@ 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';
|
||||
|
@ -24,6 +25,8 @@ import 'mocks/paid_features_mock.dart';
|
|||
import 'utils/expectations.dart';
|
||||
|
||||
void main() {
|
||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
setUp(() {
|
||||
SharedPreferences.setMockInitialValues({
|
||||
/// Metering values
|
||||
|
|
5
integration_test/run_integration_tests.sh
Normal file
5
integration_test/run_integration_tests.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
flutter drive \
|
||||
--target=integration_test/e2e_test.dart \
|
||||
--driver=test_driver/integration_driver.dart \
|
||||
--flavor=dev \
|
||||
--dart-define cameraStubImage=assets/camera_stub_image.jpg
|
|
@ -1,8 +1,5 @@
|
|||
import 'package:integration_test/integration_test_driver_extended.dart';
|
||||
|
||||
import 'utils/grant_camera_permission.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
await grantCameraPermission();
|
||||
await integrationDriver();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue