flutter / flutter/devtools

Clean up integration test sharding

未关闭
#6,386 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
infra integration tests P3 tech debt
主要语言
Dart
星标
1.7k
派生
404
平均合并
6 天 17 小时
30 天内合并 PR
18

描述

Right now, we have an ugly matrix to implement the sharding: https://github.com/flutter/devtools/pull/6385

To improve this we could pull out the integration test into it's own callable workflow that we pass a shard number to:

Calling the 3 devices would then look something like this;
```
  flutter-integration-test:
    name: integration-test ${{ matrix.bot }} - flutter
    needs: flutter-prep
    runs-on: macos-latest

    uses: ./github/workflows/integration-test.yaml
      with:
        shards: 3
        device: flutter
 
  flutter-web-integration-test:
    name: integration-test ${{ matrix.bot }} - flutter-web
    needs: flutter-prep
    runs-on: macos-latest

    uses: ./github/workflows/integration-test.yaml
      with:
        shards: 3
        device: flutter-web
```

All of the steps and environment variables would then be pulled into the ./github/workflows/integration-test.yaml
workflow file using a callable workflow dispatch https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow

Then to handle the sharding weirdness we could use seperate step at the top of that workflow to generate and array that would be fed to the matrix:
See the "From Json to Fully Dynamic Matrix" section here https://tomasvotruba.com/blog/2020/11/16/how-to-make-dynamic-matrix-in-github-actions

the step to generate the array would essentially make it so we could have:matrix:
`shard: ${{}}`

贡献指南

打开贡献指南

调研方向

首先检查现有的集成测试分片矩阵和 PR 6385,然后阅读提议的 ./github/workflows/integration-test.yaml 结构以及 GitHub 关于可复用工作流的文档。确认应如何生成 shard 数组并将其传入矩阵。完成的标准是设备工作流调用可复用工作流,并在更简单的分片配置下保持等效的集成测试覆盖范围。

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions, yaml
领域
ci-cd
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。