Skip to content

Commit 9d272e5

Browse files
committed
Use parallel>matrix operator for instrumented tests on different Android API versions
1 parent dc4ab79 commit 9d272e5

File tree

1 file changed

+60
-94
lines changed

1 file changed

+60
-94
lines changed

.gitlab-ci.yml

Lines changed: 60 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -218,44 +218,27 @@ test:kover:
218218
# TEST PYRAMID
219219
# the steps in this section should reflect our test pyramid strategy
220220

221-
test-pyramid:core-it-min-api:
221+
test-pyramid:core-it:
222222
tags: [ "macos:sonoma", "specific:true" ]
223223
stage: test-pyramid
224224
timeout: 1h
225-
variables:
226-
ANDROID_API: "21"
227-
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
228-
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
229-
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
230-
script:
231-
- !reference [.snippets, install-android-api-components]
232-
- !reference [.snippets, run-core-it-instrumented]
233-
234-
test-pyramid:core-it-latest-api:
235-
tags: [ "macos:sonoma", "specific:true" ]
236-
stage: test-pyramid
237-
timeout: 1h
238-
variables:
239-
ANDROID_API: "36"
240-
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
241-
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
242-
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
243-
script:
244-
- !reference [.snippets, install-android-api-components]
245-
- !reference [.snippets, run-core-it-instrumented]
246-
247-
test-pyramid:core-it-median-api:
248-
tags: [ "macos:sonoma", "specific:true" ]
249-
stage: test-pyramid
250-
timeout: 1h
251-
variables:
252-
ANDROID_API: "28"
253-
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
254-
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
255-
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
256-
script:
257-
- !reference [.snippets, install-android-api-components]
258-
- !reference [.snippets, run-core-it-instrumented]
225+
parallel:
226+
matrix:
227+
- ANDROID_API: "21"
228+
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
229+
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
230+
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
231+
- ANDROID_API: "28"
232+
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
233+
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
234+
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
235+
- ANDROID_API: "36"
236+
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
237+
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
238+
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
239+
script:
240+
- !reference [ .snippets, install-android-api-components ]
241+
- !reference [ .snippets, run-core-it-instrumented ]
259242

260243
test-pyramid:single-fit-logs:
261244
tags: [ "arch:amd64" ]
@@ -341,46 +324,29 @@ test-pyramid:single-fit-okhttp:
341324
reports:
342325
junit: "**/build/test-results/testReleaseUnitTest/*.xml"
343326

344-
# RUN INSTRUMENTED TESTS ON MIN API (21), LATEST API (34) and MEDIAN API (28)
327+
# RUN INSTRUMENTED TESTS ON MIN API (21), LATEST API (36) and MEDIAN API (28)
345328

346-
test-pyramid:legacy-integration-instrumented-min-api:
329+
test-pyramid:legacy-integration-instrumented:
347330
tags: [ "macos:sonoma", "specific:true" ]
348331
stage: test-pyramid
349332
timeout: 1h
350-
variables:
351-
ANDROID_API: "21"
352-
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
353-
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
354-
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
355-
script:
356-
- !reference [.snippets, install-android-api-components]
357-
- !reference [.snippets, run-legacy-integration-instrumented]
358-
359-
test-pyramid:legacy-integration-instrumented-latest-api:
360-
tags: [ "macos:sonoma", "specific:true" ]
361-
stage: test-pyramid
362-
timeout: 1h
363-
variables:
364-
ANDROID_API: "36"
365-
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
366-
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
367-
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
368-
script:
369-
- !reference [.snippets, install-android-api-components]
370-
- !reference [.snippets, run-legacy-integration-instrumented]
371-
372-
test-pyramid:legacy-integration-instrumented-median-api:
373-
tags: [ "macos:sonoma", "specific:true" ]
374-
stage: test-pyramid
375-
timeout: 1h
376-
variables:
377-
ANDROID_API: "28"
378-
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
379-
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
380-
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
381-
script:
382-
- !reference [.snippets, install-android-api-components]
383-
- !reference [.snippets, run-legacy-integration-instrumented]
333+
parallel:
334+
matrix:
335+
- ANDROID_API: "21"
336+
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
337+
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
338+
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
339+
- ANDROID_API: "28"
340+
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
341+
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
342+
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
343+
- ANDROID_API: "36"
344+
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
345+
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
346+
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
347+
script:
348+
- !reference [ .snippets, install-android-api-components ]
349+
- !reference [ .snippets, run-legacy-integration-instrumented ]
384350

385351
test-pyramid:detekt-api-coverage:
386352
tags: [ "arch:amd64" ]
@@ -517,7 +483,7 @@ publish:release-core:
517483
stage: publish
518484
timeout: 30m
519485
script:
520-
- !reference [.snippets, set-publishing-credentials]
486+
- !reference [ .snippets, set-publishing-credentials ]
521487
- ./gradlew :dd-sdk-android-core:publishToSonatype --stacktrace --no-daemon
522488
artifacts:
523489
when: on_success
@@ -553,7 +519,7 @@ publish:release-trace:
553519
stage: publish
554520
timeout: 30m
555521
script:
556-
- !reference [.snippets, set-publishing-credentials]
522+
- !reference [ .snippets, set-publishing-credentials ]
557523
- ./gradlew :features:dd-sdk-android-trace:publishToSonatype --stacktrace --no-daemon
558524
artifacts:
559525
when: on_success
@@ -570,7 +536,7 @@ publish:release-trace-otel:
570536
stage: publish
571537
timeout: 30m
572538
script:
573-
- !reference [.snippets, set-publishing-credentials]
539+
- !reference [ .snippets, set-publishing-credentials ]
574540
- ./gradlew :features:dd-sdk-android-trace-otel:publishToSonatype --stacktrace --no-daemon
575541
artifacts:
576542
when: on_success
@@ -587,7 +553,7 @@ publish:release-logs:
587553
stage: publish
588554
timeout: 30m
589555
script:
590-
- !reference [.snippets, set-publishing-credentials]
556+
- !reference [ .snippets, set-publishing-credentials ]
591557
- ./gradlew :features:dd-sdk-android-logs:publishToSonatype --stacktrace --no-daemon
592558
artifacts:
593559
when: on_success
@@ -604,7 +570,7 @@ publish:release-rum:
604570
stage: publish
605571
timeout: 30m
606572
script:
607-
- !reference [.snippets, set-publishing-credentials]
573+
- !reference [ .snippets, set-publishing-credentials ]
608574
- ./gradlew :features:dd-sdk-android-rum:publishToSonatype --stacktrace --no-daemon
609575
artifacts:
610576
when: on_success
@@ -621,7 +587,7 @@ publish:release-ndk:
621587
stage: publish
622588
timeout: 30m
623589
script:
624-
- !reference [.snippets, set-publishing-credentials]
590+
- !reference [ .snippets, set-publishing-credentials ]
625591
- ./gradlew :features:dd-sdk-android-ndk:publishToSonatype --stacktrace --no-daemon
626592
artifacts:
627593
when: on_success
@@ -638,7 +604,7 @@ publish:release-session-replay:
638604
stage: publish
639605
timeout: 30m
640606
script:
641-
- !reference [.snippets, set-publishing-credentials]
607+
- !reference [ .snippets, set-publishing-credentials ]
642608
- ./gradlew :features:dd-sdk-android-session-replay:publishToSonatype --stacktrace --no-daemon
643609
artifacts:
644610
when: on_success
@@ -655,7 +621,7 @@ publish:release-session-replay-material:
655621
stage: publish
656622
timeout: 30m
657623
script:
658-
- !reference [.snippets, set-publishing-credentials]
624+
- !reference [ .snippets, set-publishing-credentials ]
659625
- ./gradlew :features:dd-sdk-android-session-replay-material:publishToSonatype --stacktrace --no-daemon
660626
artifacts:
661627
when: on_success
@@ -672,7 +638,7 @@ publish:release-session-replay-compose:
672638
stage: publish
673639
timeout: 30m
674640
script:
675-
- !reference [.snippets, set-publishing-credentials]
641+
- !reference [ .snippets, set-publishing-credentials ]
676642
- ./gradlew :features:dd-sdk-android-session-replay-compose:publishToSonatype --stacktrace --no-daemon
677643
artifacts:
678644
when: on_success
@@ -689,7 +655,7 @@ publish:release-webview:
689655
stage: publish
690656
timeout: 30m
691657
script:
692-
- !reference [.snippets, set-publishing-credentials]
658+
- !reference [ .snippets, set-publishing-credentials ]
693659
- ./gradlew :features:dd-sdk-android-webview:publishToSonatype --stacktrace --no-daemon
694660
artifacts:
695661
when: on_success
@@ -710,7 +676,7 @@ publish:release-coil:
710676
stage: publish
711677
timeout: 30m
712678
script:
713-
- !reference [.snippets, set-publishing-credentials]
679+
- !reference [ .snippets, set-publishing-credentials ]
714680
- ./gradlew :integrations:dd-sdk-android-coil:publishToSonatype --stacktrace --no-daemon
715681
artifacts:
716682
when: on_success
@@ -727,7 +693,7 @@ publish:release-compose:
727693
stage: publish
728694
timeout: 30m
729695
script:
730-
- !reference [.snippets, set-publishing-credentials]
696+
- !reference [ .snippets, set-publishing-credentials ]
731697
- ./gradlew :integrations:dd-sdk-android-compose:publishToSonatype --stacktrace --no-daemon
732698
artifacts:
733699
when: on_success
@@ -744,7 +710,7 @@ publish:release-fresco:
744710
stage: publish
745711
timeout: 30m
746712
script:
747-
- !reference [.snippets, set-publishing-credentials]
713+
- !reference [ .snippets, set-publishing-credentials ]
748714
- ./gradlew :integrations:dd-sdk-android-fresco:publishToSonatype --stacktrace --no-daemon
749715
artifacts:
750716
when: on_success
@@ -761,7 +727,7 @@ publish:release-glide:
761727
stage: publish
762728
timeout: 30m
763729
script:
764-
- !reference [.snippets, set-publishing-credentials]
730+
- !reference [ .snippets, set-publishing-credentials ]
765731
- ./gradlew :integrations:dd-sdk-android-glide:publishToSonatype --stacktrace --no-daemon
766732
artifacts:
767733
when: on_success
@@ -778,7 +744,7 @@ publish:release-trace-coroutines:
778744
stage: publish
779745
timeout: 30m
780746
script:
781-
- !reference [.snippets, set-publishing-credentials]
747+
- !reference [ .snippets, set-publishing-credentials ]
782748
- ./gradlew :integrations:dd-sdk-android-trace-coroutines:publishToSonatype --stacktrace --no-daemon
783749
artifacts:
784750
when: on_success
@@ -795,7 +761,7 @@ publish:release-rum-coroutines:
795761
stage: publish
796762
timeout: 30m
797763
script:
798-
- !reference [.snippets, set-publishing-credentials]
764+
- !reference [ .snippets, set-publishing-credentials ]
799765
- ./gradlew :integrations:dd-sdk-android-rum-coroutines:publishToSonatype --stacktrace --no-daemon
800766
artifacts:
801767
when: on_success
@@ -812,7 +778,7 @@ publish:release-rx:
812778
stage: publish
813779
timeout: 30m
814780
script:
815-
- !reference [.snippets, set-publishing-credentials]
781+
- !reference [ .snippets, set-publishing-credentials ]
816782
- ./gradlew :integrations:dd-sdk-android-rx:publishToSonatype --stacktrace --no-daemon
817783
artifacts:
818784
when: on_success
@@ -829,7 +795,7 @@ publish:release-sqldelight:
829795
stage: publish
830796
timeout: 30m
831797
script:
832-
- !reference [.snippets, set-publishing-credentials]
798+
- !reference [ .snippets, set-publishing-credentials ]
833799
- ./gradlew :integrations:dd-sdk-android-sqldelight:publishToSonatype --stacktrace --no-daemon
834800
artifacts:
835801
when: on_success
@@ -846,7 +812,7 @@ publish:release-timber:
846812
stage: publish
847813
timeout: 30m
848814
script:
849-
- !reference [.snippets, set-publishing-credentials]
815+
- !reference [ .snippets, set-publishing-credentials ]
850816
- ./gradlew :integrations:dd-sdk-android-timber:publishToSonatype --stacktrace --no-daemon
851817
artifacts:
852818
when: on_success
@@ -863,7 +829,7 @@ publish:release-android-tv:
863829
stage: publish
864830
timeout: 30m
865831
script:
866-
- !reference [.snippets, set-publishing-credentials]
832+
- !reference [ .snippets, set-publishing-credentials ]
867833
- ./gradlew :integrations:dd-sdk-android-tv:publishToSonatype --stacktrace --no-daemon
868834
artifacts:
869835
when: on_success
@@ -880,7 +846,7 @@ publish:release-okhttp:
880846
stage: publish
881847
timeout: 30m
882848
script:
883-
- !reference [.snippets, set-publishing-credentials]
849+
- !reference [ .snippets, set-publishing-credentials ]
884850
- ./gradlew :integrations:dd-sdk-android-okhttp:publishToSonatype --stacktrace --no-daemon
885851
artifacts:
886852
when: on_success
@@ -897,7 +863,7 @@ publish:release-okhttp-otel:
897863
stage: publish
898864
timeout: 30m
899865
script:
900-
- !reference [.snippets, set-publishing-credentials]
866+
- !reference [ .snippets, set-publishing-credentials ]
901867
- ./gradlew :integrations:dd-sdk-android-okhttp-otel:publishToSonatype --stacktrace --no-daemon
902868
artifacts:
903869
when: on_success
@@ -916,7 +882,7 @@ publish:release-benchmark:
916882
stage: publish
917883
timeout: 30m
918884
script:
919-
- !reference [.snippets, set-publishing-credentials]
885+
- !reference [ .snippets, set-publishing-credentials ]
920886
- ./gradlew :tools:benchmark:publishToSonatype --stacktrace --no-daemon
921887
artifacts:
922888
when: on_success

0 commit comments

Comments
 (0)