Compare commits

..

20 commits

Author SHA1 Message Date
Vadim
e06650cf76 deleted fonts folder 2024-04-12 10:39:09 +02:00
Vadim
29eed73a1e Delete run_golden_tests.yml 2024-04-12 10:35:31 +02:00
Vadim
a27651450a removed smoothening reset 2024-04-12 10:30:16 +02:00
Vadim
79d33f558d run pr check on macos-14 2024-04-12 10:25:43 +02:00
Vadim
a19bf3df1c removed defaults from goldens workflow 2024-04-12 09:59:39 +02:00
Vadim
ff1260c5d9 typo 2024-04-12 09:53:01 +02:00
Vadim
6ecea38ec7 run goldens on macos 2024-04-12 09:32:23 +02:00
Vadim
351631bb8a disable font smoothing 2024-04-12 09:27:27 +02:00
Vadim
616f327f15 set explicit font weights 2024-04-12 09:10:43 +02:00
github-actions[bot]
25aa5bbb5e Updated goldens 2024-04-12 07:05:02 +00:00
Vadim
ba7e48cfcf try explicit fonts 2024-04-12 09:03:14 +02:00
Vadim
fb8b0f15c8 Update pubspec.yaml 2024-04-12 08:27:37 +02:00
Vadim
995180603d don't push iap stub when updating goldens 2024-04-12 08:23:06 +02:00
github-actions[bot]
6431fdad43 Updated goldens 2024-04-12 06:18:01 +00:00
Vadim
69522153bb typo 2024-04-12 08:15:58 +02:00
Vadim
cd09efeb05 stub iap for goldens workflow 2024-04-12 08:12:42 +02:00
Vadim
1b0443a588 Merge branch 'main' of https://github.com/vodemn/m3_lightmeter into feature/ML-166 2024-04-12 08:11:38 +02:00
Vadim
27d56d1061
ML-166 Golden tests (#167)
* setup golden toolkit

* implemented `GoldenTestApplicationMock`

* added devices with dark theme

* implemented MeteringScreen golden test

* moved platform channel logic to app mock

* implemented SettingsScreen golden test

* gitignore golden tests failures

* Create dart_test.yaml

* adjusted `RulerSlider` ticks height

* set master screenshots

* run golden tests on ci

* fixed `LightSensorService` tests

* removed golden workflow call from PR check

* Update pr_check.yml
2024-04-12 08:07:20 +02:00
Vadim
df399fd068 Update pr_check.yml 2024-04-12 08:00:09 +02:00
Vadim
ead5df125b removed golden workflow call from PR check 2024-04-12 07:51:49 +02:00
5 changed files with 10 additions and 76 deletions

View file

@ -14,7 +14,7 @@ on:
jobs:
analyze-and-test:
name: Analyze & test
runs-on: macos-11
runs-on: macos-14
timeout-minutes: 10
steps:
- uses: 8BitJonny/gh-get-current-pr@2.2.0
@ -54,7 +54,9 @@ jobs:
run: flutter analyze lib --fatal-infos
- name: Run tests
run: flutter test
run: |
defaults -currentHost write -g AppleFontSmoothing -int 0
flutter test --dart-define cameraStubImage=assets/camera_stub_image.jpg
- name: Analyze project source with stub
if: steps.override-iap.conclusion != 'success'
@ -62,9 +64,3 @@ jobs:
bash ./.github/scripts/stub_iap.sh
flutter pub get
flutter analyze lib --fatal-infos
run-golden-tests:
name: Run golden tests
needs: [analyze-and-test]
uses: ./.github/workflows/run_golden_tests.yml
secrets: inherit

View file

@ -1,68 +0,0 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Run golden tests
on:
workflow_dispatch:
inputs:
update-goldens:
type: boolean
description: Update goldens
default: false
workflow_call:
inputs:
update-goldens:
type: boolean
description: Update goldens
default: false
jobs:
run-golden-tests:
name: Run golden tests
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.13.9"
- name: Prepare app
run: |
flutter --version
flutter pub get
flutter pub run intl_utils:generate
- name: Run tests
env:
UPDATE_GOLDENS: ${{inputs.update-goldens && '--update-goldens' || '' }}ƒ
run: |
goldens=$(find ./test -name "*_golden_test.dart" -print)
for f in $goldens; do
flutter test "$f"\
--dart-define cameraStubImage=assets/camera_stub_image.jpg \
$UPDATE_GOLDENS
done
- name: Commit changes
if: ${{ inputs.update-goldens }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "Updated goldens"
- name: Push to main
if: ${{ inputs.update-goldens }}
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUSH_TO_MAIN_TOKEN }}
branch: ${{ github.ref_name }}
unprotect_reviews: true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 KiB

After

Width:  |  Height:  |  Size: 488 KiB

6
update_goldens.sh Normal file
View file

@ -0,0 +1,6 @@
defaults -currentHost write -g AppleFontSmoothing -int 0
goldens=$(find ./test -name "*_golden_test.dart" -print)
for f in $goldens; do
flutter test "$f" --dart-define cameraStubImage=assets/camera_stub_image.jpg --update-goldens
done
defaults -currentHost write -g AppleFontSmoothing -int 3