Skip to content

Commit 5ad0a14

Browse files
committed
chore(notifications): fix local integration tests and disable notifications CI tests (#2801)
1 parent 9ca59a3 commit 5ad0a14

File tree

3 files changed

+73
-58
lines changed

3 files changed

+73
-58
lines changed

.github/workflows/integ_test.yml

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -55,43 +55,46 @@ jobs:
5555
project_path: ./AmplifyPlugins/Analytics/Tests/AnalyticsHostApp
5656
scheme: AWSPinpointAnalyticsPluginIntegrationTests
5757

58-
push-notification-integration-test:
59-
needs: prepare-for-test
60-
runs-on: macos-12
61-
environment: IntegrationTest
62-
steps:
63-
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
64-
with:
65-
persist-credentials: false
66-
67-
- name: Make directory
68-
run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/
69-
70-
- name: Copy integration test resouces
71-
uses: ./.github/composite_actions/download_test_configuration
72-
with:
73-
resource_subfolder: push-notification
74-
aws_role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
75-
aws_region: ${{ secrets.AWS_REGION }}
76-
aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET_INTEG_V2 }}
77-
78-
- name: Set up node
79-
uses: actions/setup-node@v3
80-
with:
81-
node-version: 16.x
82-
83-
- name: Run Local Server
84-
run: |
85-
cd ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer
86-
npm install
87-
npm start &
88-
shell: bash
89-
90-
- name: Run Integration test
91-
uses: ./.github/composite_actions/run_xcodebuild_test
92-
with:
93-
project_path: ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp
94-
scheme: PushNotificationHostApp
58+
# Disabling these tests because they do not currently work in CI. We will create a ticket to track
59+
# getting resolving this. In the meantime, they can be run locally.
60+
#
61+
# push-notification-integration-test:
62+
# needs: prepare-for-test
63+
# runs-on: macos-12
64+
# environment: IntegrationTest
65+
# steps:
66+
# - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
67+
# with:
68+
# persist-credentials: false
69+
70+
# - name: Make directory
71+
# run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/
72+
73+
# - name: Copy integration test resouces
74+
# uses: ./.github/composite_actions/download_test_configuration
75+
# with:
76+
# resource_subfolder: push-notification
77+
# aws_role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
78+
# aws_region: ${{ secrets.AWS_REGION }}
79+
# aws_s3_bucket: ${{ secrets.AWS_S3_BUCKET_INTEG_V2 }}
80+
81+
# - name: Set up node
82+
# uses: actions/setup-node@v3
83+
# with:
84+
# node-version: 16.x
85+
86+
# - name: Run Local Server
87+
# run: |
88+
# cd ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/LocalServer
89+
# npm install
90+
# npm start &
91+
# shell: bash
92+
93+
# - name: Run Integration test
94+
# uses: ./.github/composite_actions/run_xcodebuild_test
95+
# with:
96+
# project_path: ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp
97+
# scheme: PushNotificationHostApp
9598

9699
auth-integration-test:
97100
needs: prepare-for-test

AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostApp.xcodeproj/project.pbxproj

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
60020D8A2968E2ED0035D5F8 /* AWSPinpointAnalyticsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 60020D892968E2ED0035D5F8 /* AWSPinpointAnalyticsPlugin */; };
11-
600B385E2966269B007897BD /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 600B385D2966269B007897BD /* Amplify */; };
12-
600B38602966269F007897BD /* AWSPinpointPushNotificationsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 600B385F2966269F007897BD /* AWSPinpointPushNotificationsPlugin */; };
13-
600B38632966400F007897BD /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 600B38622966400F007897BD /* AWSCognitoAuthPlugin */; };
10+
5C4EA91129B91A2600ED7924 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 5C4EA91029B91A2600ED7924 /* Amplify */; };
11+
5C4EA91329B91A2600ED7924 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 5C4EA91229B91A2600ED7924 /* AWSCognitoAuthPlugin */; };
12+
5C4EA91529B91A2600ED7924 /* AWSPinpointAnalyticsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 5C4EA91429B91A2600ED7924 /* AWSPinpointAnalyticsPlugin */; };
13+
5C4EA91729B91A2600ED7924 /* AWSPinpointPushNotificationsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 5C4EA91629B91A2600ED7924 /* AWSPinpointPushNotificationsPlugin */; };
14+
5C4EA91929B91A2600ED7924 /* AWSPluginsCore in Frameworks */ = {isa = PBXBuildFile; productRef = 5C4EA91829B91A2600ED7924 /* AWSPluginsCore */; };
1415
6084F1AF2967B87200434CBF /* PushNotificationHostAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6084F1AE2967B87200434CBF /* PushNotificationHostAppUITests.swift */; };
1516
6084F1BC2967CE5D00434CBF /* TestConfigHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6084F1BB2967CE5D00434CBF /* TestConfigHelper.swift */; };
1617
6084F1C02968A7ED00434CBF /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 6084F1BF2968A7ED00434CBF /* README.md */; };
@@ -33,7 +34,7 @@
3334
/* End PBXContainerItemProxy section */
3435

3536
/* Begin PBXFileReference section */
36-
6079DFD32965094C00E8E9D0 /* amplify-ios-staging */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "amplify-ios-staging"; path = ../../../../..; sourceTree = "<group>"; };
37+
5C4EA90F29B919D800ED7924 /* amplify-swift */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "amplify-swift"; path = ../../../../..; sourceTree = "<group>"; };
3738
6084F1AC2967B87200434CBF /* PushNotificationHostAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PushNotificationHostAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3839
6084F1AE2967B87200434CBF /* PushNotificationHostAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationHostAppUITests.swift; sourceTree = "<group>"; };
3940
6084F1BB2967CE5D00434CBF /* TestConfigHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestConfigHelper.swift; sourceTree = "<group>"; };
@@ -61,10 +62,11 @@
6162
isa = PBXFrameworksBuildPhase;
6263
buildActionMask = 2147483647;
6364
files = (
64-
600B385E2966269B007897BD /* Amplify in Frameworks */,
65-
60020D8A2968E2ED0035D5F8 /* AWSPinpointAnalyticsPlugin in Frameworks */,
66-
600B38602966269F007897BD /* AWSPinpointPushNotificationsPlugin in Frameworks */,
67-
600B38632966400F007897BD /* AWSCognitoAuthPlugin in Frameworks */,
65+
5C4EA91129B91A2600ED7924 /* Amplify in Frameworks */,
66+
5C4EA91529B91A2600ED7924 /* AWSPinpointAnalyticsPlugin in Frameworks */,
67+
5C4EA91329B91A2600ED7924 /* AWSCognitoAuthPlugin in Frameworks */,
68+
5C4EA91729B91A2600ED7924 /* AWSPinpointPushNotificationsPlugin in Frameworks */,
69+
5C4EA91929B91A2600ED7924 /* AWSPluginsCore in Frameworks */,
6870
);
6971
runOnlyForDeploymentPostprocessing = 0;
7072
};
@@ -81,7 +83,7 @@
8183
6079DFD22965094C00E8E9D0 /* Packages */ = {
8284
isa = PBXGroup;
8385
children = (
84-
6079DFD32965094C00E8E9D0 /* amplify-ios-staging */,
86+
5C4EA90F29B919D800ED7924 /* amplify-swift */,
8587
);
8688
name = Packages;
8789
sourceTree = "<group>";
@@ -175,10 +177,11 @@
175177
);
176178
name = PushNotificationHostApp;
177179
packageProductDependencies = (
178-
600B385D2966269B007897BD /* Amplify */,
179-
600B385F2966269F007897BD /* AWSPinpointPushNotificationsPlugin */,
180-
600B38622966400F007897BD /* AWSCognitoAuthPlugin */,
181-
60020D892968E2ED0035D5F8 /* AWSPinpointAnalyticsPlugin */,
180+
5C4EA91029B91A2600ED7924 /* Amplify */,
181+
5C4EA91229B91A2600ED7924 /* AWSCognitoAuthPlugin */,
182+
5C4EA91429B91A2600ED7924 /* AWSPinpointAnalyticsPlugin */,
183+
5C4EA91629B91A2600ED7924 /* AWSPinpointPushNotificationsPlugin */,
184+
5C4EA91829B91A2600ED7924 /* AWSPluginsCore */,
182185
);
183186
productName = PushNotificationHostApp;
184187
productReference = 60F60D8F2965040600B2D13D /* PushNotificationHostApp.app */;
@@ -540,21 +543,25 @@
540543
/* End XCConfigurationList section */
541544

542545
/* Begin XCSwiftPackageProductDependency section */
543-
60020D892968E2ED0035D5F8 /* AWSPinpointAnalyticsPlugin */ = {
546+
5C4EA91029B91A2600ED7924 /* Amplify */ = {
544547
isa = XCSwiftPackageProductDependency;
545-
productName = AWSPinpointAnalyticsPlugin;
548+
productName = Amplify;
546549
};
547-
600B385D2966269B007897BD /* Amplify */ = {
550+
5C4EA91229B91A2600ED7924 /* AWSCognitoAuthPlugin */ = {
548551
isa = XCSwiftPackageProductDependency;
549-
productName = Amplify;
552+
productName = AWSCognitoAuthPlugin;
550553
};
551-
600B385F2966269F007897BD /* AWSPinpointPushNotificationsPlugin */ = {
554+
5C4EA91429B91A2600ED7924 /* AWSPinpointAnalyticsPlugin */ = {
555+
isa = XCSwiftPackageProductDependency;
556+
productName = AWSPinpointAnalyticsPlugin;
557+
};
558+
5C4EA91629B91A2600ED7924 /* AWSPinpointPushNotificationsPlugin */ = {
552559
isa = XCSwiftPackageProductDependency;
553560
productName = AWSPinpointPushNotificationsPlugin;
554561
};
555-
600B38622966400F007897BD /* AWSCognitoAuthPlugin */ = {
562+
5C4EA91829B91A2600ED7924 /* AWSPluginsCore */ = {
556563
isa = XCSwiftPackageProductDependency;
557-
productName = AWSCognitoAuthPlugin;
564+
productName = AWSPluginsCore;
558565
};
559566
/* End XCSwiftPackageProductDependency section */
560567
};

AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp/PushNotificationHostAppUITests/PushNotificationHostAppUITests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ final class PushNotificationHostAppUITests: XCTestCase {
260260
if !springboard.wait(for: .runningForeground, timeout: timeout) {
261261
XCTFail("Failed to get back to home screen")
262262
}
263+
264+
if !app.wait(for: .runningBackground, timeout: timeout) {
265+
XCTFail("Failed to put app to the background")
266+
return
267+
}
263268
}
264269

265270
private func anyElementContains(text: String, scope: XCUIElement) -> XCUIElement {

0 commit comments

Comments
 (0)