Skip to content

Use parallel>matrix operator for instrumented tests on different Android API versions #2717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 43 additions & 92 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ stages:
.snippets:
# macOS AMI will already have cmdline-tools installed
install-android-api-components:
- export ANDROID_EMULATOR_IMAGE="system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
- export ANDROID_PLATFORM="platforms;android-$ANDROID_API"
- export ANDROID_BUILD_TOOLS="build-tools;$ANDROID_API.0.0"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "emulator"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "platform-tools"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "$ANDROID_PLATFORM"
Expand Down Expand Up @@ -218,44 +221,18 @@ test:kover:
# TEST PYRAMID
# the steps in this section should reflect our test pyramid strategy

test-pyramid:core-it-min-api:
test-pyramid:core-it:
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
ANDROID_API: "21"
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-core-it-instrumented]

test-pyramid:core-it-latest-api:
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
ANDROID_API: "36"
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-core-it-instrumented]

test-pyramid:core-it-median-api:
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
ANDROID_API: "28"
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
parallel:
matrix:
- ANDROID_API: "21"
- ANDROID_API: "28"
- ANDROID_API: "36"
script:
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-core-it-instrumented]
- !reference [ .snippets, install-android-api-components ]
- !reference [ .snippets, run-core-it-instrumented ]

test-pyramid:single-fit-logs:
tags: [ "arch:amd64" ]
Expand Down Expand Up @@ -341,46 +318,20 @@ test-pyramid:single-fit-okhttp:
reports:
junit: "**/build/test-results/testReleaseUnitTest/*.xml"

# RUN INSTRUMENTED TESTS ON MIN API (21), LATEST API (34) and MEDIAN API (28)
# RUN INSTRUMENTED TESTS ON MIN API (21), LATEST API (36) and MEDIAN API (28)

test-pyramid:legacy-integration-instrumented-min-api:
test-pyramid:legacy-integration-instrumented:
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
ANDROID_API: "21"
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-legacy-integration-instrumented]

test-pyramid:legacy-integration-instrumented-latest-api:
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
ANDROID_API: "36"
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
parallel:
matrix:
- ANDROID_API: "21"
- ANDROID_API: "28"
- ANDROID_API: "36"
script:
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-legacy-integration-instrumented]

test-pyramid:legacy-integration-instrumented-median-api:
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
ANDROID_API: "28"
ANDROID_EMULATOR_IMAGE: "system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}"
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-legacy-integration-instrumented]
- !reference [ .snippets, install-android-api-components ]
- !reference [ .snippets, run-legacy-integration-instrumented ]

test-pyramid:detekt-api-coverage:
tags: [ "arch:amd64" ]
Expand Down Expand Up @@ -517,7 +468,7 @@ publish:release-core:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :dd-sdk-android-core:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand Down Expand Up @@ -553,7 +504,7 @@ publish:release-trace:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-trace:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -570,7 +521,7 @@ publish:release-trace-otel:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-trace-otel:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -587,7 +538,7 @@ publish:release-logs:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-logs:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -604,7 +555,7 @@ publish:release-rum:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-rum:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -621,7 +572,7 @@ publish:release-ndk:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-ndk:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -638,7 +589,7 @@ publish:release-session-replay:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-session-replay:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -655,7 +606,7 @@ publish:release-session-replay-material:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-session-replay-material:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -672,7 +623,7 @@ publish:release-session-replay-compose:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-session-replay-compose:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -689,7 +640,7 @@ publish:release-webview:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :features:dd-sdk-android-webview:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -710,7 +661,7 @@ publish:release-coil:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-coil:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -727,7 +678,7 @@ publish:release-compose:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-compose:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -744,7 +695,7 @@ publish:release-fresco:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-fresco:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -761,7 +712,7 @@ publish:release-glide:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-glide:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -778,7 +729,7 @@ publish:release-trace-coroutines:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-trace-coroutines:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -795,7 +746,7 @@ publish:release-rum-coroutines:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-rum-coroutines:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -812,7 +763,7 @@ publish:release-rx:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-rx:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -829,7 +780,7 @@ publish:release-sqldelight:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-sqldelight:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -846,7 +797,7 @@ publish:release-timber:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-timber:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -863,7 +814,7 @@ publish:release-android-tv:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-tv:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -880,7 +831,7 @@ publish:release-okhttp:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-okhttp:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -897,7 +848,7 @@ publish:release-okhttp-otel:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :integrations:dd-sdk-android-okhttp-otel:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand All @@ -916,7 +867,7 @@ publish:release-benchmark:
stage: publish
timeout: 30m
script:
- !reference [.snippets, set-publishing-credentials]
- !reference [ .snippets, set-publishing-credentials ]
- ./gradlew :tools:benchmark:publishToSonatype --stacktrace --no-daemon
artifacts:
when: on_success
Expand Down
Loading