Skip to content

Commit 69fad8d

Browse files
authored
Migrate auth api tests to a dedicated firebase project (#3318)
1 parent c7f1145 commit 69fad8d

File tree

10 files changed

+27
-133
lines changed

10 files changed

+27
-133
lines changed

Example/Auth/ApiTests/AccountInfoTests.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
#import "FIRAuthApiTestsBase.h"
2020

2121
/** The testing email address for testCreateAccountWithEmailAndPassword. */
22-
static NSString *const kOldUserEmail = @"olduseremail@iosapitests.com";
22+
static NSString *const kOldUserEmail = @"iosgcip+user_old_email@gmail.com";
2323

2424
/** The testing email address for testUpdatingUsersEmail. */
25-
static NSString *const kNewUserEmail = @"newuseremail@iosapitests.com";
25+
static NSString *const kNewUserEmail = @"iosgcip+user_new_email@gmail.com";
2626

2727
@interface AccountInfoTests : FIRAuthApiTestsBase
2828

2929
@end
3030

3131
@implementation AccountInfoTests
3232

33-
- (void)DISABLED_testUpdatingUsersEmail {
33+
- (void)testUpdatingUsersEmail {
3434
SKIP_IF_ON_MOBILE_HARNESS
3535
FIRAuth *auth = [FIRAuth auth];
3636
if (!auth) {

Example/Auth/ApiTests/Auth_ApiTests-Bridging-Header.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

Example/Auth/ApiTests/CustomAuthTests.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ @interface CustomAuthTests : FIRAuthApiTestsBase
4141

4242
@implementation CustomAuthTests
4343

44-
- (void)testSignInWithValidCustomAuthToken {
44+
- (void)DISABLE_testSignInWithValidCustomAuthToken {
4545
FIRAuth *auth = [FIRAuth auth];
4646
if (!auth) {
4747
XCTFail(@"Could not obtain auth object.");
@@ -78,7 +78,7 @@ - (void)testSignInWithValidCustomAuthToken {
7878
XCTAssertEqualObjects(auth.currentUser.uid, kCustomAuthTestingAccountUserID);
7979
}
8080

81-
- (void)testSignInWithValidCustomAuthExpiredToken {
81+
- (void)DISABLE_testSignInWithValidCustomAuthExpiredToken {
8282
FIRAuth *auth = [FIRAuth auth];
8383
if (!auth) {
8484
XCTFail(@"Could not obtain auth object.");
@@ -116,7 +116,7 @@ - (void)testSignInWithValidCustomAuthExpiredToken {
116116
XCTAssertEqual(apiError.code, FIRAuthErrorCodeInvalidCustomToken);
117117
}
118118

119-
- (void)testSignInWithInvalidCustomAuthToken {
119+
- (void)DISABLE_testSignInWithInvalidCustomAuthToken {
120120
FIRAuth *auth = [FIRAuth auth];
121121
if (!auth) {
122122
XCTFail(@"Could not obtain auth object.");
@@ -139,7 +139,7 @@ - (void)testSignInWithInvalidCustomAuthToken {
139139
}];
140140
}
141141

142-
- (void)testInMemoryUserAfterSignOut {
142+
- (void)DISABLE_testInMemoryUserAfterSignOut {
143143
FIRAuth *auth = [FIRAuth auth];
144144
if (!auth) {
145145
XCTFail(@"Could not obtain auth object.");

Example/Auth/ApiTests/EmailPasswordAuthTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#import "FIRAuthApiTestsBase.h"
2020

2121
/** The testing email address for testCreateAccountWithEmailAndPassword. */
22-
static NSString *const kNewEmailToCreateUser = @"new_user@iosapitests.com";
22+
static NSString *const kNewEmailToCreateUser = @"iosgcip+email_new_user@gmail.com";
2323

2424
/** The testing email address for testSignInExistingUserWithEmailAndPassword. */
25-
static NSString *const kExistingEmailToSignIn = @"existing_user@iosapitests.com";
25+
static NSString *const kExistingEmailToSignIn = @"iosgcip+email_existing_user@gmail.com";
2626

2727
/** The testing password for testSignInExistingUserWithEmailAndPassword. */
2828
static NSString *const kExistingPasswordToSignIn = @"password";

Example/Auth/ApiTests/GoogleAuthTests.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ - (void)testSignInWithGoogle {
6464
}
6565
}];
6666
XCTAssertEqualObjects(auth.currentUser.displayName, kGoogleTestAccountName);
67-
68-
// Clean up the created Firebase/Facebook user for future runs.
69-
[self deleteCurrentUser];
7067
}
7168

7269
/** Sends http request to Google OAuth2 token server to use refresh token to exchange for Google

Example/Auth/ApiTests/GoogleAuthTests.swift

Lines changed: 0 additions & 91 deletions
This file was deleted.

Example/Firebase.xcodeproj/project.pbxproj

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,14 @@
107107
405EEF4C2216518B00B08FF4 /* FIRAuthLifeCycleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 405EEF4B2216518A00B08FF4 /* FIRAuthLifeCycleTests.m */; };
108108
405EEF4D2216518B00B08FF4 /* FIRAuthLifeCycleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 405EEF4B2216518A00B08FF4 /* FIRAuthLifeCycleTests.m */; };
109109
405EEF4E2216518B00B08FF4 /* FIRAuthLifeCycleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 405EEF4B2216518A00B08FF4 /* FIRAuthLifeCycleTests.m */; };
110+
4061967622B9B1960016A40F /* GoogleAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4061967522B9B1960016A40F /* GoogleAuthTests.m */; };
110111
408870AB21AE0218008AAE73 /* FIRSignInWithGameCenterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 408870AA21AE0218008AAE73 /* FIRSignInWithGameCenterTests.m */; };
111112
4090ADFD2217948D00547281 /* FIRAuthE2eTestsBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4090ADFC2217948D00547281 /* FIRAuthE2eTestsBase.m */; };
112113
4090ADFF2217978300547281 /* BYOAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4090ADFE2217978300547281 /* BYOAuthTests.m */; };
113114
409E1130219FA260000E6CFC /* VerifyIOSClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 409E112F219FA260000E6CFC /* VerifyIOSClientTests.m */; };
114115
40CC550D221B9B4700032423 /* FIRAuthApiTestsBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC5504221B9B4600032423 /* FIRAuthApiTestsBase.m */; };
115-
40CC550E221B9B4700032423 /* GoogleAuthTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40CC5505221B9B4700032423 /* GoogleAuthTests.swift */; };
116116
40CC550F221B9B4700032423 /* AccountInfoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC5506221B9B4700032423 /* AccountInfoTests.m */; };
117117
40CC5510221B9B4700032423 /* CustomAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC5508221B9B4700032423 /* CustomAuthTests.m */; };
118-
40CC5511221B9B4700032423 /* GoogleAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC5509221B9B4700032423 /* GoogleAuthTests.m */; };
119118
40CC5512221B9B4700032423 /* AnonymousAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC550A221B9B4700032423 /* AnonymousAuthTests.m */; };
120119
40CC5513221B9B4700032423 /* FacebookAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40CC550B221B9B4700032423 /* FacebookAuthTests.m */; };
121120
40EE3B822256B23200BE59CE /* MainViewController+GameCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 40EE3B812256B23200BE59CE /* MainViewController+GameCenter.m */; };
@@ -1071,17 +1070,15 @@
10711070
0697B1201EC13D8A00542174 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
10721071
0697B1211EC13D8A00542174 /* Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Base64.m; sourceTree = "<group>"; };
10731072
405EEF4B2216518A00B08FF4 /* FIRAuthLifeCycleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRAuthLifeCycleTests.m; sourceTree = "<group>"; };
1073+
4061967522B9B1960016A40F /* GoogleAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoogleAuthTests.m; sourceTree = "<group>"; };
10741074
408870AA21AE0218008AAE73 /* FIRSignInWithGameCenterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRSignInWithGameCenterTests.m; sourceTree = "<group>"; };
10751075
4090ADFB2217948D00547281 /* FIRAuthE2eTestsBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FIRAuthE2eTestsBase.h; sourceTree = "<group>"; };
10761076
4090ADFC2217948D00547281 /* FIRAuthE2eTestsBase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FIRAuthE2eTestsBase.m; sourceTree = "<group>"; };
10771077
4090ADFE2217978300547281 /* BYOAuthTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BYOAuthTests.m; sourceTree = "<group>"; };
10781078
409E112F219FA260000E6CFC /* VerifyIOSClientTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VerifyIOSClientTests.m; sourceTree = "<group>"; };
10791079
40CC5504221B9B4600032423 /* FIRAuthApiTestsBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRAuthApiTestsBase.m; sourceTree = "<group>"; };
1080-
40CC5505221B9B4700032423 /* GoogleAuthTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GoogleAuthTests.swift; sourceTree = "<group>"; };
10811080
40CC5506221B9B4700032423 /* AccountInfoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccountInfoTests.m; sourceTree = "<group>"; };
1082-
40CC5507221B9B4700032423 /* Auth_ApiTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Auth_ApiTests-Bridging-Header.h"; sourceTree = "<group>"; };
10831081
40CC5508221B9B4700032423 /* CustomAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomAuthTests.m; sourceTree = "<group>"; };
1084-
40CC5509221B9B4700032423 /* GoogleAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoogleAuthTests.m; sourceTree = "<group>"; };
10851082
40CC550A221B9B4700032423 /* AnonymousAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnonymousAuthTests.m; sourceTree = "<group>"; };
10861083
40CC550B221B9B4700032423 /* FacebookAuthTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FacebookAuthTests.m; sourceTree = "<group>"; };
10871084
40CC550C221B9B4700032423 /* FIRAuthApiTestsBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRAuthApiTestsBase.h; sourceTree = "<group>"; };
@@ -2257,16 +2254,14 @@
22572254
children = (
22582255
40CC5506221B9B4700032423 /* AccountInfoTests.m */,
22592256
40CC550A221B9B4700032423 /* AnonymousAuthTests.m */,
2260-
40CC5507221B9B4700032423 /* Auth_ApiTests-Bridging-Header.h */,
22612257
DE26D1C71F70330A004AE1D3 /* AuthCredentials.h */,
22622258
DE26D1C81F70330A004AE1D3 /* AuthCredentialsTemplate.h */,
22632259
40CC5508221B9B4700032423 /* CustomAuthTests.m */,
22642260
DE26D1C91F70330A004AE1D3 /* EmailPasswordAuthTests.m */,
22652261
40CC550B221B9B4700032423 /* FacebookAuthTests.m */,
22662262
40CC550C221B9B4700032423 /* FIRAuthApiTestsBase.h */,
22672263
40CC5504221B9B4600032423 /* FIRAuthApiTestsBase.m */,
2268-
40CC5509221B9B4700032423 /* GoogleAuthTests.m */,
2269-
40CC5505221B9B4700032423 /* GoogleAuthTests.swift */,
2264+
4061967522B9B1960016A40F /* GoogleAuthTests.m */,
22702265
DE26D1CA1F70330A004AE1D3 /* Info.plist */,
22712266
);
22722267
path = ApiTests;
@@ -4835,13 +4830,12 @@
48354830
isa = PBXSourcesBuildPhase;
48364831
buildActionMask = 2147483647;
48374832
files = (
4838-
40CC550E221B9B4700032423 /* GoogleAuthTests.swift in Sources */,
48394833
40CC5512221B9B4700032423 /* AnonymousAuthTests.m in Sources */,
48404834
40CC550F221B9B4700032423 /* AccountInfoTests.m in Sources */,
48414835
40CC5510221B9B4700032423 /* CustomAuthTests.m in Sources */,
48424836
DE26D2681F704A0C004AE1D3 /* EmailPasswordAuthTests.m in Sources */,
48434837
40CC5513221B9B4700032423 /* FacebookAuthTests.m in Sources */,
4844-
40CC5511221B9B4700032423 /* GoogleAuthTests.m in Sources */,
4838+
4061967622B9B1960016A40F /* GoogleAuthTests.m in Sources */,
48454839
40CC550D221B9B4700032423 /* FIRAuthApiTestsBase.m in Sources */,
48464840
);
48474841
runOnlyForDeploymentPostprocessing = 0;
@@ -6848,7 +6842,7 @@
68486842
DEBUG_INFORMATION_FORMAT = dwarf;
68496843
DEVELOPMENT_TEAM = 4ANB9W7R3P;
68506844
GCC_C_LANGUAGE_STANDARD = gnu11;
6851-
INFOPLIST_FILE = "$SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist";
6845+
INFOPLIST_FILE = $SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist;
68526846
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
68536847
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
68546848
MTL_ENABLE_DEBUG_INFO = YES;
@@ -6882,7 +6876,7 @@
68826876
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
68836877
DEVELOPMENT_TEAM = 4ANB9W7R3P;
68846878
GCC_C_LANGUAGE_STANDARD = gnu11;
6885-
INFOPLIST_FILE = "$SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist";
6879+
INFOPLIST_FILE = $SRCROOT/DynamicLinks/FDLBuilderTestAppObjC/Info.plist;
68866880
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
68876881
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
68886882
MTL_ENABLE_DEBUG_INFO = NO;

scripts/build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,17 @@ case "$product-$method-$platform" in
202202
# Code Coverage collection is only working on iOS currently.
203203
./scripts/collect_metrics.sh 'Example/Firebase.xcworkspace' "AllUnitTests_$platform"
204204

205+
# Run integration tests (not allowed on forks)
206+
if [[ "$TRAVIS_PULL_REQUEST" == "false" ||
207+
"$TRAVIS_PULL_REQUEST_SLUG" == "$TRAVIS_REPO_SLUG" ]]; then
208+
RunXcodebuild \
209+
-workspace 'Example/Firebase.xcworkspace' \
210+
-scheme "Auth_ApiTests" \
211+
"${xcb_flags[@]}" \
212+
build \
213+
test
214+
fi
215+
205216
# Test iOS Objective-C static library build
206217
cd Example
207218
sed -i -e 's/use_frameworks/\#use_frameworks/' Podfile

scripts/install_prereqs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function install_secrets() {
2626
# requests from forks. See
2727
# https://docs.travis-ci.com/user/pull-requests#pull-requests-and-security-restrictions
2828
if [[ ! -z $encrypted_d6a88994a5ab_key ]]; then
29-
openssl aes-256-cbc -K $encrypted_44810a80e6cc_key -iv $encrypted_44810a80e6cc_iv \
29+
openssl aes-256-cbc -K $encrypted_b02643c8c602_key -iv $encrypted_b02643c8c602_iv \
3030
-in scripts/travis-encrypted/Secrets.tar.enc \
3131
-out scripts/travis-encrypted/Secrets.tar -d
3232

-18.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)