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 - test matrix #1756

Closed
jan-goral opened this issue Mar 29, 2021 · 0 comments · Fixed by #1901
Closed

Data scratch - test matrix #1756

jan-goral opened this issue Mar 29, 2021 · 0 comments · Fixed by #1901

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/TestMatrix.kt

val refreshTestMatrix: TestMatrix.Refresh get() = TODO()
val cancelTestMatrix: TestMatrix.Cancel get() = TODO()
val fetchTestMatrixSummary: TestMatrix.Summary.Fetch get() = TODO()

object TestMatrix {

    data class Result(
        val runPath: String,
        val map: Map<String, Data>,
    )

    data class Data(
        val matrixId: String = "",
        val state: String = "",
        val gcsPath: String = "",
        val webLink: String = "",
        val downloaded: Boolean = false,
        val billableMinutes: BillableMinutes = BillableMinutes(),
        val clientDetails: Map<String, String>? = null,
        val gcsPathWithoutRootBucket: String = "",
        val gcsRootBucket: String = "",
        val webLinkWithoutExecutionDetails: String? = "",
        val axes: List<Outcome> = emptyList()
    )

    data class Outcome(
        val device: String = "",
        val outcome: String = "",
        val details: String = "",
        val suiteOverview: SuiteOverview = SuiteOverview()
    )

    data class SuiteOverview(
        val total: Int = 0,
        val errors: Int = 0,
        val failures: Int = 0,
        val flakes: Int = 0,
        val skipped: Int = 0,
        val elapsedTime: Double = 0.0,
        val overheadTime: Double = 0.0
    )

    data class BillableMinutes(
        val virtual: Long = 0,
        val physical: Long = 0
    )

    data class Summary(
        val billableMinutes: BillableMinutes,
        val axes: List<Outcome>,
    ) {
        data class Identity(
            val projectId: String,
            val historyId: String,
            val executionId: String,
        )

        interface Fetch : (Identity) -> Summary
    }

    data class Identity(
        val matrixId: String,
        val projectId: String,
    )

    interface Cancel : (Identity) -> Unit
    interface Refresh : (Identity) -> Data
}

Target

  • SavedMatrix
  • TestOutcome
  • TestSuiteOverviewData
  • MatrixMap
  • CancelCommand -> cancelLastRun -> cancelMatrices -> GcTestMatrix/cancel
  • RefreshCommand -> refreshLastRun
    • refreshMatrices
      • GcTestMatrix/refresh
      • SavedMatrix/updateWithMatrix -> SavedMatrix/updatedSavedMatrix -> TestMatrix/fetchTestOutcomeContext
  • newTestRun
    • pollMatrices -> matrixChangesFlow -> GcTestMatrix/refresh
    • Iterable<TestMatrix>/updateMatrixMap -> SavedMatrix/updateWithMatrix -> TestMatrix/fetchTestOutcomeContext
    • ReportManager/generate
      • ReportManager/parseTestSuite
        • refreshMatricesAndGetExecutions -> refreshTestMatrices -> GcTestMatrix/refresh

Adapter

ftl/adapter/GoogleTestMatrixCancel.kt
ftl/adapter/GoogleTestMatrixRefresh.kt

@adamfilipow92 adamfilipow92 self-assigned this Apr 26, 2021
@piotradamczyk5 piotradamczyk5 self-assigned this May 4, 2021
@mergify mergify bot closed this as completed in #1901 May 11, 2021
mergify bot pushed a commit that referenced this issue May 11, 2021
Fixes #1756 

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

* All tests pass
* Flank works as before

## Checklist

- [X] Unit tests updated
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