Skip to content

Commit

Permalink
Fix integration tests pipeline for API 21
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusc83 committed Aug 16, 2024
1 parent 2529684 commit a114bd5
Show file tree
Hide file tree
Showing 21 changed files with 78 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ stages:
- echo "no" | ~/android_sdk/cmdline-tools/latest/bin/avdmanager --verbose create avd --force --name "$EMULATOR_NAME" --package "$ANDROID_EMULATOR_IMAGE"
run-instrumented-integration:
- $ANDROID_HOME/emulator/emulator -avd "$EMULATOR_NAME" -grpc-use-jwt -no-snapstorage -no-audio -no-window -no-boot-anim -verbose -qemu -machine virt &
- GRADLE_OPTS="-Xmx3072m" ./gradlew :instrumented:integration:assembleDebug :instrumented:integration:assembleDebugAndroidTest --stacktrace --no-daemon
- GRADLE_OPTS="-Xmx3072m" ./gradlew :instrumented:integration:assembleDebug :instrumented:integration:assembleDebugAndroidTest --stacktrace --no-daemon $( (( $ANDROID_API <= 23 )) && echo "-Puse-api21-java-backport -Puse-desugaring" )
- set +e
- $ANDROID_HOME/platform-tools/adb install -t -d $( (( $ANDROID_API >= 23 )) && echo "-g" ) -r instrumented/integration/build/outputs/apk/androidTest/debug/integration-debug-androidTest.apk
- $ANDROID_HOME/platform-tools/adb install -t -d $( (( $ANDROID_API >= 23 )) && echo "-g" ) -r instrumented/integration/build/outputs/apk/debug/integration-debug.apk
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/com/datadog/gradle/Properties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ package com.datadog.gradle
object Properties {
// needed to bring some classes into classpath which are missing on the lower APIs
const val USE_API21_JAVA_BACKPORT = "use-api21-java-backport"
const val USE_DESUGARING = "use-desugaring"
}
6 changes: 6 additions & 0 deletions instrumented/integration/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ android {

compileOptions {
java17()
if (project.hasProperty(com.datadog.gradle.Properties.USE_DESUGARING)) {
isCoreLibraryDesugaringEnabled = true
}
}

packaging {
Expand Down Expand Up @@ -92,6 +95,9 @@ repositories {
}

dependencies {
if (project.hasProperty(com.datadog.gradle.Properties.USE_DESUGARING)) {
coreLibraryDesugaring(libs.androidDesugaringSdk)
}
implementation(project(":features:dd-sdk-android-session-replay"))
implementation(project(":features:dd-sdk-android-logs"))
implementation(project(":features:dd-sdk-android-trace"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayRadioCheck
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -26,7 +27,9 @@ internal class SrCheckBoxAndRadioFieldsAllowTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayRadioCheck
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -26,7 +27,9 @@ internal class SrCheckBoxAndRadioFieldsMaskTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayRadioCheck
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -26,7 +27,9 @@ internal class SrCheckBoxAndRadioFieldsMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal class SrImageButtonsAllowTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Ignore("Flakiness in CI, unsolved yet")
@Test
fun assessRecordedScreenPayload() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal class SrImageButtonsMaskTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Ignore("Flakiness in CI, unsolved yet")
@Test
fun assessRecordedScreenPayload() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal class SrImageButtonsMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Ignore("Flakiness in CI, unsolved yet")
@Test
fun assessRecordedScreenPayload() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActi
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -26,7 +27,9 @@ internal class SrImagesAllowTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActi
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -26,7 +27,9 @@ internal class SrImagesMaskTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActi
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -26,7 +27,9 @@ internal class SrImagesMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplaySensitiveF
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -25,7 +26,9 @@ internal class SrSensitiveFieldsAllowTest : BaseSessionReplayTest<SessionReplayS
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplaySensitiveF
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -25,7 +26,9 @@ internal class SrSensitiveFieldsMaskTest : BaseSessionReplayTest<SessionReplaySe
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplaySensitiveF
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -25,7 +26,9 @@ internal class SrSensitiveFieldsMaskUserInputTest : BaseSessionReplayTest<Sessio
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayTextFields
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -25,7 +26,9 @@ internal class SrTextFieldsAllowTest : BaseSessionReplayTest<SessionReplayTextFi
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayTextFields
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -25,7 +26,9 @@ internal class SrTextFieldsMaskTest : BaseSessionReplayTest<SessionReplayTextFie
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayTextFields
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -25,7 +26,9 @@ internal class SrTextFieldsMaskUserInputTest : BaseSessionReplayTest<SessionRepl
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.datadog.android.sdk.integration.sessionreplay.SessionReplayTextFields
import com.datadog.android.sdk.rules.SessionReplayTestRule
import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL
import com.datadog.android.sessionreplay.SessionReplayPrivacy
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

Expand All @@ -26,7 +27,9 @@ internal class SrTextFieldsWithInputMaskUserInputTest :
intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT)
)

// TODO: RUM-0000 Fix these tests and remove the @Ignore annotation
@Test
@Ignore("These tests were not maintained anymore and they need to be fixed")
fun assessRecordedScreenPayload() {
runInstrumentationScenario()
assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule)
Expand Down
14 changes: 14 additions & 0 deletions tools/javabackport/src/main/kotlin/java/nio/file/Path.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@file:Suppress("PackageNaming")

/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2016-Present Datadog, Inc.
*/

package java.nio.file

/**
* A fake placeholder class to let AssertJ work in instrumented tests for API<24.
*/
class Path
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@file:Suppress("PackageNaming", "EmptyClassBlock")

/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2016-Present Datadog, Inc.
*/

package java.util.concurrent.atomic

/**
* A fake placeholder class to let AssertJ work in instrumented tests for API<24.
*/
class LongAdder

0 comments on commit a114bd5

Please sign in to comment.