1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] What is an example GitHub Action workflow for Flutter integration testing using...

Discussão em 'Mobile' iniciado por Stack, Outubro 30, 2024 às 19:42.

  1. Stack

    Stack Membro Participativo

    I want to put my integration tests under continuous integration. My google searches have revealed many Flutter GitHub action workflow examples, but they either:


    • Use ubuntu to do unit testing, not integration testing (i.e. flutter test, not flutter test integration_test/app_test.dart, or


    • Do integration testing, but use MacOS, not ubuntu. (Selecting MacOS as the OS in GitHub Actions results in a "minutes multiplier" of 10, which means I use up the monthly free allocation much more quickly.)

    I found one example workflow that does try to use ubuntu to do Flutter integration testing:

    name: Run integration tests
    on:
    push:
    branches:
    - main

    jobs:
    integration-tests:
    name: Running tests
    runs-on: ubuntu-latest
    strategy:
    fail-fast: false
    steps:
    - name: Checkout code
    uses: actions/checkout@v2
    - name: Setup Java
    uses: actions/setup-java@v2
    with:
    distribution: 'temurin'
    java-version: '17'
    - name: Setup Flutter (stable)
    uses: subosito/flutter-action@v2
    with:
    channel: 'stable'
    - name: Install Android SDK
    uses: malinskiy/action-android/install-sdk@release/0.1.2
    - run: echo $ANDROID_HOME
    - run: sdkmanager --install "ndk;23.1.7779620"
    - run: sdkmanager --install "build-tools;30.0.3"
    - run: flutter pub get
    - uses: malinskiy/action-android/emulator-run-cmd@release/0.1.2
    with:
    cmd: flutter test integration_test/app_test.dart --coverage
    api: 31
    cmdOptions: -no-snapshot-save -noaudio -no-boot-anim -cores 2 -memory 3072 -no-window
    tag: google_apis
    abi: x86_64


    But it fails with a variety of error/warning messages. Initially, some of them look like this:

    • Warning: Errors during XML parse:
    • Warning: Additionally, the fallback loader failed to parse the XML.
    • ProbeKVM: This user doesn't have permissions to use KVM (/dev/kvm).

    And then the following lines repeated hundreds of times until the timeout happens:

    adb: device 'emulator-5554' not found
    The process '/home/runner/android-sdk/platform-tools/adb' failed with exit code 1
    Sleeping for 1s


    Does anyone have a GitHub action for integration testing under ubuntu that they could share?

    Continue reading...

Compartilhe esta Página