Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/e2e_tests_storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
package-path: 'packages/firebase_storage/firebase_storage'
package-scope: 'firebase_storage*'
cache-key-suffix: 'storage'
native-test-script: 'tool/test_engine_lifecycle.sh'
native-config-args: '--storage-native'
storage-emulator-debug: true
nightly_test_mode: ${{ inputs.nightly_test_mode == true }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable_e2e_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
- '${{ inputs.package-path }}/ios/**'
- '${{ inputs.package-path }}/darwin/**'
- '${{ inputs.package-path }}/example/ios/**'
- '${{ inputs.package-path }}/tool/test_engine_lifecycle.sh'
macos:
- *shared
- '${{ inputs.package-path }}/macos/**'
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/reusable_e2e_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
description: 'Integration test entrypoint, relative to the example directory.'
type: string
default: 'integration_test/e2e_test.dart'
native-test-script:
description: 'Optional native test script relative to the package; receives the simulator UDID and runs with the Storage emulator.'
type: string
default: ''
native-config-args:
description: >-
Arguments for generate-dummy-firebase-configs.dart, e.g.
Expand Down Expand Up @@ -270,6 +274,23 @@ jobs:
SIMULATOR: ${{ steps.simulator.outputs.udid }}
ENSURE_BOOT_IF_NEEDED: "0"
run: .github/workflows/scripts/ensure-simulator-ready.sh
- name: Native iOS tests
if: inputs.native-test-script != ''
working-directory: ./.github/workflows/scripts
timeout-minutes: 20
env:
SIMULATOR: ${{ steps.simulator.outputs.udid }}
NATIVE_TEST_SCRIPT: ${{ inputs.native-test-script }}
run: |
firebase emulators:exec --only storage --project flutterfire-e2e-tests \
'bash "${GITHUB_WORKSPACE}/${PACKAGE_PATH}/${NATIVE_TEST_SCRIPT}" "$SIMULATOR"'
- name: Upload native iOS test results
if: ${{ !cancelled() && inputs.native-test-script != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: native-ios-tests-${{ inputs.cache-key-suffix }}
path: ${{ inputs.package-path }}/example/build/native-tests/Logs/Test/*.xcresult
if-no-files-found: warn
- name: 'E2E Tests'
if: inputs.use-firebase-emulators
# firebase.json and the emulator rule files live here, so `emulators:exec`
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ Liu Zhisong <liuzs0666@gmail.com>
Ievgenii Kovtun <jeka.ns@gmail.com>
Dinu-Stefan Rusu <rusudinustefan@gmail.com>
Marwan Salim Ba Matraf <marwans12@hotmail.com>
Hennie Brink <hennie@viszen.tech>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:firebase_storage_example/firebase_options.dart';

import 'test_utils.dart';

Expand All @@ -16,9 +15,6 @@ void setupInstanceTests() {
late FirebaseApp secondaryAppWithoutBucket;

setUpAll(() async {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
storage = FirebaseStorage.instance;
secondaryApp = await testInitializeSecondaryApp();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2026 The Chromium Authors.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// The native XCTest host and its secondary engine need a Dart isolate without
// initializing Firebase or running the example UI.
void main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ Future<FirebaseApp> testInitializeSecondaryApp({
(defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.iOS ||
defaultTargetPlatform == TargetPlatform.windows)) {
final nativeOptions = Firebase.app().options;
testAppOptions = FirebaseOptions(
appId: DefaultFirebaseOptions.currentPlatform.appId,
apiKey: DefaultFirebaseOptions.currentPlatform.apiKey,
projectId: DefaultFirebaseOptions.currentPlatform.projectId,
messagingSenderId:
DefaultFirebaseOptions.currentPlatform.messagingSenderId,
iosBundleId: DefaultFirebaseOptions.currentPlatform.iosBundleId,
appId: nativeOptions.appId,
apiKey: nativeOptions.apiKey,
projectId: nativeOptions.projectId,
messagingSenderId: nativeOptions.messagingSenderId,
iosBundleId: nativeOptions.iosBundleId,
storageBucket: withDefaultBucket ? kTestStorageBucket : null,
);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
5C6F5A711EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */; };
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
78A3AD3F868B71292C69C49E /* StorageEngineLifecycleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 434234C6C66B4B6473EDD774 /* StorageEngineLifecycleTests.swift */; };
878C86B9E4279A162569D36E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A721D45D6B6CB986E623EE /* Foundation.framework */; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
Expand All @@ -21,6 +23,16 @@
D2E2163194A154ACEE1A71C3 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = FFBFFC26A733835824F4674E /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
ECF50C917D108BEB7D2A1DB5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
proxyType = 1;
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
remoteInfo = Runner;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
Expand All @@ -36,9 +48,12 @@

/* Begin PBXFileReference section */
02CA5B04FD87E7B77B3477E2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
1EF4EC1DD2C06F51DEE73DD4 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
434234C6C66B4B6473EDD774 /* StorageEngineLifecycleTests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StorageEngineLifecycleTests.swift; sourceTree = "<group>"; };
5C6F5A6F1EC3CCCC008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
5C6F5A701EC3CCCC008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
61A721D45D6B6CB986E623EE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
7A1ECC901E8EDB6900309407 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
Expand All @@ -58,6 +73,14 @@
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
5E72461DC15966E2173621C3 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
878C86B9E4279A162569D36E /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -70,6 +93,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
263B1D4C1C08199D7D7A9AB8 /* RunnerTests */ = {
isa = PBXGroup;
children = (
434234C6C66B4B6473EDD774 /* StorageEngineLifecycleTests.swift */,
);
name = RunnerTests;
path = RunnerTests;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
Expand All @@ -91,13 +123,15 @@
FFBFFC26A733835824F4674E /* GoogleService-Info.plist */,
E6FBE2EBD3E88C317FEF8092 /* Pods */,
E437F81FDC10E2D0A1D19577 /* Frameworks */,
263B1D4C1C08199D7D7A9AB8 /* RunnerTests */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
1EF4EC1DD2C06F51DEE73DD4 /* RunnerTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -127,10 +161,19 @@
name = "Supporting Files";
sourceTree = "<group>";
};
BE0258992404267C5412D8B8 /* iOS */ = {
isa = PBXGroup;
children = (
61A721D45D6B6CB986E623EE /* Foundation.framework */,
);
name = iOS;
sourceTree = "<group>";
};
E437F81FDC10E2D0A1D19577 /* Frameworks */ = {
isa = PBXGroup;
children = (
B87F8A9D34F2EDB6C0C3EC13 /* Pods_Runner.framework */,
BE0258992404267C5412D8B8 /* iOS */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -148,6 +191,24 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
4D8C47C75BBE97BD6C93F104 /* RunnerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 664CF7E91657D4A08391B9F3 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
5819D984F77678DD121ECC5F /* Sources */,
5E72461DC15966E2173621C3 /* Frameworks */,
79D0F96BD51041DFC01E5E28 /* Resources */,
);
buildRules = (
);
dependencies = (
E389F46DB397A5BAA37DA657 /* PBXTargetDependency */,
);
name = RunnerTests;
productName = RunnerTests;
productReference = 1EF4EC1DD2C06F51DEE73DD4 /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
Expand Down Expand Up @@ -205,11 +266,19 @@
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
4D8C47C75BBE97BD6C93F104 /* RunnerTests */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
79D0F96BD51041DFC01E5E28 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -301,6 +370,14 @@
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
5819D984F77678DD121ECC5F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
78A3AD3F868B71292C69C49E /* StorageEngineLifecycleTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -313,6 +390,15 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
E389F46DB397A5BAA37DA657 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = Runner;
target = 97C146ED1CF9000F007C117D /* Runner */;
targetProxy = ECF50C917D108BEB7D2A1DB5 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
Expand All @@ -333,6 +419,33 @@
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
94802E220EA34C24945115A7 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGNING_ALLOWED = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(BUILT_PRODUCTS_DIR)",
"$(PROJECT_DIR)/../build/ios/Debug-iphonesimulator",
);
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "io.flutter.plugins.firebase.storage.lifecycle-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_INCLUDE_PATHS = "$(inherited) $(BUILT_PRODUCTS_DIR) $(PROJECT_DIR)/../build/ios/Debug-iphonesimulator";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
};
name = Debug;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -471,9 +584,46 @@
};
name = Release;
};
B3F56AE0CA0B7E9EDC357461 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGNING_ALLOWED = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(BUILT_PRODUCTS_DIR)",
"$(PROJECT_DIR)/../build/ios/Debug-iphonesimulator",
);
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "io.flutter.plugins.firebase.storage.lifecycle-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_INCLUDE_PATHS = "$(inherited) $(BUILT_PRODUCTS_DIR) $(PROJECT_DIR)/../build/ios/Debug-iphonesimulator";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
664CF7E91657D4A08391B9F3 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B3F56AE0CA0B7E9EDC357461 /* Release */,
94802E220EA34C24945115A7 /* Debug */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D8C47C75BBE97BD6C93F104"
BuildableName = "RunnerTests.xctest"
BlueprintName = "RunnerTests"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
Expand Down
Loading
Loading