flutter / flutter/devtools

Clean up integration test sharding

Offen
#6,386 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
infra integration tests P3 tech debt
Vorherrschende Sprache
Dart
Sterne
1.7k
Forks
404
Ø Merge
6 T. 17 Std.
Gemergte PRs (30 T.)
18

Beschreibung

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: ${{}}`

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reviewing the existing integration-test sharding matrix and PR 6385, then read the proposed ./github/workflows/integration-test.yaml structure and GitHub's reusable-workflow documentation. Confirm how the shard array should be generated and passed into the matrix. Done means the device workflows call the reusable workflow and retain equivalent integration-test coverage with simpler sharding configuration.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
github-actions, yaml
Bereich
ci-cd
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.