Skip to content

Commit 4f7d9c8

Browse files
committed
feat(Auth): Enable tests for watchOS and tvOS (#3073)
* feat(Auth): Enable tests for watchOS and tvOS * adding new tests to the watch target * enabling code coverage * Update AuthIntegrationTestsWatch.xcscheme
1 parent 608928f commit 4f7d9c8

File tree

7 files changed

+118
-47
lines changed

7 files changed

+118
-47
lines changed

AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
48916F382A412B2800E3E1B1 /* TOTPSetupWhenAuthenticatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48916F372A412B2800E3E1B1 /* TOTPSetupWhenAuthenticatedTests.swift */; };
3232
48916F3A2A412CEE00E3E1B1 /* TOTPHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48916F392A412CEE00E3E1B1 /* TOTPHelper.swift */; };
3333
48916F3C2A42333E00E3E1B1 /* MFAPreferenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48916F3B2A42333E00E3E1B1 /* MFAPreferenceTests.swift */; };
34+
48BCE8922A5456460012C3CD /* TOTPSetupWhenAuthenticatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48916F372A412B2800E3E1B1 /* TOTPSetupWhenAuthenticatedTests.swift */; };
35+
48BCE8932A54564C0012C3CD /* TOTPSetupWhenUnauthenticatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 483B0D332A42BB1400A1196B /* TOTPSetupWhenUnauthenticatedTests.swift */; };
36+
48BCE8942A54564C0012C3CD /* MFASignInTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48599D492A429893009DE21C /* MFASignInTests.swift */; };
37+
48BCE8952A54564C0012C3CD /* MFAPreferenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48916F3B2A42333E00E3E1B1 /* MFAPreferenceTests.swift */; };
38+
48BCE8962A5456600012C3CD /* TOTPHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48916F392A412CEE00E3E1B1 /* TOTPHelper.swift */; };
3439
48E3AB3128E52590004EE395 /* GetCurrentUserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48E3AB3028E52590004EE395 /* GetCurrentUserTests.swift */; };
3540
681B76952A3CB8DA004B59D9 /* AuthHostAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 485CB53D27B614CE006CCEC7 /* AuthHostAppApp.swift */; };
3641
681B76962A3CB8DD004B59D9 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 485CB53F27B614CE006CCEC7 /* ContentView.swift */; };
@@ -750,8 +755,12 @@
750755
681B76A72A3CBBAE004B59D9 /* AuthConfirmSignUpTests.swift in Sources */,
751756
681B76A82A3CBBAE004B59D9 /* AuthSignOutTests.swift in Sources */,
752757
681B76A92A3CBBAE004B59D9 /* AuthFetchDeviceTests.swift in Sources */,
758+
48BCE8922A5456460012C3CD /* TOTPSetupWhenAuthenticatedTests.swift in Sources */,
759+
48BCE8962A5456600012C3CD /* TOTPHelper.swift in Sources */,
753760
681B76AA2A3CBBAE004B59D9 /* AsyncExpectation.swift in Sources */,
761+
48BCE8932A54564C0012C3CD /* TOTPSetupWhenUnauthenticatedTests.swift in Sources */,
754762
681B76AB2A3CBBAE004B59D9 /* GetCurrentUserTests.swift in Sources */,
763+
48BCE8952A54564C0012C3CD /* MFAPreferenceTests.swift in Sources */,
755764
681B76AC2A3CBBAE004B59D9 /* AWSAuthBaseTest.swift in Sources */,
756765
681B76AD2A3CBBAE004B59D9 /* SignedOutAuthSessionTests.swift in Sources */,
757766
681B76AE2A3CBBAE004B59D9 /* AuthSignInHelper.swift in Sources */,
@@ -768,6 +777,7 @@
768777
681B76B92A3CBBAE004B59D9 /* SignedInAuthSessionTests.swift in Sources */,
769778
681B76BA2A3CBBAE004B59D9 /* AuthSignUpTests.swift in Sources */,
770779
681B76BB2A3CBBAE004B59D9 /* AuthConfirmResetPasswordTests.swift in Sources */,
780+
48BCE8942A54564C0012C3CD /* MFASignInTests.swift in Sources */,
771781
681B76BC2A3CBBAE004B59D9 /* AuthDeleteUserTests.swift in Sources */,
772782
);
773783
runOnlyForDeploymentPostprocessing = 0;

AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/xcshareddata/xcschemes/AuthHostApp.xcscheme

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES"
31+
onlyGenerateCoverageForSpecifiedTargets = "YES">
32+
<CodeCoverageTargets>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "AWSCognitoAuthPlugin"
36+
BuildableName = "AWSCognitoAuthPlugin"
37+
BlueprintName = "AWSCognitoAuthPlugin"
38+
ReferencedContainer = "container:../../../..">
39+
</BuildableReference>
40+
</CodeCoverageTargets>
3041
<Testables>
3142
<TestableReference
3243
skipped = "NO">
@@ -37,27 +48,13 @@
3748
BlueprintName = "AuthIntegrationTests"
3849
ReferencedContainer = "container:AuthHostApp.xcodeproj">
3950
</BuildableReference>
40-
<SkippedTests>
41-
<Test
42-
Identifier = "AuthCustomSignInTests/testRuntimeAuthFlowSwitch()">
43-
</Test>
44-
<Test
45-
Identifier = "AuthCustomSignInTests/testSuccessfulSignInWithCustomAuth()">
46-
</Test>
47-
<Test
48-
Identifier = "AuthCustomSignInTests/testSuccessfulSignInWithCustomAuthSRP()">
49-
</Test>
50-
<Test
51-
Identifier = "AuthSRPSignInTests/testNewPasswordRequired()">
52-
</Test>
53-
</SkippedTests>
5451
</TestableReference>
5552
<TestableReference
5653
skipped = "NO"
5754
parallelizable = "YES">
5855
<BuildableReference
5956
BuildableIdentifier = "primary"
60-
BlueprintIdentifier = "97914AD42954FE0A002000EA"
57+
BlueprintIdentifier = "97914B2629550988002000EA"
6158
BuildableName = "AuthStressTests.xctest"
6259
BlueprintName = "AuthStressTests"
6360
ReferencedContainer = "container:AuthHostApp.xcodeproj">

AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/xcshareddata/xcschemes/AuthIntegrationTests.xcscheme

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
1313
shouldUseLaunchSchemeArgsEnv = "YES"
14-
enableThreadSanitizer = "YES">
14+
enableThreadSanitizer = "YES"
15+
codeCoverageEnabled = "YES">
16+
<CodeCoverageTargets>
17+
<BuildableReference
18+
BuildableIdentifier = "primary"
19+
BlueprintIdentifier = "AWSCognitoAuthPlugin"
20+
BuildableName = "AWSCognitoAuthPlugin"
21+
BlueprintName = "AWSCognitoAuthPlugin"
22+
ReferencedContainer = "container:../../../..">
23+
</BuildableReference>
24+
</CodeCoverageTargets>
1525
<Testables>
1626
<TestableReference
1727
skipped = "NO">
@@ -22,20 +32,6 @@
2232
BlueprintName = "AuthIntegrationTests"
2333
ReferencedContainer = "container:AuthHostApp.xcodeproj">
2434
</BuildableReference>
25-
<SkippedTests>
26-
<Test
27-
Identifier = "AuthCustomSignInTests/testRuntimeAuthFlowSwitch()">
28-
</Test>
29-
<Test
30-
Identifier = "AuthCustomSignInTests/testSuccessfulSignInWithCustomAuth()">
31-
</Test>
32-
<Test
33-
Identifier = "AuthCustomSignInTests/testSuccessfulSignInWithCustomAuthSRP()">
34-
</Test>
35-
<Test
36-
Identifier = "AuthSRPSignInTests/testNewPasswordRequired()">
37-
</Test>
38-
</SkippedTests>
3935
</TestableReference>
4036
</Testables>
4137
</TestAction>

AmplifyPlugins/Auth/Tests/AuthHostApp/AuthHostApp.xcodeproj/xcshareddata/xcschemes/AuthIntegrationTestsWatch.xcscheme

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
1313
shouldUseLaunchSchemeArgsEnv = "YES"
14-
enableThreadSanitizer = "YES">
14+
enableThreadSanitizer = "YES"
15+
codeCoverageEnabled = "YES">
1516
<Testables>
1617
<TestableReference
1718
skipped = "NO">
@@ -22,20 +23,6 @@
2223
BlueprintName = "AuthIntegrationTestsWatch"
2324
ReferencedContainer = "container:AuthHostApp.xcodeproj">
2425
</BuildableReference>
25-
<SkippedTests>
26-
<Test
27-
Identifier = "AuthCustomSignInTests/testRuntimeAuthFlowSwitch()">
28-
</Test>
29-
<Test
30-
Identifier = "AuthCustomSignInTests/testSuccessfulSignInWithCustomAuth()">
31-
</Test>
32-
<Test
33-
Identifier = "AuthCustomSignInTests/testSuccessfulSignInWithCustomAuthSRP()">
34-
</Test>
35-
<Test
36-
Identifier = "AuthSRPSignInTests/testNewPasswordRequired()">
37-
</Test>
38-
</SkippedTests>
3926
</TestableReference>
4027
</Testables>
4128
</TestAction>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1430"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "681B767F2A3CB86B004B59D9"
18+
BuildableName = "AuthWatchApp.app"
19+
BlueprintName = "AuthWatchApp"
20+
ReferencedContainer = "container:AuthHostApp.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
shouldAutocreateTestPlan = "YES">
31+
</TestAction>
32+
<LaunchAction
33+
buildConfiguration = "Debug"
34+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36+
launchStyle = "0"
37+
useCustomWorkingDirectory = "NO"
38+
ignoresPersistentStateOnLaunch = "NO"
39+
debugDocumentVersioning = "YES"
40+
debugServiceExtension = "internal"
41+
allowLocationSimulation = "YES">
42+
<BuildableProductRunnable
43+
runnableDebuggingMode = "0">
44+
<BuildableReference
45+
BuildableIdentifier = "primary"
46+
BlueprintIdentifier = "681B767F2A3CB86B004B59D9"
47+
BuildableName = "AuthWatchApp.app"
48+
BlueprintName = "AuthWatchApp"
49+
ReferencedContainer = "container:AuthHostApp.xcodeproj">
50+
</BuildableReference>
51+
</BuildableProductRunnable>
52+
</LaunchAction>
53+
<ProfileAction
54+
buildConfiguration = "Release"
55+
shouldUseLaunchSchemeArgsEnv = "YES"
56+
savedToolIdentifier = ""
57+
useCustomWorkingDirectory = "NO"
58+
debugDocumentVersioning = "YES">
59+
<BuildableProductRunnable
60+
runnableDebuggingMode = "0">
61+
<BuildableReference
62+
BuildableIdentifier = "primary"
63+
BlueprintIdentifier = "681B767F2A3CB86B004B59D9"
64+
BuildableName = "AuthWatchApp.app"
65+
BlueprintName = "AuthWatchApp"
66+
ReferencedContainer = "container:AuthHostApp.xcodeproj">
67+
</BuildableReference>
68+
</BuildableProductRunnable>
69+
</ProfileAction>
70+
<AnalyzeAction
71+
buildConfiguration = "Debug">
72+
</AnalyzeAction>
73+
<ArchiveAction
74+
buildConfiguration = "Release"
75+
revealArchiveInOrganizer = "YES">
76+
</ArchiveAction>
77+
</Scheme>

AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/SignInTests/AuthCustomSignInTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class AuthCustomSignInTests: AWSAuthBaseTest {
5353
/// }
5454
///
5555
func testSuccessfulSignInWithCustomAuthSRP() async throws {
56+
throw XCTSkip("TODO: fix this test. Need custom resource")
5657

5758
let username = "integTest\(UUID().uuidString)"
5859
let password = "P123@\(UUID().uuidString)"
@@ -114,6 +115,7 @@ class AuthCustomSignInTests: AWSAuthBaseTest {
114115
/// }
115116
///
116117
func testRuntimeAuthFlowSwitch() async throws {
118+
throw XCTSkip("TODO: fix this test. Need custom resource")
117119

118120
let username = "integTest\(UUID().uuidString)"
119121
let password = "P123@\(UUID().uuidString)"
@@ -180,6 +182,7 @@ class AuthCustomSignInTests: AWSAuthBaseTest {
180182
/// return event;
181183
/// };
182184
func testSuccessfulSignInWithCustomAuth() async throws {
185+
throw XCTSkip("TODO: fix this test. Need custom resource")
183186

184187
let username = "integTest\(UUID().uuidString)"
185188
let password = "P123@\(UUID().uuidString)"

AmplifyPlugins/Auth/Tests/AuthHostApp/AuthIntegrationTests/SignInTests/AuthSRPSignInTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ class AuthSRPSignInTests: AWSAuthBaseTest {
233233
/// Make sure that you do not enter email and phone number, so that adding a new attribute could also be tested
234234
///
235235
/// DISABLED TEST, because it needs special setup
236-
func testNewPasswordRequired() async {
236+
func testNewPasswordRequired() async throws {
237+
throw XCTSkip("TODO: fix this test. Need custom resource")
237238

238239
let username = "YOUR USERNAME CREATED IN COGNITO FOR TESTING TEMP PASSWORD FLOW"
239240
let tempPassword = "YOUR TEMP PASSWORD THAT WAS SET"

0 commit comments

Comments
 (0)