Skip to content
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

Data scratch - android test matrix #1754

Closed
jan-goral opened this issue Mar 29, 2021 · 1 comment · Fixed by #1941
Closed

Data scratch - android test matrix #1754

jan-goral opened this issue Mar 29, 2021 · 1 comment · Fixed by #1941

Comments

@jan-goral
Copy link
Contributor

Plan

According to the specification described in epic #1727
add abstraction and implementation for the following part of the data layer:

Abstraction

ftl/data/TestMatrixAndroid.kt

package ftl.data

val executeTestMatrixAndroid: TestMatrixAndroid.Execute get() = TODO()

object TestMatrixAndroid {

    data class Config(
        // args
        val clientDetails: Map<String, String>?,
        val resultsBucket: String,
        val autoGoogleLogin: Boolean,
        val networkProfile: String?,
        val directoriesToPull: List<String>,
        val obbNames: List<String>,
        val environmentVariables: Map<String, String>,
        val autograntPermissions: Boolean,
        val testTimeout: String,
        val performanceMetrics: Boolean,
        val recordVideo: Boolean,
        val flakyTestAttempts: Int,
        val failFast: Boolean,
        val project: String,
        val resultsHistoryName: String?,

        // build
        val otherFiles: Map<String, String>,
        val runGcsPath: String,
        val devices: List<Device>,
        val additionalApkGcsPaths: List<String>,
        val obbFiles: Map<String, String>,
    )

    sealed class Type {
        data class Instrumentation(
            val appApkGcsPath: String,
            val testApkGcsPath: String,
            val testRunnerClass: String?,
            val orchestratorOption: String?,
            // sharding
            val disableSharding: Boolean,
            val testShards: ShardChunks,
            val numUniformShards: Int?,
            val keepTestTargetsEmpty: Boolean,
            val environmentVariables: Map<String, String> = emptyMap(),
            val testTargetsForShard: ShardChunks
        ) : Type()

        data class Robo(
            val appApkGcsPath: String,
            val flankRoboDirectives: List<FlankRoboDirective>?,
            val roboScriptGcsPath: String?
        ) : Type()

        data class GameLoop(
            val appApkGcsPath: String,
            val testRunnerClass: String?,
            val scenarioNumbers: List<String>,
            val scenarioLabels: List<String>
        ) : Type()
    }

    interface Execute : (Config, Type) -> TestMatrix.Result
}

Target

  • AndroidRunCommand -> AndroidArgs/runAndroidTests -> GcAndroidTestMatrix/build
  • AndroidTestConfig

Adapter

ftl/adapter/GoogleTestMatrixAndroid.kt

@adamfilipow92
Copy link
Contributor

Paused because first, we need to implement #1756

@piotradamczyk5 piotradamczyk5 self-assigned this May 12, 2021
@mergify mergify bot closed this as completed in #1941 May 18, 2021
mergify bot pushed a commit that referenced this issue May 18, 2021
Fixes #1754

## Test Plan
> How do we know the code works?

- code is refactored according to the description provided in #1754 with a change 
    `interface Execute : (Config, Type) -> TestMatrix.Result` ->  `interface Execute : (Config, List<Type>) -> <TestMatrix.Data>`
- all runs of `flank firebase test android run ... ` work without any problems like previously

## Checklist

- [x] Unit tested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants