ML-166 Fixed golden tests run on CI (#168)

* stub iap for goldens workflow

* typo

* Updated goldens

* don't push iap stub when updating goldens

* Update pubspec.yaml

* try explicit fonts

* Updated goldens

* set explicit font weights

* disable font smoothing

* run goldens on macos

* typo

* removed defaults from goldens workflow

* run pr check on macos-14

* removed smoothening reset

* Delete run_golden_tests.yml

* deleted fonts folder

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Vadim 2024-04-12 10:43:19 +02:00 committed by GitHub
parent 27d56d1061
commit d5f28ee5a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 64 deletions

View file

@ -14,7 +14,7 @@ on:
jobs: jobs:
analyze-and-test: analyze-and-test:
name: Analyze & test name: Analyze & test
runs-on: macos-latest runs-on: macos-14
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: 8BitJonny/gh-get-current-pr@2.2.0 - uses: 8BitJonny/gh-get-current-pr@2.2.0
@ -54,7 +54,9 @@ jobs:
run: flutter analyze lib --fatal-infos run: flutter analyze lib --fatal-infos
- name: Run tests - name: Run tests
run: flutter test --dart-define cameraStubImage=assets/camera_stub_image.jpg run: |
defaults -currentHost write -g AppleFontSmoothing -int 0
flutter test --dart-define cameraStubImage=assets/camera_stub_image.jpg
- name: Analyze project source with stub - name: Analyze project source with stub
if: steps.override-iap.conclusion != 'success' if: steps.override-iap.conclusion != 'success'

View file

@ -1,62 +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
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