Skip to content

Commit bbe9212

Browse files
authored
Add integration test on tvOS Simulator in the workflow
1 parent 78dfc0f commit bbe9212

File tree

31 files changed

+828
-321
lines changed

31 files changed

+828
-321
lines changed

.github/workflows/integration_tests.yml

Lines changed: 159 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
workflow_dispatch:
1010
inputs:
1111
platforms:
12-
description: 'CSV of Desktop, Android and/or iOS'
13-
default: 'Desktop,Android,iOS'
12+
description: 'CSV of Desktop, Android, iOS and/or tvOS'
13+
default: 'Desktop,Android,iOS,tvOS'
1414
required: true
1515
apis:
1616
description: 'CSV of apis to build and test'
@@ -26,7 +26,7 @@ on:
2626
required: true
2727
mobile_test_on:
2828
description: 'Run mobile tests on real and/or virtual devices? (separated by commas)'
29-
default: 'real'
29+
default: 'real,virtual'
3030
required: true
3131
use_expanded_matrix:
3232
description: 'Use an expanded matrix? Note: above config will be ignored.'
@@ -150,6 +150,7 @@ jobs:
150150
mobile_test_on: ${{ steps.export-result.outputs.mobile_test_on }}
151151
android_device: ${{ steps.export-result.outputs.android_device }}
152152
ios_device: ${{ steps.export-result.outputs.ios_device }}
153+
tvos_device: ${{ steps.export-result.outputs.tvos_device }}
153154
github_ref: ${{ steps.export-result.outputs.github_ref }}
154155
steps:
155156
- uses: actions/checkout@v2
@@ -189,6 +190,7 @@ jobs:
189190
echo "::set-output name=mobile_test_on::${mobile_test_on}"
190191
echo "::set-output name=android_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k android_device -t ${mobile_test_on} )"
191192
echo "::set-output name=ios_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k ios_device -t ${mobile_test_on} )"
193+
echo "::set-output name=tvos_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k tvos_device -t ${mobile_test_on} )"
192194
if [[ -z "${{github.event.inputs.test_pull_request}}" ]]; then
193195
echo "::warning ::Running on https://github.com/${{github.repository}}/commits/$GITHUB_SHA"
194196
echo "::set-output name=github_ref::$GITHUB_SHA"
@@ -378,19 +380,6 @@ jobs:
378380
with:
379381
ref: ${{needs.prepare_matrix.outputs.github_ref}}
380382
submodules: true
381-
- name: Set env vars (Linux)
382-
if: startsWith(matrix.os, 'ubuntu')
383-
run: echo "VCPKG_TRIPLET=x64-linux" >> $GITHUB_ENV
384-
- name: Set env vars (macOS)
385-
if: startsWith(matrix.os, 'macos')
386-
run: echo "VCPKG_TRIPLET=x64-osx" >> $GITHUB_ENV
387-
- name: Set env vars (Windows)
388-
shell: bash
389-
if: startsWith(matrix.os, 'Windows')
390-
run: echo "VCPKG_TRIPLET=x64-windows-static" >> $GITHUB_ENV
391-
- name: Set env vars (all)
392-
shell: bash
393-
run: echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ env.VCPKG_TRIPLET }}_response_file.txt" >> $GITHUB_ENV
394383
- name: Add msbuild to PATH (Windows)
395384
if: startsWith(matrix.os, 'windows')
396385
uses: microsoft/[email protected]
@@ -495,11 +484,6 @@ jobs:
495484
with:
496485
ref: ${{needs.prepare_matrix.outputs.github_ref}}
497486
submodules: true
498-
- name: Set env vars (macOS)
499-
run: echo "VCPKG_TRIPLET=x64-osx" >> $GITHUB_ENV
500-
- name: Set env vars (all)
501-
shell: bash
502-
run: echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ env.VCPKG_TRIPLET }}_response_file.txt" >> $GITHUB_ENV
503487
- name: Setup python
504488
uses: actions/setup-python@v2
505489
with:
@@ -581,6 +565,98 @@ jobs:
581565
exit 1
582566
fi
583567
568+
build_tvos:
569+
name: build-tvos-macos-latest
570+
needs: [check_trigger, prepare_matrix]
571+
runs-on: macos-latest
572+
if: contains(needs.prepare_matrix.outputs.matrix_platform, 'tvOS') && contains(needs.prepare_matrix.outputs.matrix_os, 'macos-latest') && needs.prepare_matrix.outputs.apis != '' && !cancelled() && !failure()
573+
strategy:
574+
fail-fast: false
575+
steps:
576+
- uses: actions/checkout@v2
577+
with:
578+
ref: ${{needs.prepare_matrix.outputs.github_ref}}
579+
submodules: true
580+
- name: Setup python
581+
uses: actions/setup-python@v2
582+
with:
583+
python-version: ${{ env.pythonVersion }}
584+
- name: Update homebrew (avoid bintray errors)
585+
run: |
586+
# Temporarily here until Github runners have updated their version of
587+
# homebrew. This prevents errors arising from the shut down of
588+
# binutils, used by older version of homebrew for hosting packages.
589+
brew update
590+
- name: Install SDK tvOS prerequisites
591+
run: build_scripts/tvos/install_prereqs.sh
592+
- name: Prepare for integration tests
593+
run: |
594+
pip install -r scripts/gha/requirements.txt
595+
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
596+
- name: Fetch prebuilt packaged SDK from previous run
597+
uses: dawidd6/action-download-artifact@v2
598+
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
599+
with:
600+
name: 'firebase_cpp_sdk.zip'
601+
workflow: 'cpp-packaging.yml'
602+
run_id: ${{ github.event.inputs.test_packaged_sdk }}
603+
- name: Build integration tests
604+
shell: bash
605+
run: |
606+
declare -a additional_flags
607+
if [[ -n "${{ github.event.inputs.test_packaged_sdk }}" ]]; then
608+
# Building integration tests against a packaged SDK.
609+
mkdir downloaded_sdk
610+
cd downloaded_sdk
611+
unzip -q ../firebase_cpp_sdk.zip
612+
cd ..
613+
additional_flags+=(--packaged_sdk downloaded_sdk/firebase_cpp_sdk)
614+
fi
615+
python scripts/gha/build_testapps.py --p tvOS \
616+
--t ${{ needs.prepare_matrix.outputs.apis }} \
617+
--output_directory "${{ github.workspace }}" \
618+
--artifact_name "tvos-macos-latest" \
619+
--noadd_timestamp \
620+
--short_output_paths \
621+
${additional_flags[*]}
622+
- name: Upload tvOS integration tests artifact
623+
uses: actions/[email protected]
624+
if: ${{ !cancelled() }}
625+
with:
626+
name: testapps-tvos-macos-latest
627+
path: testapps-tvos-macos-latest
628+
retention-days: ${{ env.artifactRetentionDays }}
629+
- name: Upload tvOS build results artifact
630+
uses: actions/[email protected]
631+
if: ${{ !cancelled() }}
632+
with:
633+
name: log-artifact
634+
path: build-results-tvos-macos-latest*
635+
retention-days: ${{ env.artifactRetentionDays }}
636+
- name: Download log artifacts
637+
if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }}
638+
uses: actions/[email protected]
639+
with:
640+
path: test_results
641+
name: log-artifact
642+
- name: Update PR label and comment
643+
if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }}
644+
run: |
645+
python scripts/gha/it_workflow.py --stage progress \
646+
--token ${{github.token}} \
647+
--issue_number ${{needs.check_trigger.outputs.pr_number}}\
648+
--actor ${{github.actor}} \
649+
--commit ${{needs.prepare_matrix.outputs.github_ref}} \
650+
--run_id ${{github.run_id}}
651+
- name: Summarize build results
652+
if: ${{ !cancelled() }}
653+
shell: bash
654+
run: |
655+
cat build-results-tvos-macos-latest.log
656+
if [[ "${{ job.status }}" != "success" ]]; then
657+
exit 1
658+
fi
659+
584660
test_desktop:
585661
name: test-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}
586662
needs: [check_trigger, prepare_matrix, build_desktop]
@@ -796,9 +872,70 @@ jobs:
796872
exit 1
797873
fi
798874
875+
test_tvos:
876+
name: test-tvos-macos-latest-${{ matrix.tvos_device }}
877+
needs: [check_trigger, prepare_matrix, build_tvos]
878+
runs-on: macos-latest
879+
if: contains(needs.prepare_matrix.outputs.matrix_platform, 'tvOS') && needs.prepare_matrix.outputs.apis != '' && !cancelled()
880+
strategy:
881+
fail-fast: false
882+
matrix:
883+
tvos_device: ${{ fromJson(needs.prepare_matrix.outputs.tvos_device) }}
884+
steps:
885+
- uses: actions/checkout@v2
886+
with:
887+
ref: ${{needs.prepare_matrix.outputs.github_ref}}
888+
- name: Download tvOS integration tests artifact
889+
uses: actions/[email protected]
890+
with:
891+
path: testapps
892+
name: testapps-tvos-macos-latest
893+
- name: Setup python
894+
uses: actions/setup-python@v2
895+
with:
896+
python-version: ${{ env.pythonVersion }}
897+
- name: Install python deps
898+
run: pip install -r scripts/gha/requirements.txt
899+
- name: Run tvOS integration tests on Simulator locally
900+
run: |
901+
python scripts/gha/test_simulator.py --testapp_dir testapps \
902+
--tvos_device "${{ matrix.tvos_device }}" \
903+
--logfile_name "tvos-macos-latest-${{ matrix.tvos_device }}" \
904+
--ci
905+
- name: Upload tvOS test results artifact
906+
if: ${{ !cancelled() }}
907+
uses: actions/[email protected]
908+
with:
909+
name: log-artifact
910+
path: testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}*
911+
retention-days: ${{ env.artifactRetentionDays }}
912+
- name: Download log artifacts
913+
if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }}
914+
uses: actions/[email protected]
915+
with:
916+
path: test_results
917+
name: log-artifact
918+
- name: Update PR label and comment
919+
if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }}
920+
run: |
921+
python scripts/gha/it_workflow.py --stage progress \
922+
--token ${{github.token}} \
923+
--issue_number ${{needs.check_trigger.outputs.pr_number}}\
924+
--actor ${{github.actor}} \
925+
--commit ${{needs.prepare_matrix.outputs.github_ref}} \
926+
--run_id ${{github.run_id}}
927+
- name: Summarize test results
928+
if: ${{ !cancelled() }}
929+
shell: bash
930+
run: |
931+
cat "testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}.log"
932+
if [[ "${{ job.status }}" != "success" ]]; then
933+
exit 1
934+
fi
935+
799936
summarize_results:
800937
name: "summarize-results"
801-
needs: [check_trigger, prepare_matrix, test_desktop, test_android, test_ios]
938+
needs: [check_trigger, prepare_matrix, test_desktop, test_android, test_ios, test_tvos]
802939
runs-on: ubuntu-latest
803940
if: ${{ !cancelled() }}
804941
steps:

auth/integration_test/integration_test.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@
570570
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
571571
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
572572
MTL_FAST_MATH = YES;
573-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.ios.remoteconfig.testapp.integration-test-tvos";
573+
PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseCppAuthTestApp.dev;
574574
PRODUCT_NAME = "$(TARGET_NAME)";
575575
SDKROOT = appletvos;
576576
TARGETED_DEVICE_FAMILY = 3;
@@ -619,7 +619,7 @@
619619
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
620620
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
621621
MTL_FAST_MATH = YES;
622-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.ios.remoteconfig.testapp.integration-test-tvos";
622+
PRODUCT_BUNDLE_IDENTIFIER = com.google.FirebaseCppAuthTestApp.dev;
623623
PRODUCT_NAME = "$(TARGET_NAME)";
624624
SDKROOT = appletvos;
625625
TARGETED_DEVICE_FAMILY = 3;

database/integration_test/integration_test.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@
413413
"\"$(SRCROOT)/external/googletest/src/googlemock\"",
414414
);
415415
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
416+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.database.testapp;
416417
PRODUCT_NAME = "$(TARGET_NAME)";
417418
PROVISIONING_PROFILE_SPECIFIER = "";
418419
WRAPPER_EXTENSION = app;
@@ -441,6 +442,7 @@
441442
"\"$(SRCROOT)/external/googletest/src/googlemock\"",
442443
);
443444
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
445+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.database.testapp;
444446
PRODUCT_NAME = "$(TARGET_NAME)";
445447
PROVISIONING_PROFILE_SPECIFIER = "";
446448
WRAPPER_EXTENSION = app;
@@ -490,7 +492,7 @@
490492
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
491493
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
492494
MTL_FAST_MATH = YES;
493-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.ios.database.testapp.integration-test-tvos";
495+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.database.testapp;
494496
PRODUCT_NAME = "$(TARGET_NAME)";
495497
SDKROOT = appletvos;
496498
TARGETED_DEVICE_FAMILY = 3;
@@ -539,7 +541,7 @@
539541
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
540542
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
541543
MTL_FAST_MATH = YES;
542-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.ios.database.testapp.integration-test-tvos";
544+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.database.testapp;
543545
PRODUCT_NAME = "$(TARGET_NAME)";
544546
SDKROOT = appletvos;
545547
TARGETED_DEVICE_FAMILY = 3;

firestore/integration_test/integration_test.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@
590590
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
591591
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
592592
MTL_FAST_MATH = YES;
593-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.firestore.testapp.integration-test-tvos";
593+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.firestore.testapp;
594594
PRODUCT_NAME = "$(TARGET_NAME)";
595595
PROVISIONING_PROFILE_SPECIFIER = "";
596596
SDKROOT = appletvos;
@@ -642,7 +642,7 @@
642642
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
643643
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
644644
MTL_FAST_MATH = YES;
645-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.firestore.testapp.integration-test-tvos";
645+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.firestore.testapp;
646646
PRODUCT_NAME = "$(TARGET_NAME)";
647647
PROVISIONING_PROFILE_SPECIFIER = "";
648648
SDKROOT = appletvos;

firestore/integration_test_internal/integration_test.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@
835835
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
836836
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
837837
MTL_FAST_MATH = YES;
838-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.firestore.testapp.integration-test-tvos";
838+
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.firestore.testapp";
839839
PRODUCT_NAME = "$(TARGET_NAME)";
840840
PROVISIONING_PROFILE_SPECIFIER = "";
841841
SDKROOT = appletvos;
@@ -899,7 +899,7 @@
899899
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
900900
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
901901
MTL_FAST_MATH = YES;
902-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.firestore.testapp.integration-test-tvos";
902+
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.firestore.testapp";
903903
PRODUCT_NAME = "$(TARGET_NAME)";
904904
PROVISIONING_PROFILE_SPECIFIER = "";
905905
SDKROOT = appletvos;

functions/integration_test/integration_test.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@
493493
"\"$(SRCROOT)/external/googletest/src/googlemock\"",
494494
);
495495
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
496+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.functions.testapp;
496497
PRODUCT_NAME = "$(TARGET_NAME)";
497498
PROVISIONING_PROFILE_SPECIFIER = "";
498499
WRAPPER_EXTENSION = app;
@@ -522,6 +523,7 @@
522523
"\"$(SRCROOT)/external/googletest/src/googlemock\"",
523524
);
524525
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
526+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.functions.testapp;
525527
PRODUCT_NAME = "$(TARGET_NAME)";
526528
PROVISIONING_PROFILE_SPECIFIER = "";
527529
WRAPPER_EXTENSION = app;
@@ -574,7 +576,7 @@
574576
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
575577
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
576578
MTL_FAST_MATH = YES;
577-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.functions.testapp.integration-test-tvos";
579+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.functions.testapp;
578580
PRODUCT_NAME = "$(TARGET_NAME)";
579581
PROVISIONING_PROFILE_SPECIFIER = "";
580582
SDKROOT = appletvos;
@@ -627,7 +629,7 @@
627629
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
628630
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
629631
MTL_FAST_MATH = YES;
630-
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.cpp.functions.testapp.integration-test-tvos";
632+
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.cpp.functions.testapp;
631633
PRODUCT_NAME = "$(TARGET_NAME)";
632634
PROVISIONING_PROFILE_SPECIFIER = "";
633635
SDKROOT = appletvos;

0 commit comments

Comments
 (0)