mirror of https://github.com/flutter/samples.git
Split CI testing based on flutter channels (#651)
parent
e7d70288d9
commit
9b631a2184
@ -0,0 +1,15 @@
|
|||||||
|
// This is a basic Flutter widget test.
|
||||||
|
//
|
||||||
|
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||||
|
// utility that Flutter provides. For example, you can send tap and scroll
|
||||||
|
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||||
|
// tree, read text, and verify that the values of widget properties are correct.
|
||||||
|
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
testWidgets('Rendering the page throws an exception',
|
||||||
|
(WidgetTester tester) async {
|
||||||
|
// Do nothing, running the app throws an exception on widget render.
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
declare -ar PROJECT_NAMES=(
|
||||||
|
"add_to_app/flutter_module" \
|
||||||
|
"add_to_app/flutter_module_using_plugin" \
|
||||||
|
"add_to_app/flutter_module_books" \
|
||||||
|
"animations" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/652
|
||||||
|
# "flutter_maps_firestore" \
|
||||||
|
"infinite_list" \
|
||||||
|
"ios_app_clip" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/653
|
||||||
|
# "isolate_example" \
|
||||||
|
"jsonexample" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/655
|
||||||
|
# "place_tracker" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/656
|
||||||
|
# "platform_channels" \
|
||||||
|
"platform_design"
|
||||||
|
"platform_view_swift" \
|
||||||
|
"provider_counter" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/657
|
||||||
|
# "provider_shopper" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/658
|
||||||
|
# "testing_app" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/659
|
||||||
|
# "experimental/federated_plugin/federated_plugin" \
|
||||||
|
"experimental/null_safety/null_safe_app" \
|
||||||
|
"experimental/null_safety/null_unsafe_app" \
|
||||||
|
"experimental/veggieseasons" \
|
||||||
|
"experimental/web_dashboard" \
|
||||||
|
)
|
||||||
|
|
||||||
|
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
|
||||||
|
do
|
||||||
|
echo "== Testing '${PROJECT_NAME}' on Flutter's beta channel =="
|
||||||
|
pushd "${PROJECT_NAME}"
|
||||||
|
|
||||||
|
# Grab packages.
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
|
# Run the analyzer to find any static analysis issues.
|
||||||
|
flutter analyze
|
||||||
|
|
||||||
|
# Reformat the web plugin registrant, if necessary.
|
||||||
|
if [ -f "lib/generated_plugin_registrant.dart" ]
|
||||||
|
then
|
||||||
|
echo "Renaming $(pwd)/lib/generated_plugin_registrant.dart"
|
||||||
|
flutter format "lib/generated_plugin_registrant.dart"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the formatter on all the dart files to make sure everything's linted.
|
||||||
|
flutter format -n --set-exit-if-changed .
|
||||||
|
|
||||||
|
# Run the actual tests.
|
||||||
|
flutter test
|
||||||
|
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "-- Success --"
|
@ -0,0 +1,64 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
declare -ar PROJECT_NAMES=(
|
||||||
|
"add_to_app/flutter_module" \
|
||||||
|
"add_to_app/flutter_module_using_plugin" \
|
||||||
|
"add_to_app/flutter_module_books" \
|
||||||
|
"animations" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/652
|
||||||
|
# "flutter_maps_firestore" \
|
||||||
|
"infinite_list" \
|
||||||
|
"ios_app_clip" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/653
|
||||||
|
# "isolate_example" \
|
||||||
|
"jsonexample" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/655
|
||||||
|
# "place_tracker" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/656
|
||||||
|
# "platform_channels" \
|
||||||
|
"platform_design"
|
||||||
|
"platform_view_swift" \
|
||||||
|
"provider_counter" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/657
|
||||||
|
# "provider_shopper" \
|
||||||
|
# Tracking issue: https://github.com/flutter/samples/issues/658
|
||||||
|
# "testing_app" \
|
||||||
|
"experimental/desktop_photo_search" \
|
||||||
|
# https://github.com/flutter/samples/issues/659
|
||||||
|
# "experimental/federated_plugin/federated_plugin" \
|
||||||
|
"experimental/null_safety/null_safe_app" \
|
||||||
|
"experimental/null_safety/null_unsafe_app" \
|
||||||
|
"experimental/veggieseasons" \
|
||||||
|
"experimental/web_dashboard" \
|
||||||
|
)
|
||||||
|
|
||||||
|
for PROJECT_NAME in "${PROJECT_NAMES[@]}"
|
||||||
|
do
|
||||||
|
echo "== Testing '${PROJECT_NAME}' on Flutter's dev channel =="
|
||||||
|
pushd "${PROJECT_NAME}"
|
||||||
|
|
||||||
|
# Grab packages.
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
|
# Run the analyzer to find any static analysis issues.
|
||||||
|
flutter analyze
|
||||||
|
|
||||||
|
# Reformat the web plugin registrant, if necessary.
|
||||||
|
if [ -f "lib/generated_plugin_registrant.dart" ]
|
||||||
|
then
|
||||||
|
echo "Renaming $(pwd)/lib/generated_plugin_registrant.dart"
|
||||||
|
flutter format "lib/generated_plugin_registrant.dart"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run the formatter on all the dart files to make sure everything's linted.
|
||||||
|
flutter format -n --set-exit-if-changed .
|
||||||
|
|
||||||
|
# Run the actual tests.
|
||||||
|
flutter test
|
||||||
|
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "-- Success --"
|
Loading…
Reference in new issue