Skip to content

Commit

Permalink
CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Dec 11, 2024
1 parent 438e613 commit b74d065
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#import "FirebaseCore/Extension/FirebaseCoreInternal.h"

@import FirebaseRemoteConfig;

#define ONE_DAY_SECONDS 24 * 60 * 60

static NSDate *FPRAppStartTime = nil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#import <Foundation/Foundation.h>

#import "FirebaseRemoteConfig/Sources/Private/FIRRemoteConfig_Private.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigValue_Internal.h"

@import FirebaseRemoteConfig;

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (void)testCacheResetAfterEverySuccessfulFetch {
forKey:@"fpr_vc_session_sampling_rate"];

// Trigger the RC config fetch
remoteConfig.fetchStatus = FIRRemoteConfigFetchStatusSuccess;
remoteConfig.fetchStatus = FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData;
remoteConfig.lastFetchTime = nil;
configFlags.appStartConfigFetchDelayInSeconds = 0.0;
[configFlags update];
Expand All @@ -92,7 +92,7 @@ - (void)testCacheResetAfterEverySuccessfulFetch {
forKey:@"fpr_vc_session_sampling_rate"];

// Retrigger the RC config fetch
remoteConfig.fetchStatus = FIRRemoteConfigFetchStatusSuccess;
remoteConfig.fetchStatus = FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData;
remoteConfig.lastFetchTime = nil;
[configFlags update];

Expand All @@ -112,7 +112,7 @@ - (void)testConfigUpdate {

FPRRemoteConfigFlags *configFlags =
[[FPRRemoteConfigFlags alloc] initWithRemoteConfig:(FIRRemoteConfig *)remoteConfig];
remoteConfig.fetchStatus = FIRRemoteConfigFetchStatusSuccess;
remoteConfig.fetchStatus = FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData;
configFlags.appStartConfigFetchDelayInSeconds = 0.0;
[configFlags update];
XCTAssertNotNil(configFlags.lastFetchedTime);
Expand Down Expand Up @@ -179,7 +179,7 @@ - (void)testConfigUpdateDoesNotHappenImmediately {
FPRRemoteConfigFlags *configFlags =
[[FPRRemoteConfigFlags alloc] initWithRemoteConfig:(FIRRemoteConfig *)remoteConfig];

remoteConfig.fetchStatus = FIRRemoteConfigFetchStatusSuccess;
remoteConfig.fetchStatus = FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData;
configFlags.appStartConfigFetchDelayInSeconds = 0.0;
[configFlags update];
XCTAssertNotNil(configFlags.lastFetchedTime);
Expand All @@ -203,7 +203,7 @@ - (void)testConfigUpdateHappensIfInitialFetchHasNotHappened {
FPRRemoteConfigFlags *configFlags =
[[FPRRemoteConfigFlags alloc] initWithRemoteConfig:(FIRRemoteConfig *)remoteConfig];

remoteConfig.fetchStatus = FIRRemoteConfigFetchStatusSuccess;
remoteConfig.fetchStatus = FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData;
configFlags.appStartConfigFetchDelayInSeconds = 0.0;
[configFlags update];
XCTAssertNotNil(configFlags.lastFetchedTime);
Expand All @@ -224,7 +224,7 @@ - (void)testConfigFetchHappensDoesNotHappenImmediately {
[[FPRRemoteConfigFlags alloc] initWithRemoteConfig:(FIRRemoteConfig *)remoteConfig];
// Setting the status to success. Calling update on the config flags should trigger updation of
// fetch time. Fetch would trigger activation.
remoteConfig.fetchStatus = FIRRemoteConfigFetchStatusSuccess;
remoteConfig.fetchStatus = FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData;
NSDate *lastActivatedTime = configFlags.lastFetchedTime;
[configFlags update];
XCTAssert([configFlags.lastFetchedTime timeIntervalSinceDate:lastActivatedTime] == 0);
Expand All @@ -240,7 +240,7 @@ - (void)testConfigFetchHappensAfterDelay {
[[FPRRemoteConfigFlags alloc] initWithRemoteConfig:(FIRRemoteConfig *)remoteConfig];
configFlags.appStartConfigFetchDelayInSeconds = 0.0;

remoteConfig.fetchStatus = FIRRemoteConfigFetchStatusSuccess;
remoteConfig.fetchStatus = FIRRemoteConfigFetchAndActivateStatusSuccessUsingPreFetchedData;
XCTestExpectation *expectation =
[self expectationWithDescription:@"Dummy expectation to wait for the fetch delay."];
dispatch_after(
Expand Down
2 changes: 1 addition & 1 deletion FirebasePerformance/Tests/Unit/Timer/FIRTraceTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#import "FirebasePerformance/Tests/Unit/Configurations/FPRFakeRemoteConfig.h"
#import "FirebasePerformance/Tests/Unit/FPRTestCase.h"

#import "FirebaseRemoteConfig/Sources/RCNConfigValue_Internal.h"
@import FirebaseRemoteConfig;

#import <OCMock/OCMock.h>

Expand Down
4 changes: 2 additions & 2 deletions FirebaseRemoteConfig/SwiftNew/RemoteConfigValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public class RemoteConfigValue: NSObject, NSCopying {
/// Data backing the config value.
@objc public let dataValue: Data

/// Identifies the source of the fetched value.
/// Identifies the source of the fetched value. Only for Firebase internal use.
@objc public let source: RemoteConfigSource

/// Designated initializer
/// Designated initializer. Only for Firebase internal use.
@objc public init(data: Data, source: RemoteConfigSource) {
dataValue = data
self.source = source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ final class FirebaseRemoteConfig_APIBuildTests: XCTestCase {
_ = FirebaseRemoteConfig.RemoteConfigUpdateError.messageInvalid
_ = FirebaseRemoteConfig.RemoteConfigUpdateError.unavailable

// TODO(ncooke3): This should probably not be initializable.
let value = FirebaseRemoteConfig.RemoteConfigValue()
// This is only initializable for internal clients - fire-perf.
let value = FirebaseRemoteConfig.RemoteConfigValue(data: Data(), source: .default)
let _: String? = value.stringValue
// TODO(ncooke3): Returns an Objective-C reference type.
let _: NSNumber = value.numberValue
Expand Down

0 comments on commit b74d065

Please sign in to comment.