Skip to content
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

Test lab github #53

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
199 changes: 199 additions & 0 deletions .github/workflows/firestore_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: Run unit/integration/testlab

on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths:
- "firestore/**"
push:
paths-ignore:
- "**.md"

jobs:
unit_tests:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "checkout"
uses: actions/checkout@v2
- name: "install flutter"
uses: subosito/flutter-action@v2
- name: "Run widget tests"
working-directory: firestore
run: flutter test
test_lab:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
# FIXME need to build the app here
- name: "Test lab run"
id: ftl_test # removed - here
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
with:
credentials_json: ${{ secrets.TEST_LAB }} # FIXME test this
test_type: "robo" # FIXME instrumentation better
testapp_dir: firestore/testapp
test_devices: model=redfin,version=30
- run: echo '${{ steps.ftl_test.outputs.test_summary }}'


# firebase-ios-sdk .github/workflows/dynamiclinks.yml
# See also .github/workflows/crashlytics.yml
# env:
# plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
# signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
# runs-on: macos-12
# steps:
# - uses: actions/checkout@v3
# - uses: ruby/setup-ruby@v1
# - name: Setup quickstart
# run: scripts/setup_quickstart.sh DynamicLinks
# - name: Install Secret GoogleService-Info.plist
# run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-dynamiclinks.plist.gpg \
# quickstart-ios/dynamiclinks/GoogleService-Info.plist "$plist_secret"
# - name: Update Environment Variable For DynamicLinks
# run: |
# sed -i '' 's#DYNAMIC_LINK_DOMAIN#https://qpf6m.app.goo.gl#' quickstart-ios/dynamiclinks/DynamicLinksExample/DynamicLinksExample.entitlements
# sed -i '' 's#YOUR_DOMAIN_URI_PREFIX";#https://qpf6m.app.goo.gl";#' quickstart-ios/dynamiclinks/DynamicLinksExample/ViewController.m
# sed -i '' 's#YOUR_DOMAIN_URI_PREFIX";#https://qpf6m.app.goo.gl";#' quickstart-ios/dynamiclinks/DynamicLinksExampleSwift/ViewController.swift
# # - name: Build objc quickstart
# # run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh DynamicLinks)
# - name: Build swift quickstart
# if: ${{ always() }}
# run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh DynamicLinks swift)
# - id: ftl_test
# uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
# with:
# credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
# testapp_dir: quickstart-ios/build-for-testing
# test_type: "xctest"


# firebase-cpp-sdk
# test_android:
# name: test-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}
# needs: [check_and_prepare, build_android]
# runs-on: macos-12
# if: contains(needs.check_and_prepare.outputs.matrix_platform, 'Android') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
# strategy:
# fail-fast: false
# matrix:
# build_os: ${{ fromJson(needs.check_and_prepare.outputs.matrix_os) }}
# android_device: ${{ fromJson(needs.check_and_prepare.outputs.android_device) }}
# test_type: ["gameloop"]
# exclude:
# - android_device: "android_target"
# test_type: "uitest"
# - android_device: "android_latest"
# test_type: "uitest"
# steps:
# - uses: actions/checkout@v3
# with:
# ref: ${{needs.check_and_prepare.outputs.github_ref}}
# - name: Download Android integration tests artifact
# uses: actions/download-artifact@v3
# with:
# path: testapps/testapps-android-${{ matrix.build_os }}
# name: testapps-android-${{ matrix.build_os }}
# - name: Setup python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.pythonVersion }}
# - name: Install prerequisites for testing
# uses: nick-invision/retry@v2
# with:
# shell: bash
# timeout_minutes: 5
# max_attempts: 3
# command: scripts/gha/install_test_workflow_prereqs.sh -p Android -t true
# - name: Get Device Info
# id: device-info
# run: |
# echo "device_type=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_device_type)" >> $GITHUB_OUTPUT
# echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_ftl_device)" >> $GITHUB_OUTPUT
# - name: Setup java 8 for test_simulator.py
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '8'
# - name: Run Android integration tests on Emulator locally
# timeout-minutes: 150
# if: steps.device-info.outputs.device_type == 'virtual'
# run: |
# python scripts/gha/test_simulator.py --testapp_dir testapps \
# --test_type "${{ matrix.test_type }}" \
# --android_device "${{ matrix.android_device }}" \
# --logfile_name "android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}" \
# --ci
# - id: ftl_test
# if: steps.device-info.outputs.device_type == 'ftl'
# uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
# timeout-minutes: 90
# with:
# credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
# testapp_dir: testapps
# test_type: "game-loop"
# test_devices: ${{ steps.device-info.outputs.device }}
# max_attempts: 3
# validator: ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
# - name: Read FTL Test Result
# if: ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
# shell: bash
# run: |
# python scripts/gha/read_ftl_test_result.py --test_result '${{ steps.ftl_test.outputs.test_summary }}' \
# --output_path testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.log
# - name: Prepare results summary artifact
# if: ${{ !cancelled() }}
# shell: bash
# run: |
# # If testapps do not exist, then it's a build error not test error.
# if [ -d "testapps/testapps-android-${{ matrix.build_os }}" ] && [ ! -f "testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.log.json" ]; then
# mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.log.json"
# fi
# - name: Upload Android test results artifact
# if: ${{ !cancelled() }}
# uses: actions/upload-artifact@v3
# with:
# name: log-artifact
# path: testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}*
# retention-days: ${{ env.artifactRetentionDays }}
# - name: Upload Android test video artifact
# if: ${{ steps.device-info.outputs.device_type == 'virtual' && !cancelled() }}
# uses: actions/upload-artifact@v3
# with:
# name: mobile-simulator-test-video-artifact
# path: testapps/video-*-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.mp4
# retention-days: ${{ env.artifactRetentionDays }}
# - name: Upload Android test logcat artifact
# if: ${{ steps.device-info.outputs.device_type == 'virtual' && !cancelled() }}
# uses: actions/upload-artifact@v3
# with:
# name: mobile-simulator-test-logcat-artifact
# path: testapps/logcat-*-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.txt
# retention-days: ${{ env.artifactRetentionDays }}
# - name: Download log artifacts
# if: ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
# uses: actions/download-artifact@v3
# with:
# path: test_results
# name: log-artifact
# - name: Update PR label and comment
# if: ${{ needs.check_and_prepare.outputs.pr_number && failure() && !cancelled() }}
# shell: bash
# run: |
# python scripts/gha/it_workflow.py --stage progress \
# --token ${{github.token}} \
# --issue_number ${{needs.check_and_prepare.outputs.pr_number}}\
# --actor ${{github.actor}} \
# --commit ${{needs.check_and_prepare.outputs.github_ref}} \
# --run_id ${{github.run_id}}
# - name: Summarize test results
# if: ${{ !cancelled() }}
# shell: bash
# run: |
# cat "testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}.log"
# if [[ "${{ job.status }}" != "success" ]]; then
# exit 1
# fi
5 changes: 5 additions & 0 deletions firestore/README.md
Original file line number Diff line number Diff line change
@@ -48,6 +48,11 @@ service cloud.firestore {
**Add Some** from the overflow menu to add some
new entries.

### Run the App Web

In order to display images without a CORS exception, use the --web-renderer html flag:
`flutter run -d chrome --web-renderer html`

### Result

<img src="./assets/home.png" height="534" width="300"/>
3 changes: 3 additions & 0 deletions firestore/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@ if (flutterVersionName == null) {
}

apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
// END: FlutterFire Configuration
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

46 changes: 46 additions & 0 deletions firestore/android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"project_info": {
"project_number": "905001072058",
"project_id": "ctflutterquickstart",
"storage_bucket": "ctflutterquickstart.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:905001072058:android:6b4d615e68771837801983",
"android_client_info": {
"package_name": "com.example.firestore"
}
},
"oauth_client": [
{
"client_id": "905001072058-o40uoh0mn4staje7e49gudg3rl8b1723.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBeYHWDZI-VYzraflj-GJ9Yj-5vKdqd1uE"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "905001072058-o40uoh0mn4staje7e49gudg3rl8b1723.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "905001072058-58k5uvhubqhj8loen93npuv833qqnte5.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.firestore"
}
}
]
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.

package io.flutter.app;

import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;

/**
* Extension of {@link android.app.Application}, adding multidex support.
*/
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
7 changes: 5 additions & 2 deletions firestore/android/build.gradle
Original file line number Diff line number Diff line change
@@ -6,7 +6,10 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.4.1'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.14'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -26,6 +29,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion firestore/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
29 changes: 15 additions & 14 deletions firestore/lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -35,21 +35,20 @@ class DefaultFirebaseOptions {
}

static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyAfj_GOB5yKD6lPaVS9hSskKITPuquzpZQ',
appId: '1:993083111617:web:380d3567efd5f99a67bc40',
messagingSenderId: '993083111617',
projectId: 'friendlyeats-flutter-68d79',
authDomain: 'friendlyeats-flutter-68d79.firebaseapp.com',
storageBucket: 'friendlyeats-flutter-68d79.appspot.com',
measurementId: 'G-FSYS2SH1N4',
apiKey: 'AIzaSyC8VCwBMvvfKAqnXC5vxBvgEmEISz1N5XA',
appId: '1:905001072058:web:e25193a00a843ca7801983',
messagingSenderId: '905001072058',
projectId: 'ctflutterquickstart',
authDomain: 'ctflutterquickstart.firebaseapp.com',
storageBucket: 'ctflutterquickstart.appspot.com',
);

static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyAiC9yhzOEeMcP6dIuKEZCfOdknTzNtYGM',
appId: '1:993083111617:android:a1aded9943e3dd0367bc40',
messagingSenderId: '993083111617',
projectId: 'friendlyeats-flutter-68d79',
storageBucket: 'friendlyeats-flutter-68d79.appspot.com',
apiKey: 'AIzaSyBeYHWDZI-VYzraflj-GJ9Yj-5vKdqd1uE',
appId: '1:905001072058:android:6b4d615e68771837801983',
messagingSenderId: '905001072058',
projectId: 'ctflutterquickstart',
storageBucket: 'ctflutterquickstart.appspot.com',
);

static const FirebaseOptions ios = FirebaseOptions(
@@ -58,7 +57,8 @@ class DefaultFirebaseOptions {
messagingSenderId: '993083111617',
projectId: 'friendlyeats-flutter-68d79',
storageBucket: 'friendlyeats-flutter-68d79.appspot.com',
iosClientId: '993083111617-a9q0thbihk8tl0487gfem1hm1ahaieab.apps.googleusercontent.com',
iosClientId:
'993083111617-a9q0thbihk8tl0487gfem1hm1ahaieab.apps.googleusercontent.com',
iosBundleId: 'friendlyeats.example.app',
);

@@ -68,7 +68,8 @@ class DefaultFirebaseOptions {
messagingSenderId: '993083111617',
projectId: 'friendlyeats-flutter-68d79',
storageBucket: 'friendlyeats-flutter-68d79.appspot.com',
iosClientId: '993083111617-lh0dmnumalopnegi244kmfm2o0brl7dg.apps.googleusercontent.com',
iosClientId:
'993083111617-lh0dmnumalopnegi244kmfm2o0brl7dg.apps.googleusercontent.com',
iosBundleId: 'friendlyears.example.app',
);
}
Loading
Loading