Skip to content

Commit 7c59b96

Browse files
committed
Merge branch 'dev' of github.com:forcedotcom/SalesforceMobileSDK-Android into dynamic_oauth_config
2 parents 4186055 + 64346b4 commit 7c59b96

File tree

9 files changed

+277
-35
lines changed

9 files changed

+277
-35
lines changed

.github/DangerFiles/Gemfile.lock

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,107 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.8.7)
5-
public_suffix (>= 2.0.2, < 7.0)
4+
activesupport (8.1.1)
5+
base64
6+
bigdecimal
7+
concurrent-ruby (~> 1.0, >= 1.3.1)
8+
connection_pool (>= 2.2.5)
9+
drb
10+
i18n (>= 1.6, < 2)
11+
json
12+
logger (>= 1.4.2)
13+
minitest (>= 5.1)
14+
securerandom (>= 0.3)
15+
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
17+
addressable (2.8.8)
18+
public_suffix (>= 2.0.2, < 8.0)
619
ansi (1.5.0)
7-
ast (2.4.2)
8-
base64 (0.2.0)
20+
ast (2.4.3)
21+
base64 (0.3.0)
22+
bigdecimal (3.3.1)
923
claide (1.1.0)
1024
claide-plugins (0.9.2)
1125
cork
1226
nap
1327
open4 (~> 1.3)
1428
colored2 (3.1.2)
29+
concurrent-ruby (1.3.5)
30+
connection_pool (2.5.5)
1531
cork (0.3.0)
1632
colored2 (~> 3.1)
17-
danger (9.5.1)
33+
danger (9.5.3)
1834
base64 (~> 0.2)
1935
claide (~> 1.0)
2036
claide-plugins (>= 0.9.2)
21-
colored2 (~> 3.1)
37+
colored2 (>= 3.1, < 5)
2238
cork (~> 0.1)
2339
faraday (>= 0.9.0, < 3.0)
2440
faraday-http-cache (~> 2.0)
25-
git (~> 1.13)
26-
kramdown (~> 2.3)
41+
git (>= 1.13, < 3.0)
42+
kramdown (>= 2.5.1, < 3.0)
2743
kramdown-parser-gfm (~> 1.0)
2844
octokit (>= 4.0)
2945
pstore (~> 0.1)
30-
terminal-table (>= 1, < 4)
46+
terminal-table (>= 1, < 5)
3147
danger-android_lint (0.0.12)
3248
danger-plugin-api (~> 1.0)
3349
oga
3450
danger-plugin-api (1.0.0)
3551
danger (> 2.0)
36-
faraday (2.12.2)
52+
drb (2.2.3)
53+
faraday (2.14.0)
3754
faraday-net_http (>= 2.0, < 3.5)
3855
json
3956
logger
4057
faraday-http-cache (2.5.1)
4158
faraday (>= 0.8)
42-
faraday-net_http (3.4.0)
43-
net-http (>= 0.5.0)
44-
git (1.19.1)
59+
faraday-net_http (3.4.2)
60+
net-http (~> 0.5)
61+
git (2.3.3)
62+
activesupport (>= 5.0)
4563
addressable (~> 2.8)
64+
process_executer (~> 1.1)
4665
rchardet (~> 1.8)
47-
json (2.9.1)
66+
i18n (1.14.7)
67+
concurrent-ruby (~> 1.0)
68+
json (2.16.0)
4869
kramdown (2.5.1)
4970
rexml (>= 3.3.9)
5071
kramdown-parser-gfm (1.1.0)
5172
kramdown (~> 2.0)
52-
logger (1.6.5)
73+
logger (1.7.0)
74+
minitest (5.26.2)
5375
nap (1.1.0)
54-
net-http (0.6.0)
55-
uri
56-
octokit (9.2.0)
76+
net-http (0.8.0)
77+
uri (>= 0.11.1)
78+
octokit (10.0.0)
5779
faraday (>= 1, < 3)
5880
sawyer (~> 0.9)
5981
oga (3.4)
6082
ast
6183
ruby-ll (~> 2.1)
6284
open4 (1.3.4)
63-
pstore (0.1.4)
64-
public_suffix (6.0.1)
65-
rchardet (1.9.0)
66-
rexml (3.4.0)
67-
ruby-ll (2.1.3)
85+
process_executer (1.3.0)
86+
pstore (0.2.0)
87+
public_suffix (7.0.0)
88+
rchardet (1.10.0)
89+
rexml (3.4.4)
90+
ruby-ll (2.1.4)
6891
ansi
6992
ast
70-
sawyer (0.9.2)
93+
sawyer (0.9.3)
7194
addressable (>= 2.3.5)
7295
faraday (>= 0.17.3, < 3)
73-
terminal-table (3.0.2)
74-
unicode-display_width (>= 1.1.1, < 3)
75-
unicode-display_width (2.6.0)
76-
uri (1.0.3)
96+
securerandom (0.4.1)
97+
terminal-table (4.0.0)
98+
unicode-display_width (>= 1.1.1, < 4)
99+
tzinfo (2.0.6)
100+
concurrent-ruby (~> 1.0)
101+
unicode-display_width (3.2.0)
102+
unicode-emoji (~> 4.1)
103+
unicode-emoji (4.1.0)
104+
uri (1.1.1)
77105

78106
PLATFORMS
79107
arm64-darwin-23
@@ -84,4 +112,4 @@ DEPENDENCIES
84112
danger-android_lint
85113

86114
BUNDLED WITH
87-
2.5.22
115+
2.5.16
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"description": "Test shards for MobileSync library - all network tests in one shard to prevent server conflicts",
3+
"shards": [
4+
{
5+
"name": "network",
6+
"comment": "All network tests in single shard - run sequentially to avoid server conflicts",
7+
"targets": [
8+
"class com.salesforce.androidsdk.mobilesync.manager.SyncManagerTest",
9+
"class com.salesforce.androidsdk.mobilesync.manager.SyncManagerSuspendTest",
10+
"class com.salesforce.androidsdk.mobilesync.manager.MetadataSyncManagerTest",
11+
"class com.salesforce.androidsdk.mobilesync.manager.LayoutSyncManagerTest",
12+
"class com.salesforce.androidsdk.mobilesync.target.SyncUpTargetTest",
13+
"class com.salesforce.androidsdk.mobilesync.target.CollectionSyncUpTargetTest",
14+
"class com.salesforce.androidsdk.mobilesync.target.SoqlSyncDownTargetTest",
15+
"class com.salesforce.androidsdk.mobilesync.target.RefreshSyncDownTargetTest",
16+
"class com.salesforce.androidsdk.mobilesync.target.BriefcaseSyncDownTargetTest",
17+
"class com.salesforce.androidsdk.mobilesync.target.ParentChildrenSyncTest",
18+
"class com.salesforce.androidsdk.mobilesync.target.ParentChildrenOtherSyncTest"
19+
]
20+
},
21+
{
22+
"name": "remaining",
23+
"comment": "All remaining tests - run in parallel, no server conflicts",
24+
"targets": [
25+
"notClass com.salesforce.androidsdk.mobilesync.manager.SyncManagerTest",
26+
"notClass com.salesforce.androidsdk.mobilesync.manager.SyncManagerSuspendTest",
27+
"notClass com.salesforce.androidsdk.mobilesync.manager.MetadataSyncManagerTest",
28+
"notClass com.salesforce.androidsdk.mobilesync.manager.LayoutSyncManagerTest",
29+
"notClass com.salesforce.androidsdk.mobilesync.target.SyncUpTargetTest",
30+
"notClass com.salesforce.androidsdk.mobilesync.target.CollectionSyncUpTargetTest",
31+
"notClass com.salesforce.androidsdk.mobilesync.target.SoqlSyncDownTargetTest",
32+
"notClass com.salesforce.androidsdk.mobilesync.target.RefreshSyncDownTargetTest",
33+
"notClass com.salesforce.androidsdk.mobilesync.target.BriefcaseSyncDownTargetTest",
34+
"notClass com.salesforce.androidsdk.mobilesync.target.ParentChildrenSyncTest",
35+
"notClass com.salesforce.androidsdk.mobilesync.target.ParentChildrenOtherSyncTest"
36+
]
37+
}
38+
]
39+
}

.github/test-shards/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Test Shards
2+
3+
This directory contains JSON configuration files that define test shards for individual libraries. The overarching goal of sharding is to reduce the time it takes to run tests for PR feedback. Shards run in parallel, which comes with benefits, new potential pitfalls and a small amount of potential maintenance overhead.
4+
5+
## Benefits
6+
7+
- Because shards run on seperate devices, this should reduce the unnecessary failures caused by environment pollution. If a test fails to cleanup after itself, it will not affect other shards.
8+
- Please continue to write tests that cleanup after themselves. I do not want to see this become a crutch for flaky tests.
9+
- Faster PR _and_ Nightly runs.
10+
11+
## Pitfalls
12+
13+
- Because shards run in parallel, they need to be grouped intelligently. Many of our "unit tests" are actually integration tests. Sharding might save us from database contention, but if tests in seperate shards make API calls to manipulate data in the same org simultaneously this will cause failures.
14+
- It is now possible for tests to run more than once or be skipped if we are not careful.
15+
16+
## Maintenance
17+
18+
Each confiruration file defines targets using the `class` keyword. To ensure all tests are run, each config has a "remaining" shard that **only** uses the `notClass` keyword. New test classes will automatically be included in the "remaining" shard.
19+
20+
However, it is very important that classes added to shards are also added to the "remaining" shard to prevent them from running more than once. Likewise, classes that are removed from shards need to also be removed from the "remaining" shard so they are not skipped. CI will validate this.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"description": "Test shards for SalesforceHybrid library - isolates network JS bridge tests",
3+
"shards": [
4+
{
5+
"name": "network-js",
6+
"comment": "JavaScript bridge tests that make server calls - isolated",
7+
"targets": [
8+
"class com.salesforce.androidsdk.phonegap.ForceJSTest",
9+
"class com.salesforce.androidsdk.phonegap.MobileSyncJSTest"
10+
]
11+
},
12+
{
13+
"name": "remaining",
14+
"comment": "All remaining tests - uses notClass to exclude network tests",
15+
"targets": [
16+
"notClass com.salesforce.androidsdk.phonegap.ForceJSTest",
17+
"notClass com.salesforce.androidsdk.phonegap.MobileSyncJSTest"
18+
]
19+
}
20+
]
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"description": "Test shards for SalesforceReact library - isolates network tests to prevent server contention",
3+
"shards": [
4+
{
5+
"name": "network",
6+
"comment": "OAuth tests that make server calls - isolated",
7+
"targets": [
8+
"class com.salesforce.androidsdk.reactnative.ReactOAuthTest",
9+
"class com.salesforce.androidsdk.reactnative.ReactNetTest",
10+
"class com.salesforce.androidsdk.reactnative.ReactMobileSyncTest"
11+
]
12+
},
13+
{
14+
"name": "remaining",
15+
"comment": "All remaining tests - uses notClass to exclude network tests",
16+
"targets": [
17+
"notClass com.salesforce.androidsdk.reactnative.ReactOAuthTest",
18+
"notClass com.salesforce.androidsdk.reactnative.ReactNetTest",
19+
"notClass com.salesforce.androidsdk.reactnative.ReactMobileSyncTest"
20+
]
21+
}
22+
]
23+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"description": "Test shards for SalesforceSDK library - isolates network tests to prevent server contention",
3+
"shards": [
4+
{
5+
"name": "network",
6+
"comment": "REST client tests that make live server calls - isolated",
7+
"targets": [
8+
"class com.salesforce.androidsdk.rest.RestClientTest",
9+
"class com.salesforce.androidsdk.rest.ClientManagerTest",
10+
"class com.salesforce.androidsdk.auth.OAuth2Test",
11+
"class com.salesforce.androidsdk.auth.HttpAccessTest",
12+
"class com.salesforce.androidsdk.analytics.SalesforceAnalyticsManagerTest"
13+
]
14+
},
15+
{
16+
"name": "ui",
17+
"comment": "UI tests and security tests that may require user interaction",
18+
"targets": [
19+
"class com.salesforce.androidsdk.ui.LoginViewActivityTest",
20+
"class com.salesforce.androidsdk.ui.PickerBottomSheetTest",
21+
"class com.salesforce.androidsdk.ui.LoginActivityTest",
22+
"class com.salesforce.androidsdk.ui.LoginOptionsActivityTest",
23+
"class com.salesforce.androidsdk.ui.PickerBottomSheetActivityTest",
24+
"class com.salesforce.androidsdk.ui.DevInfoActivityTest",
25+
"class com.salesforce.androidsdk.security.ScreenLockManagerTest",
26+
"class com.salesforce.androidsdk.security.BiometricAuthenticationManagerTest"
27+
]
28+
},
29+
{
30+
"name": "rest-unit",
31+
"comment": "REST unit tests - no network calls",
32+
"targets": [
33+
"class com.salesforce.androidsdk.rest.RestRequestTest",
34+
"class com.salesforce.androidsdk.rest.ApiVersionStringsTest",
35+
"class com.salesforce.androidsdk.rest.ClientManagerMockTest",
36+
"class com.salesforce.androidsdk.rest.NotificationsTypesResponseBodyTest",
37+
"class com.salesforce.androidsdk.rest.NotificationsApiExceptionTest",
38+
"class com.salesforce.androidsdk.rest.NotificationsApiErrorResponseBodyTest",
39+
"class com.salesforce.androidsdk.rest.NotificationsActionsResponseBodyTest",
40+
"class com.salesforce.androidsdk.rest.files.RenditionTypeTest",
41+
"class com.salesforce.androidsdk.rest.files.ConnectUriBuilderTest",
42+
"class com.salesforce.androidsdk.rest.files.FileRequestsTest"
43+
]
44+
},
45+
{
46+
"name": "remaining",
47+
"comment": "All remaining tests - uses notClass/notPackage to exclude tests already in other shards",
48+
"targets": [
49+
"notClass com.salesforce.androidsdk.rest.RestClientTest",
50+
"notClass com.salesforce.androidsdk.rest.ClientManagerTest",
51+
"notClass com.salesforce.androidsdk.auth.OAuth2Test",
52+
"notClass com.salesforce.androidsdk.auth.HttpAccessTest",
53+
"notClass com.salesforce.androidsdk.analytics.SalesforceAnalyticsManagerTest",
54+
"notClass com.salesforce.androidsdk.ui.LoginViewActivityTest",
55+
"notClass com.salesforce.androidsdk.ui.PickerBottomSheetTest",
56+
"notClass com.salesforce.androidsdk.ui.LoginActivityTest",
57+
"notClass com.salesforce.androidsdk.ui.LoginOptionsActivityTest",
58+
"notClass com.salesforce.androidsdk.ui.PickerBottomSheetActivityTest",
59+
"notClass com.salesforce.androidsdk.ui.DevInfoActivityTest",
60+
"notClass com.salesforce.androidsdk.security.ScreenLockManagerTest",
61+
"notClass com.salesforce.androidsdk.security.BiometricAuthenticationManagerTest",
62+
"notClass com.salesforce.androidsdk.rest.RestRequestTest",
63+
"notClass com.salesforce.androidsdk.rest.ApiVersionStringsTest",
64+
"notClass com.salesforce.androidsdk.rest.ClientManagerMockTest",
65+
"notClass com.salesforce.androidsdk.rest.NotificationsTypesResponseBodyTest",
66+
"notClass com.salesforce.androidsdk.rest.NotificationsApiExceptionTest",
67+
"notClass com.salesforce.androidsdk.rest.NotificationsApiErrorResponseBodyTest",
68+
"notClass com.salesforce.androidsdk.rest.NotificationsActionsResponseBodyTest",
69+
"notClass com.salesforce.androidsdk.rest.files.RenditionTypeTest",
70+
"notClass com.salesforce.androidsdk.rest.files.ConnectUriBuilderTest",
71+
"notClass com.salesforce.androidsdk.rest.files.FileRequestsTest"
72+
]
73+
}
74+
]
75+
}

0 commit comments

Comments
 (0)