Skip to content

Commit 52b3560

Browse files
jrcrespohpaulb777
andauthored
Add functions spm unit and build tests (#8499)
* Update FunctionsAPITests.swift with watchos and Task * Add watchos deployment target to Functions podspec * Add spm Functions unit and build tests * Update travis.yml for functions and watchos * Disable failing travis test, passes locally, wait for Xcode 12.5 on GHA * Changelog * Delete unused files Co-authored-by: Paul Beusterien <[email protected]>
1 parent 64e04aa commit 52b3560

File tree

10 files changed

+129
-51
lines changed

10 files changed

+129
-51
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ jobs:
9191
before_install:
9292
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh # Start integration test server
9393
script:
94-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseFunctions.podspec
94+
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseFunctions.podspec --platforms=ios
95+
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseFunctions.podspec --platforms=tvos
96+
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseFunctions.podspec --platforms=macos
9597

9698
- stage: test
9799
env:

FirebaseFunctions.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Cloud Functions for Firebase.
1818
s.ios.deployment_target = '10.0'
1919
s.osx.deployment_target = '10.12'
2020
s.tvos.deployment_target = '10.0'
21+
s.watchos.deployment_target = '6.0'
2122

2223
s.cocoapods_version = '>= 1.4.0'
2324
s.prefix_header_file = false

Functions/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v8.7.0
2+
- [fixed] Add watchOS support (#8499).
3+
14
# v8.3.0
25
- [fixed] Fixed an issue where subclassing Functions was unusable (#8265).
36

Functions/Example/IntegrationTests/IntegrationTests-Info.plist

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

Functions/Example/Tests/Tests-Info.plist

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

Functions/Example/Tests/en.lproj/InfoPlist.strings

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

Functions/Tests/Unit/Swift/FunctionsAPITests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ final class FunctionsAPITests {
6161
}
6262

6363
#if swift(>=5.5)
64-
if #available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) {
64+
if #available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) {
6565
// async/await is a Swift 5.5+ feature available on iOS 15+
66-
async {
66+
Task {
6767
do {
6868
let result = try await callableRef.call(data)
6969
_ = result.data
@@ -83,9 +83,9 @@ final class FunctionsAPITests {
8383
}
8484

8585
#if swift(>=5.5)
86-
if #available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, *) {
86+
if #available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *) {
8787
// async/await is a Swift 5.5+ feature available on iOS 15+
88-
async {
88+
Task {
8989
do {
9090
let result = try await callableRef.call()
9191
_ = result.data

Package.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,20 @@ let package = Package(
699699
"SharedTestUtilities"],
700700
path: "Functions/Tests/CombineUnit"
701701
),
702+
.testTarget(
703+
name: "FunctionsUnit",
704+
dependencies: ["FirebaseFunctions",
705+
"SharedTestUtilities"],
706+
path: "Functions/Example/Tests/",
707+
cSettings: [
708+
.headerSearchPath("../../../"),
709+
]
710+
),
711+
.testTarget(
712+
name: "FunctionsUnitSwift",
713+
dependencies: ["FirebaseFunctions"],
714+
path: "Functions/Tests/Unit/Swift"
715+
),
702716
.target(
703717
name: "FirebaseFunctionsTestingSupport",
704718
dependencies: ["FirebaseFunctions"],
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
</BuildAction>
9+
<TestAction
10+
buildConfiguration = "Debug"
11+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
shouldUseLaunchSchemeArgsEnv = "YES">
14+
<Testables>
15+
<TestableReference
16+
skipped = "NO">
17+
<BuildableReference
18+
BuildableIdentifier = "primary"
19+
BlueprintIdentifier = "FunctionsUnit"
20+
BuildableName = "FunctionsUnit"
21+
BlueprintName = "FunctionsUnit"
22+
ReferencedContainer = "container:">
23+
</BuildableReference>
24+
</TestableReference>
25+
</Testables>
26+
</TestAction>
27+
<LaunchAction
28+
buildConfiguration = "Debug"
29+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
30+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
31+
launchStyle = "0"
32+
useCustomWorkingDirectory = "NO"
33+
ignoresPersistentStateOnLaunch = "NO"
34+
debugDocumentVersioning = "YES"
35+
debugServiceExtension = "internal"
36+
allowLocationSimulation = "YES">
37+
</LaunchAction>
38+
<ProfileAction
39+
buildConfiguration = "Release"
40+
shouldUseLaunchSchemeArgsEnv = "YES"
41+
savedToolIdentifier = ""
42+
useCustomWorkingDirectory = "NO"
43+
debugDocumentVersioning = "YES">
44+
</ProfileAction>
45+
<AnalyzeAction
46+
buildConfiguration = "Debug">
47+
</AnalyzeAction>
48+
<ArchiveAction
49+
buildConfiguration = "Release"
50+
revealArchiveInOrganizer = "YES">
51+
</ArchiveAction>
52+
</Scheme>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
</BuildAction>
9+
<TestAction
10+
buildConfiguration = "Debug"
11+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
12+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13+
shouldUseLaunchSchemeArgsEnv = "YES">
14+
<Testables>
15+
<TestableReference
16+
skipped = "NO">
17+
<BuildableReference
18+
BuildableIdentifier = "primary"
19+
BlueprintIdentifier = "FunctionsUnitSwift"
20+
BuildableName = "FunctionsUnitSwift"
21+
BlueprintName = "FunctionsUnitSwift"
22+
ReferencedContainer = "container:">
23+
</BuildableReference>
24+
</TestableReference>
25+
</Testables>
26+
</TestAction>
27+
<LaunchAction
28+
buildConfiguration = "Debug"
29+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
30+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
31+
launchStyle = "0"
32+
useCustomWorkingDirectory = "NO"
33+
ignoresPersistentStateOnLaunch = "NO"
34+
debugDocumentVersioning = "YES"
35+
debugServiceExtension = "internal"
36+
allowLocationSimulation = "YES">
37+
</LaunchAction>
38+
<ProfileAction
39+
buildConfiguration = "Release"
40+
shouldUseLaunchSchemeArgsEnv = "YES"
41+
savedToolIdentifier = ""
42+
useCustomWorkingDirectory = "NO"
43+
debugDocumentVersioning = "YES">
44+
</ProfileAction>
45+
<AnalyzeAction
46+
buildConfiguration = "Debug">
47+
</AnalyzeAction>
48+
<ArchiveAction
49+
buildConfiguration = "Release"
50+
revealArchiveInOrganizer = "YES">
51+
</ArchiveAction>
52+
</Scheme>

0 commit comments

Comments
 (0)