Skip to content

Commit 3ab732b

Browse files
authored
Re-enable HTTPSCallableTests (#8265)
* Cache FIRStorage instances by app * changelog * nuts * format * appease the code coverage bot * storage -> functions * style * appease codecov again * Go the component way * doc comments and style * fix copyrights * Fix bad import * nit * make it threadsafe * attempt to fix swift test * fix tests again * debug * Disable Combine tests * allow subclasses in functions component * reenable test * Remove class check * style * Add changelog
1 parent a7cb0e4 commit 3ab732b

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

.github/workflows/functions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
run: scripts/setup_spm_tests.sh
4747
- name: iOS Unit Tests
4848
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctions iOS spmbuildonly
49-
# - name: Combine Unit Tests
50-
# run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsCombineUnit iOS spm
49+
- name: Combine Unit Tests
50+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsCombineUnit iOS spm
5151

5252
spm-cron:
5353
# Don't run on private repo.

Functions/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v8.3.0
2+
- [fixed] Fixed an issue where subclassing Functions was unusable (#8265).
3+
14
# v8.2.0
25
- [fixed] Fixed an issue where factory class methods returned a new instance on every invocation, causing emulator settings to not persist between invocations (#7783).
36

Functions/FirebaseFunctions/FIRFunctions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ + (instancetype)functionsForApp:(FIRApp *)app
103103
region:(NSString *)region
104104
customDomain:(nullable NSString *)customDomain {
105105
id<FIRFunctionsProvider> provider = FIR_COMPONENT(FIRFunctionsProvider, app.container);
106-
return [provider functionsForApp:app region:region customDomain:customDomain];
106+
return [provider functionsForApp:app region:region customDomain:customDomain type:[self class]];
107107
}
108108

109109
- (instancetype)initWithApp:(FIRApp *)app

Functions/FirebaseFunctions/FIRFunctionsComponent.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
2424

2525
- (FIRFunctions *)functionsForApp:(FIRApp *)app
2626
region:(nullable NSString *)region
27-
customDomain:(nullable NSString *)customDomain;
27+
customDomain:(nullable NSString *)customDomain
28+
type:(Class)cls;
2829

2930
@end
3031

Functions/FirebaseFunctions/FIRFunctionsComponent.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ - (void)appWillBeDeleted:(FIRApp *)app {
9292

9393
- (FIRFunctions *)functionsForApp:(FIRApp *)app
9494
region:(NSString *)region
95-
customDomain:(NSString *_Nullable)customDomain {
95+
customDomain:(NSString *_Nullable)customDomain
96+
type:(Class)cls {
9697
os_unfair_lock_lock(&_instancesLock);
9798
NSArray<FIRFunctions *> *associatedInstances = [self instances][app.name];
9899
if (associatedInstances.count > 0) {
@@ -111,9 +112,7 @@ - (FIRFunctions *)functionsForApp:(FIRApp *)app
111112
}
112113
}
113114

114-
FIRFunctions *newInstance = [[FIRFunctions alloc] initWithApp:app
115-
region:region
116-
customDomain:customDomain];
115+
FIRFunctions *newInstance = [[cls alloc] initWithApp:app region:region customDomain:customDomain];
117116

118117
if (self.instances[app.name] == nil) {
119118
NSMutableArray *array = [NSMutableArray arrayWithObject:newInstance];

0 commit comments

Comments
 (0)