Skip to content

test: organize melos for full local testing, minor fixes so complete runs quickly pass #4331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 4, 2021
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
85 changes: 70 additions & 15 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ packages:
- packages/**

scripts:
lint:all:
run: melos run analyze && melos run format
description: Run all static analysis checks

analyze:
run: |
melos exec -c 5 --fail-fast -- \
Expand All @@ -19,29 +23,64 @@ scripts:
- Requires `flutter_plugin_tools` (`pub global activate flutter_plugin_tools`).
- Requires `clang-format` (can be installed via Brew on macOS).

build:all:
run: |
melos run build:example_ios_pub --no-select && melos run build:example_android_pub --no-select && melos bootstrap
description: Build all example apps (currently ios and android, macos requires flutter channel master)

build:example_android:
run: |
melos exec -c 1 --fail-fast -- \
melos exec -c 6 --fail-fast -- \
"flutter build apk --no-pub"
description: Build a specific example app for Android.
select-package:
dir-exists:
- android
scope: '*example*'
scope: "*example*"
ignore: "*firebase_ml_custom*"

# melos bootstrap does not generate all files generated by a build that runs
# `pub get`, and `flutter drive` does not either, so it is still necessary to
# build sometimes without the `--no-pub` switch. Careful: `melos bootstrap` after.
build:example_android_pub:
run: |
melos exec -c 6 --fail-fast -- \
"flutter build apk"
description: Build a specific example app for Android.
select-package:
dir-exists:
- android
scope: "*example*"
ignore: "*firebase_ml_custom*"

build:example_ios:
run: |
melos exec -c 1 --fail-fast -- \
melos exec -c 6 --fail-fast -- \
"flutter build ios --no-codesign --no-pub"
description: Build a specific example app for iOS.
select-package:
dir-exists:
- ios
scope: '*example*'
scope: "*example*"
ignore: "*firebase_ml_custom*"

# melos bootstrap does not generate all files generated by a build that runs
# `pub get`, and `flutter drive` does not either, so it is still necessary to
# build sometimes without the `--no-pub` switch. Careful: `melos bootstrap` after.
build:example_ios_pub:
run: |
melos exec -c 6 --fail-fast -- \
"flutter build ios --no-codesign"
description: Build a specific example app for iOS.
select-package:
dir-exists:
- ios
scope: "*example*"
ignore: "*firebase_ml_custom*"

build:example_macos:
run: |
melos exec -c 1 --fail-fast -- \
melos exec -c 6 --fail-fast -- \
"flutter build macos --no-pub"
description: |
Build a specific example app for macOS.
Expand All @@ -50,19 +89,23 @@ scripts:
select-package:
dir-exists:
- macos
scope: '*example*'
scope: "*example*"

test:all:
run: melos run test --no-select && melos run test:mobile_e2e --no-select
description: Run all tests available on stable channel

test:
run: |
melos exec -c 1 --fail-fast -- \
melos exec -c 6 --fail-fast -- \
"flutter test --no-pub"
description: Run `flutter test` for a specific package.
select-package:
dir-exists:
- test
ignore:
- '*web*'
- '*example*'
- "*web*"
- "*example*"

test:web:
run: |
Expand All @@ -72,19 +115,23 @@ scripts:
select-package:
dir-exists:
- test
scope: '*web*'
scope: "*web*"

test:mobile_e2e:
run: |
melos exec -c 1 --fail-fast -- \
"flutter drive --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart"
"flutter drive --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart"
description: |
Run all Android or iOS test driver e2e tests in a specific example app.
- Requires an Android emulator or iOS simulator.
select-package:
dir-exists:
- test_driver
scope: '*example*'
scope: "*example*"
ignore:
- "*firebase_ml_custom*"
- "*firebase_ml_vision*"
- "*firebase_admob*"

test:web_e2e:
run: |
Expand All @@ -99,7 +146,7 @@ scripts:
dir-exists:
- web
- test_driver
scope: '*example*'
scope: "*example*"

test:macos_e2e:
run: |
Expand All @@ -113,11 +160,19 @@ scripts:
dir-exists:
- macos
- test_driver
scope: '*example*'
scope: "*example*"

# Clean things very deeply, can be used to establish "pristine checkout" status
clean:deep: >
git clean -x -d -f -q

# Additional cleanup lifecycle script, executed when `melos clean` is ran.
postclean: >
melos exec -c 5 -- "flutter clean"
melos exec -c 6 -- "flutter clean"

# Run all targets generally exected in CI for a full local quality check
qualitycheck: >
melos run clean:deep && melos clean && melos bootstrap && melos run lint:all && melos run build:all && melos run test:all

dev_dependencies:
pedantic: 1.8.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
plugin_platform_interface: ^1.0.0

dev_dependencies:
firebase_core_platform_interface: ">=2.0.0 <2.1.0"
firebase_core_platform_interface: ^2.0.0
pedantic: ^1.8.0
flutter_test:
sdk: flutter
Expand Down
14 changes: 12 additions & 2 deletions packages/firebase_ml_vision/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,18 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-ml-vision:20.0.0'
implementation 'com.google.firebase:firebase-common:16.1.0'
implementation platform("com.google.firebase:firebase-bom:25.13.0")
implementation 'com.google.firebase:firebase-common'
api "com.google.firebase:firebase-ml-vision"

implementation 'com.google.android.gms:play-services-vision:20.1.1'
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
implementation 'com.google.android.gms:play-services-vision-face-contour-internal:16.0.3'
implementation 'com.google.android.gms:play-services-vision-image-labeling-internal:16.0.5'
implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'
implementation 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.4'

implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
}
Expand Down
13 changes: 11 additions & 2 deletions packages/firebase_ml_vision/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,17 @@ android {
}

dependencies {
api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
api 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'

implementation platform("com.google.firebase:firebase-bom:25.13.0")
implementation "com.google.firebase:firebase-ml-vision"

implementation 'com.google.android.gms:play-services-vision:20.1.1'
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
implementation 'com.google.android.gms:play-services-vision-face-contour-internal:16.0.3'
implementation 'com.google.android.gms:play-services-vision-image-labeling-internal:16.0.5'
implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'
implementation 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:22.0.4'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
Expand Down