Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Jun 3, 2019
1 parent e6f15ca commit 83b907d
Show file tree
Hide file tree
Showing 8 changed files with 586 additions and 25 deletions.
18 changes: 14 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ jobs:

- stage: test
env:
- PROJECT=Auth PLATFORM=iOS METHOD=pod-lib-lint
- PROJECT=Auth PLATFORM=iOS METHOD=xcodebuild
before_install:
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
script:
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseAuth.podspec
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseAuth.podspec --use-libraries
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseAuth.podspec --use-modular-headers
- travis_retry ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM

- stage: test
env:
Expand Down Expand Up @@ -164,16 +163,27 @@ jobs:

# pod lib lint to check build and warnings for static library build - only on cron jobs
- stage: test
if: type = cron
# Restore before merge
#if: type = cron
env:
- PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
before_install:
- ./scripts/install_prereqs.sh
script:
# TODO investigate why macos tests hang for FirebaseAuth - keychain related?
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseAuth.podspec --use-libraries --platforms=ios,tvos
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseAuth.podspec --use-modular-headers --platforms=ios,tvos
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseAuth.podspec --use-libraries --platforms=macos --skip-tests
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseAuth.podspec --use-modular-headers --platforms=macos --skip-tests

- travis_retry ./scripts/pod_lib_lint.rb FirebaseAnalyticsInterop.podspec --use-libraries
- travis_retry ./scripts/pod_lib_lint.rb FirebaseAnalyticsInterop.podspec --use-modular-headers
- travis_retry ./scripts/pod_lib_lint.rb FirebaseAuthInterop.podspec --use-libraries
- travis_retry ./scripts/pod_lib_lint.rb FirebaseAuthInterop.podspec --use-modular-headers
- travis_retry ./scripts/pod_lib_lint.rb FirebaseInAppMessaging.podspec --use-libraries
- travis_retry ./scripts/pod_lib_lint.rb FirebaseInAppMessaging.podspec --use-libraries - use-modular-headers
- travis_retry ./scripts/pod_lib_lint.rb FirebaseInAppMessagingDisplay.podspec --use-libraries
- travis_retry ./scripts/pod_lib_lint.rb FirebaseInAppMessagingDisplay.podspec --use-modular-headers
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstanceID.podspec --use-libraries --platforms=ios
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstanceID.podspec --use-libraries --platforms=tvos
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstanceID.podspec --use-libraries --platforms=macos
Expand Down
314 changes: 303 additions & 11 deletions Example/Auth/AuthSample/AuthSample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800AF322A2F87E00AC9A23"
BuildableName = "AuthSample.app"
BlueprintName = "AuthSample"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800B7022A5927C00AC9A23"
BuildableName = "Auth_ApiTests.xctest"
BlueprintName = "Auth_ApiTests"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800B9422A5BD1800AC9A23"
BuildableName = "Auth_E2eTests.xctest"
BlueprintName = "Auth_E2eTests"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800AF322A2F87E00AC9A23"
BuildableName = "AuthSample.app"
BlueprintName = "AuthSample"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800AF322A2F87E00AC9A23"
BuildableName = "AuthSample.app"
BlueprintName = "AuthSample"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800AF322A2F87E00AC9A23"
BuildableName = "AuthSample.app"
BlueprintName = "AuthSample"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800B7022A5927C00AC9A23"
BuildableName = "Auth_ApiTests.xctest"
BlueprintName = "Auth_ApiTests"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800B9422A5BD1800AC9A23"
BuildableName = "Auth_E2eTests.xctest"
BlueprintName = "Auth_E2eTests"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE800B9422A5BD1800AC9A23"
BuildableName = "Auth_E2eTests.xctest"
BlueprintName = "Auth_E2eTests"
ReferencedContainer = "container:AuthSample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
19 changes: 9 additions & 10 deletions Example/Auth/AuthSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#source 'sso://cpdc-internal/firebase'
#source 'https://github.com/CocoaPods/Specs.git'

# Uncomment the next two lines for pre-release testing on public repo
source 'https://github.com/Firebase/SpecsStaging.git'
source 'https://github.com/CocoaPods/Specs.git'
# Comment the following line to use the CocoaPods master repo instead.
source 'https://cdn.jsdelivr.net/cocoa/'

use_frameworks!

Expand All @@ -19,12 +18,12 @@ target 'AuthSample' do
pod 'GoogleSignIn'
pod 'GTMSessionFetcher/Core'

# target 'Auth_ApiTests' do
# inherit! :search_paths
# end
target 'Auth_ApiTests' do
inherit! :search_paths
end

# target 'Auth_E2eTests' do
# inherit! :search_paths
# pod 'EarlGrey'
# end
target 'Auth_E2eTests' do
inherit! :search_paths
pod 'EarlGrey'
end
end
21 changes: 21 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ case "$product-$method-$platform" in
fi
;;

Auth-xcodebuild-*)
if [[ "$TRAVIS_PULL_REQUEST" == "false" ||
"$TRAVIS_PULL_REQUEST_SLUG" == "$TRAVIS_REPO_SLUG" ]]; then
RunXcodebuild \
-workspace 'Example/Auth/AuthSample/AuthSamplexcworkspace' \
-scheme "Auth_ApiTests" \
"${ios_flags[@]}" \
"${xcb_flags[@]}" \
build \
test

RunXcodebuild \
-workspace 'Example/Auth/AuthSample/AuthSamplexcworkspace' \
-scheme "Auth_E2eTests" \
"${ios_flags[@]}" \
"${xcb_flags[@]}" \
build \
test
fi
;;

InAppMessaging-xcodebuild-iOS)
RunXcodebuild \
-workspace 'InAppMessaging/Example/InAppMessaging-Example-iOS.xcworkspace' \
Expand Down
6 changes: 6 additions & 0 deletions scripts/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ case "$PROJECT-$PLATFORM-$METHOD" in
bundle exec pod install --project-directory=GoogleUtilities/Example
;;

Auth-*)
# Install the workspace for integration testing.
gem install xcpretty
bundle exec pod install --project-directory=Example/Auth/AuthSample --repo-update
;;

Database-*)
# Install the workspace to have better control over test runs than
# pod lib lint, since the integration tests can be flaky.
Expand Down

0 comments on commit 83b907d

Please sign in to comment.