Skip to content

Commit 4c19a13

Browse files
authored
Make FIAM tests more robust in Travis (#3952)
1 parent 62c4fa3 commit 4c19a13

File tree

4 files changed

+42
-55
lines changed

4 files changed

+42
-55
lines changed

.travis.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,31 @@ jobs:
256256
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseFunctions.podspec --use-modular-headers
257257

258258
- stage: test
259-
osx_image: xcode10.3
260259
env:
261260
- PROJECT=InAppMessaging PLATFORM=iOS METHOD=xcodebuild
262261
before_install:
263262
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
264263
script:
265264
- travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
266265

266+
- stage: test
267+
osx_image: xcode10.3
268+
env:
269+
- PROJECT=InAppMessagingDisplay PLATFORM=iOS METHOD=xcodebuild
270+
before_install:
271+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
272+
script:
273+
- travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
274+
275+
- stage: test
276+
osx_image: xcode10.3
277+
env:
278+
- PROJECT=InAppMessagingDisplay PLATFORM=iPad METHOD=xcodebuild
279+
before_install:
280+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
281+
script:
282+
- travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
283+
267284
- stage: test
268285
# TODO(paulb777,wilhuff) Replace with a solution that doesn't include multiple platforms in
269286
# a single Podfile.
@@ -547,8 +564,6 @@ jobs:
547564
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=tsan
548565
- env:
549566
- PROJECT=GoogleDataTransportIntegrationTest PLATFORM=iOS METHOD=xcodebuild
550-
- env:
551-
- PROJECT=InAppMessaging PLATFORM=iOS METHOD=xcodebuild
552567

553568
# TODO(varconst): enable if it's possible to make this flag work on build
554569
# stages. It's supposed to avoid waiting for jobs that are allowed to fail

scripts/build.sh

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ product can be one of:
3333
Firebase
3434
Firestore
3535
InAppMessaging
36+
InAppMessagingDisplay
3637
SymbolCollision
3738
3839
platform can be one of:
@@ -94,7 +95,7 @@ function RunXcodebuild() {
9495
# Remove each product when it moves up to Xcode 11
9596
if [[ $product == 'Firestore' || # #3949
9697
$product == 'GoogleDataTransport' || # #3947
97-
$product == 'InAppMessaging' # #3948
98+
$product == 'InAppMessagingDisplay' # #3948
9899
]]; then
99100
ios_flags=(
100101
-sdk 'iphonesimulator'
@@ -107,6 +108,11 @@ else
107108
)
108109
fi
109110

111+
ipad_flags=(
112+
-sdk 'iphonesimulator'
113+
-destination 'platform=iOS Simulator,name=iPad Pro (9.7-inch)'
114+
)
115+
110116
macos_flags=(
111117
-sdk 'macosx'
112118
-destination 'platform=OS X,arch=x86_64'
@@ -122,6 +128,10 @@ case "$platform" in
122128
xcb_flags=("${ios_flags[@]}")
123129
;;
124130

131+
iPad)
132+
xcb_flags=("${ipad_flags[@]}")
133+
;;
134+
125135
macOS)
126136
xcb_flags=("${macos_flags[@]}")
127137
;;
@@ -230,60 +240,20 @@ case "$product-$method-$platform" in
230240

231241
InAppMessaging-xcodebuild-iOS)
232242
RunXcodebuild \
233-
-workspace 'InAppMessaging/Example/InAppMessaging-Example-iOS.xcworkspace' \
243+
-workspace 'InAppMessaging/Example/InAppMessaging-Example-iOS.xcworkspace' \
234244
-scheme 'InAppMessaging_Example_iOS' \
235245
"${xcb_flags[@]}" \
236246
build \
237247
test
248+
;;
238249

239-
cd InAppMessaging/Example
240-
sed -i -e 's/use_frameworks/\#use_frameworks/' Podfile
241-
pod update --no-repo-update
242-
cd ../..
250+
InAppMessagingDisplay-xcodebuild-*)
243251
RunXcodebuild \
244-
-workspace 'InAppMessaging/Example/InAppMessaging-Example-iOS.xcworkspace' \
245-
-scheme 'InAppMessaging_Example_iOS' \
246-
"${xcb_flags[@]}" \
247-
build \
248-
test
249-
250-
# Run UI tests on both iPad and iPhone simulators
251-
# TODO: Running two destinations from one xcodebuild command stopped working with Xcode 10.
252-
# Consider separating static library tests to a separate job.
253-
RunXcodebuild \
254-
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
252+
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
255253
-scheme 'FiamDisplaySwiftExample' \
256254
"${xcb_flags[@]}" \
257255
build \
258256
test
259-
260-
RunXcodebuild \
261-
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
262-
-scheme 'FiamDisplaySwiftExample' \
263-
-sdk 'iphonesimulator' \
264-
-destination 'platform=iOS Simulator,name=iPad Pro (9.7-inch)' \
265-
build \
266-
test
267-
268-
cd InAppMessagingDisplay/Example
269-
sed -i -e 's/use_frameworks/\#use_frameworks/' Podfile
270-
pod update --no-repo-update
271-
cd ../..
272-
# Run UI tests on both iPad and iPhone simulators
273-
RunXcodebuild \
274-
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
275-
-scheme 'FiamDisplaySwiftExample' \
276-
"${xcb_flags[@]}" \
277-
build \
278-
test
279-
280-
RunXcodebuild \
281-
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
282-
-scheme 'FiamDisplaySwiftExample' \
283-
-sdk 'iphonesimulator' \
284-
-destination 'platform=iOS Simulator,name=iPad Pro (9.7-inch)' \
285-
build \
286-
test
287257
;;
288258

289259
Firestore-xcodebuild-*)

scripts/if_changed.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ else
100100
;;
101101

102102
InAppMessaging-*)
103+
check_changes '^(InAppMessaging|Firebase/InAppMessaging)'
104+
;;
105+
106+
InAppMessagingDisplay-*)
103107
check_changes '^(Firebase/InAppMessagingDisplay|InAppMessagingDisplay|InAppMessaging|'\
104108
'Firebase/InAppMessaging)'
105109
;;

scripts/install_prereqs.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ case "$PROJECT-$PLATFORM-$METHOD" in
5858
install_secrets
5959
;;
6060

61-
Firebase-*-xcodebuild)
62-
gem install xcpretty
63-
bundle exec pod install --project-directory=Example --repo-update
64-
bundle exec pod install --project-directory=GoogleUtilities/Example
65-
;;
66-
6761
Auth-*)
6862
# Install the workspace for integration testing.
6963
gem install xcpretty
@@ -90,10 +84,14 @@ case "$PROJECT-$PLATFORM-$METHOD" in
9084

9185
InAppMessaging-iOS-xcodebuild)
9286
gem install xcpretty
93-
bundle exec pod install --project-directory=InAppMessagingDisplay/Example --repo-update
9487
bundle exec pod install --project-directory=InAppMessaging/Example --repo-update
9588
;;
9689

90+
InAppMessagingDisplay-*-xcodebuild)
91+
gem install xcpretty
92+
bundle exec pod install --project-directory=InAppMessagingDisplay/Example --repo-update
93+
;;
94+
9795
Firestore-*-xcodebuild | Firestore-*-fuzz)
9896
if [[ $XCODE_VERSION == "8."* ]]; then
9997
# Firestore still compiles with Xcode 8 to help verify general

0 commit comments

Comments
 (0)