Skip to content

Commit 9cbe0af

Browse files
authored
Merge pull request #174 from Unity-Technologies/minor-fixes
Minor fixes
2 parents e504ac2 + 140d4d3 commit 9cbe0af

File tree

3 files changed

+11
-44
lines changed

3 files changed

+11
-44
lines changed

.yamato/upm-ci.yml

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
test_editors:
22
- version: trunk
33
- version: 2022.1
4-
- version: 2021.2
5-
- version: 2020.3
6-
7-
ios_test_editors:
8-
- version: trunk
9-
- version: 2022.1
10-
- version: 2021.2
4+
- version: 2021.3
115
- version: 2020.3
126

137
test_platforms:
@@ -19,17 +13,6 @@ test_platforms:
1913
artifactory:
2014
production: https://artifactory.prd.it.unity3d.com/artifactory/api/
2115

22-
mobile_dependencies:
23-
- unity_test_framework:
24-
name: com.unity.test-framework.build
25-
version: 0.0.1-preview.12
26-
- performance_test_framework:
27-
name: com.unity.test-framework.utp-reporter
28-
version: 1.0.0-preview
29-
- mobile_notifications:
30-
name: com.unity.mobile.notifications
31-
version: file:../../com.unity.mobile.notifications
32-
3316
utr:
3417
url_win: https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat
3518
url_unix: https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr
@@ -85,22 +68,14 @@ test_Android_{{ editor.version }}:
8568
image: mobile/android-execution-r19:stable
8669
flavor: b1.medium
8770
commands:
88-
- choco source add -n Unity -s {{ artifactory.production }}nuget/unity-choco-local
89-
- choco install unity-config
90-
- unity-config settings editor-path .Editor
91-
- unity-config project create .MyTestProject
92-
{%- for dependency in mobile_dependencies -%}
93-
- unity-config project add dependency {{dependency.name}}@{{dependency.version}} --project-path .MyTestProject
94-
{%- endfor -%}
95-
- unity-config project add testable com.unity.mobile.notifications
9671
- curl -s {{ utr.url_win }} --output utr.bat
9772
- pip install unity-downloader-cli --index-url {{ artifactory.production }}pypi/pypi/simple --upgrade
9873
- unity-downloader-cli -c Editor -c Android -u {{ editor.version }} --wait --fast
99-
- utr.bat --testproject=.MyTestProject --editor-location=.Editor --suite=playmode --platform=android --scripting-backend=mono --artifacts_path=upm-ci~/test-results/android --timeout=900 --extra-editor-arg="-upmNoDefaultPackages" --player-save-path=build/players --build-only
74+
- utr.bat --testproject=TestProjects\com.unity.mobile-notifications-sample --editor-location=.Editor --suite=playmode --platform=android --scripting-backend=mono --artifacts_path=upm-ci~/test-results/android --timeout=900 --extra-editor-arg="-upmNoDefaultPackages" --player-save-path=build/players --build-only
10075
- |
10176
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
10277
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
103-
utr.bat --testproject=.MyTestProject --editor-location=.Editor --suite=playmode --platform=android --scripting-backend=mono --artifacts_path=upm-ci~/test-results/android --timeout=900 --player-load-path=build/players
78+
utr.bat --testproject=TestProjects\com.unity.mobile-notifications-sample --editor-location=.Editor --suite=playmode --platform=android --scripting-backend=mono --artifacts_path=upm-ci~/test-results/android --timeout=900 --player-load-path=build/players
10479
after:
10580
- start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
10681
- powershell %ANDROID_SDK_ROOT%\platform-tools\adb.exe logcat -d > upm-ci~/test-results/android/android_device_log.txt
@@ -112,7 +87,7 @@ test_Android_{{ editor.version }}:
11287
- .yamato/upm-ci.yml#pack
11388
{% endfor %}
11489

115-
{% for editor in ios_test_editors %}
90+
{% for editor in test_editors %}
11691
test_iOS_{{ editor.version }}:
11792
name: Test {{ editor.version }} on iOS
11893
agent:
@@ -122,20 +97,12 @@ test_iOS_{{ editor.version }}:
12297
variables:
12398
IOS_SIMULATOR_SDK: 1
12499
commands:
125-
- brew tap --force-auto-update unity/unity [email protected]:unity/homebrew-unity.git
126-
- brew install unity-config
127-
- unity-config settings editor-path .Editor
128-
- unity-config project create .MyTestProject
129-
{%- for dependency in mobile_dependencies -%}
130-
- unity-config project add dependency {{dependency.name}}@{{dependency.version}} --project-path .MyTestProject
131-
{%- endfor -%}
132-
- unity-config project add testable com.unity.mobile.notifications
133100
- curl -s {{ utr.url_unix }} --output utr
134101
- chmod u+x utr
135102
- pip install unity-downloader-cli --index-url {{ artifactory.production }}pypi/pypi/simple --upgrade
136103
- unity-downloader-cli -c Editor -c iOS -u {{ editor.version }} --wait --fast
137-
- ./utr --testproject=.MyTestProject --editor-location=.Editor --suite=playmode --platform=ios --artifacts_path=upm-ci~/test-results/ios --timeout=900 --extra-editor-arg="-upmNoDefaultPackages" --player-save-path=build/players --build-only
138-
- ./utr --testproject=.MyTestProject --editor-location=.Editor --suite=playmode --platform=ios --artifacts_path=upm-ci~/test-results/ios --timeout=900 --player-load-path=build/players
104+
- ./utr --testproject=TestProjects/com.unity.mobile-notifications-sample --editor-location=.Editor --suite=playmode --platform=ios --artifacts_path=upm-ci~/test-results/ios --timeout=900 --extra-editor-arg="-upmNoDefaultPackages" --player-save-path=build/players --build-only
105+
- ./utr --testproject=TestProjects/com.unity.mobile-notifications-sample --editor-location=.Editor --suite=playmode --platform=ios --artifacts_path=upm-ci~/test-results/ios --timeout=900 --player-load-path=build/players
139106
artifacts:
140107
packages:
141108
paths:
@@ -170,8 +137,6 @@ test_trigger:
170137
- .yamato/upm-ci.yml#test_{{ platform.name }}_{{ editor.version }}
171138
{% endfor %}
172139
- .yamato/upm-ci.yml#test_Android_{{ editor.version }}
173-
{% endfor %}
174-
{% for editor in ios_test_editors %}
175140
- .yamato/upm-ci.yml#test_iOS_{{ editor.version }}
176141
{% endfor %}
177142

com.unity.mobile.notifications/Editor/AndroidNotificationPostProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public void OnPostGenerateGradleAndroidProject(string projectPath)
2424

2525
private void MinSdkCheck()
2626
{
27-
#if !UNITY_2020_2_OR_NEWER
28-
// API level 21 not supported since 2020.2, need to check for prior releases
27+
#if !UNITY_2021_2_OR_NEWER
28+
// API level 21 not supported since 2021.2, need to check for prior releases
2929
const AndroidSdkVersions kMinAndroidSdk = AndroidSdkVersions.AndroidApiLevel21;
3030

3131
if (PlayerSettings.Android.minSdkVersion < AndroidSdkVersions.AndroidApiLevel21)

com.unity.mobile.notifications/Tests/Runtime/iOS/iOSNotificationTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public void AfterEachTest()
7474
{
7575
receivedNotificationCount = 0;
7676
lastReceivedNotification = null;
77+
iOSNotificationCenter.RemoveAllScheduledNotifications();
7778
}
7879
#endif
7980

@@ -158,7 +159,7 @@ public IEnumerator SendNotificationWithUserInfo_NotificationIsReceivedWithSameUs
158159
IEnumerator SendNotificationUsingCalendarTrigger_NotificationIsReceived(string text, bool useUtc)
159160
{
160161
var dateTime = useUtc ? DateTime.UtcNow : DateTime.Now;
161-
var dt = dateTime.AddSeconds(3);
162+
var dt = dateTime.AddSeconds(5);
162163
var trigger = new iOSNotificationCalendarTrigger()
163164
{
164165
Year = dt.Year,
@@ -180,6 +181,7 @@ IEnumerator SendNotificationUsingCalendarTrigger_NotificationIsReceived(string t
180181
};
181182

182183
iOSNotificationCenter.ScheduleNotification(notification);
184+
Debug.Log($"SendNotificationUsingCalendarTrigger_NotificationIsReceived, Now: {dateTime}, Notification should arrive on: {dt}");
183185
yield return WaitForNotification(10.0f);
184186
Assert.AreEqual(1, receivedNotificationCount);
185187
Assert.IsNotNull(lastReceivedNotification);

0 commit comments

Comments
 (0)