avito-android

Форк
0
1
package com.avito.instrumentation
2

3
import com.avito.instrumentation.configuration.report.ReportConfig
4

5
internal fun kotlinStubConfig(reportConfig: ReportConfig) = """
6
  |android {
7
  |    defaultConfig {
8
  |        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
9
  |        testInstrumentationRunnerArguments(
10
  |            mapOf(
11
  |                "override" to "createdInInstrumentationRunnerArguments",
12
  |                "expectedCustomParam" to "value"
13
  |            )
14
  |        )
15
  |    }
16
  |}
17
  |
18
  |instrumentation {
19
  |  
20
  |    outputDir.set(rootProject.file("outputs"))
21
  |
22
  |    instrumentationParams = mapOf(
23
  |        "override" to "overrideInPlugin"
24
  |    )
25
  |    report.set(${
26
    when (reportConfig) {
27
        ReportConfig.NoOp -> "ReportConfig.NoOp"
28
        is ReportConfig.ReportViewer.SendFromDevice -> """
29
  |      ReportConfig.ReportViewer.SendFromDevice(  
30
  |         reportApiUrl = "${reportConfig.reportApiUrl}",
31
  |         reportViewerUrl = "${reportConfig.reportViewerUrl}",
32
  |         fileStorageUrl = "${reportConfig.fileStorageUrl}",
33
  |         planSlug = "${reportConfig.planSlug}",
34
  |         jobSlug = "${reportConfig.jobSlug}"
35
  |    )
36
    """.trimMargin()
37
        is ReportConfig.ReportViewer.SendFromRunner -> """
38
  |      ReportConfig.ReportViewer.SendFromRunner(  
39
  |         reportApiUrl = "${reportConfig.reportApiUrl}",
40
  |         reportViewerUrl = "${reportConfig.reportViewerUrl}",
41
  |         fileStorageUrl = "${reportConfig.fileStorageUrl}",
42
  |         planSlug = "${reportConfig.planSlug}",
43
  |         jobSlug = "${reportConfig.jobSlug}"
44
  |    )
45
    """.trimMargin()
46
    }
47
})
48
  |
49
  |    configurations {
50
  |        register("functional") {
51
  |            instrumentationParams = mapOf(
52
  |                "configuration" to "functional",
53
  |                "override" to "overrideInConfiguration"
54
  |            )
55
  |            jobSlug.set("override jobSlug")
56
  |            suppressFlaky.set(true)
57
  |            suppressFailure.set(true)
58
  |            
59
  |            targets {
60
  |                register("api22") {
61
  |                    instrumentationParams = mapOf(
62
  |                        "deviceName" to "invalid",
63
  |                        "target" to "yes",
64
  |                        "override" to "overrideInTarget"
65
  |                    )
66
  |
67
  |                    deviceName = "api22"
68
  |
69
  |                    scheduling {
70
  |                        quota {
71
  |                            minimumSuccessCount = 1
72
  |                        }
73
  |
74
  |                        staticDevicesReservation {
75
  |                            device = Device.LocalEmulator.device(27)
76
  |                            count = 1
77
  |                        }
78
  |                    }
79
  |                }
80
  |            }
81
  |        }
82
  |    }
83
  |    
84
  |    environments {
85
  |       register<com.avito.instrumentation.configuration.KubernetesViaContext>("k8sContext") {
86
  |         context.set("beta")
87
  |         namespace.set("default")
88
  |       }
89
  |       register<com.avito.instrumentation.configuration.KubernetesViaCredentials>("k8sCredentials") {
90
  |         token.set("q1w2e3")
91
  |         url.set("myk8s.com")
92
  |         namespace.set("default")
93
  |       }
94
  |    }
95
  |}
96
  |""".trimMargin()
97

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.