File tree Expand file tree Collapse file tree 8 files changed +198
-20
lines changed
packages/amplify_core/android/src/test/kotlin/com/amazonaws/amplify/amplify_core Expand file tree Collapse file tree 8 files changed +198
-20
lines changed Original file line number Diff line number Diff line change
1
+ name : amplify_analytics_pinpoint Android
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ - stable
7
+ pull_request :
8
+ paths :
9
+ - ' packages/analytics/amplify_analytics_pinpoint/**/*.yaml'
10
+ - ' packages/analytics/amplify_analytics_pinpoint/android/**/*'
11
+ - ' packages/analytics/amplify_analytics_pinpoint/example/android/**/*'
12
+ - ' packages/analytics/amplify_analytics_pinpoint_android/**/*'
13
+ - ' .github/workflows/flutter_android.yaml'
14
+ - ' .github/workflows/amplify_analytics_pinpoint.android.yaml'
15
+ schedule :
16
+ - cron : " 0 0 * * 0" # Every Sunday at 00:00
17
+ defaults :
18
+ run :
19
+ shell : bash
20
+ permissions : read-all
21
+
22
+ jobs :
23
+ test :
24
+ uses : ./.github/workflows/flutter_android.yaml
25
+ with :
26
+ working-directory : packages/analytics/amplify_analytics_pinpoint_android/example/android
27
+ package-name : amplify_analytics_pinpoint
Original file line number Diff line number Diff line change
1
+ name : amplify_api Android
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ - stable
7
+ pull_request :
8
+ paths :
9
+ - ' packages/api/amplify_api/**/*.yaml'
10
+ - ' packages/api/amplify_api/android/**/*'
11
+ - ' packages/api/amplify_api/example/android/**/*'
12
+ - ' packages/api/amplify_api_android/**/*'
13
+ - ' .github/workflows/flutter_android.yaml'
14
+ - ' .github/workflows/amplify_api.android.yaml'
15
+ schedule :
16
+ - cron : " 0 0 * * 0" # Every Sunday at 00:00
17
+ defaults :
18
+ run :
19
+ shell : bash
20
+ permissions : read-all
21
+
22
+ jobs :
23
+ test :
24
+ uses : ./.github/workflows/flutter_android.yaml
25
+ with :
26
+ working-directory : packages/api/amplify_api_android/example/android
27
+ package-name : amplify_api
Original file line number Diff line number Diff line change
1
+ name : amplify_auth_cognito Android
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ - stable
7
+ pull_request :
8
+ paths :
9
+ - ' packages/auth/amplify_auth_cognito/**/*.yaml'
10
+ - ' packages/auth/amplify_auth_cognito/android/**/*'
11
+ - ' packages/auth/amplify_auth_cognito/example/android/**/*'
12
+ - ' packages/auth/amplify_auth_cognito_android/**/*'
13
+ - ' .github/workflows/flutter_android.yaml'
14
+ - ' .github/workflows/amplify_auth_cognito.android.yaml'
15
+ schedule :
16
+ - cron : " 0 0 * * 0" # Every Sunday at 00:00
17
+ defaults :
18
+ run :
19
+ shell : bash
20
+ permissions : read-all
21
+
22
+ jobs :
23
+ test :
24
+ uses : ./.github/workflows/flutter_android.yaml
25
+ with :
26
+ working-directory : packages/auth/amplify_auth_cognito_android/example/android
27
+ package-name : amplify_auth_cognito
Original file line number Diff line number Diff line change
1
+ name : amplify_core Android
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ - stable
7
+ pull_request :
8
+ paths :
9
+ - ' packages/amplify_core/**/*.yaml'
10
+ - ' packages/amplify_core/android/**/*'
11
+ - ' packages/amplify_core/example/android/**/*'
12
+ - ' .github/workflows/flutter_android.yaml'
13
+ - ' .github/workflows/amplify_core.android.yaml'
14
+ schedule :
15
+ - cron : " 0 0 * * 0" # Every Sunday at 00:00
16
+ defaults :
17
+ run :
18
+ shell : bash
19
+ permissions : read-all
20
+
21
+ jobs :
22
+ test :
23
+ uses : ./.github/workflows/flutter_android.yaml
24
+ with :
25
+ working-directory : packages/amplify_core/example/android
26
+ package-name : amplify_core
Original file line number Diff line number Diff line change
1
+ name : amplify_datastore Android
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ - stable
7
+ pull_request :
8
+ paths :
9
+ - ' packages/amplify_datastore/**/*.yaml'
10
+ - ' packages/amplify_datastore/android/**/*'
11
+ - ' packages/amplify_datastore/example/android/**/*'
12
+ - ' .github/workflows/flutter_android.yaml'
13
+ - ' .github/workflows/amplify_datastore.android.yaml'
14
+ schedule :
15
+ - cron : " 0 0 * * 0" # Every Sunday at 00:00
16
+ defaults :
17
+ run :
18
+ shell : bash
19
+ permissions : read-all
20
+
21
+ jobs :
22
+ test :
23
+ uses : ./.github/workflows/flutter_android.yaml
24
+ with :
25
+ working-directory : packages/amplify_datastore/example/android
26
+ package-name : amplify_datastore
Original file line number Diff line number Diff line change
1
+ name : amplify_flutter Android
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ - stable
7
+ pull_request :
8
+ paths :
9
+ - ' packages/amplify/amplify_flutter/**/*.yaml'
10
+ - ' packages/amplify/amplify_flutter/android/**/*'
11
+ - ' packages/amplify/amplify_flutter/example/android/**/*'
12
+ - ' packages/amplify/amplify_flutter_android/**/*'
13
+ - ' .github/workflows/flutter_android.yaml'
14
+ - ' .github/workflows/amplify_flutter.android.yaml'
15
+ schedule :
16
+ - cron : " 0 0 * * 0" # Every Sunday at 00:00
17
+ defaults :
18
+ run :
19
+ shell : bash
20
+ permissions : read-all
21
+
22
+ jobs :
23
+ test :
24
+ uses : ./.github/workflows/flutter_android.yaml
25
+ with :
26
+ working-directory : packages/amplify/amplify_flutter_android/example/android
27
+ package-name : amplify_flutter
Original file line number Diff line number Diff line change
1
+ name : Flutter Android
2
+ on :
3
+ workflow_call :
4
+ inputs :
5
+ working-directory :
6
+ description : The working directory relative to the repo root
7
+ required : true
8
+ type : string
9
+ package-name :
10
+ description : The name of the app-facing package being tested
11
+ required : true
12
+ type : string
13
+
14
+ jobs :
15
+ test :
16
+ name : Test
17
+ runs-on : ubuntu-latest
18
+ timeout-minutes : 60
19
+ steps :
20
+ - name : Git Checkout
21
+ uses : actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # 3.1.0
22
+
23
+ - name : Setup Flutter
24
+ uses : subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d # 2.8.0
25
+ with :
26
+ cache : true
27
+
28
+ - name : Install Melos and Bootstrap
29
+ timeout-minutes : 10
30
+ run : |
31
+ flutter pub global activate melos 1.3.0
32
+ melos bootstrap
33
+
34
+ - name : Run Android unit tests
35
+ run : |
36
+ flutter build apk --debug --verbose
37
+ ./gradlew :"${{ inputs.package-name}}":testDebugUnitTest
38
+ working-directory : ${{ inputs.working-directory }}
Original file line number Diff line number Diff line change 15
15
package com.amazonaws.amplify.amplify_core
16
16
17
17
import io.flutter.plugin.common.MethodChannel
18
- import kotlinx.coroutines.Dispatchers
19
18
import kotlinx.coroutines.ExperimentalCoroutinesApi
20
- import kotlinx.coroutines.Job
21
- import kotlinx.coroutines.launch
22
19
import kotlinx.coroutines.test.runBlockingTest
23
20
import org.junit.Rule
24
21
import org.junit.Test
@@ -66,21 +63,4 @@ class AtomicResultTest {
66
63
atomicResult.success(null )
67
64
verify(mockResult, times(1 )).success(any())
68
65
}
69
-
70
- @Test
71
- fun multipleConcurrentRepliesAreNotSent () = coroutinesTestRule.testDispatcher.runBlockingTest {
72
- val atomicResult = AtomicResult (mockResult, " multipleConcurrentRepliesAreNotSent" )
73
- val jobs = mutableListOf<Job >()
74
- for (i in 0 .. 10 ) {
75
- val job = launch(Dispatchers .IO ) {
76
- atomicResult.success(null )
77
- }
78
- jobs.add(job)
79
- }
80
- // Block til jobs complete
81
- jobs.forEach {
82
- it.join()
83
- }
84
- verify(mockResult, times(1 )).success(any())
85
- }
86
66
}
You can’t perform that action at this time.
0 commit comments