fluttergithub-actionsgui-testingflutter-integration-testflutter-linux

How to automate testing of Flutter application on Linux-Desktop via Github Actions CI


We want to make our integration tests work on Linux desktop (ubuntu-latest) via Github Actions.

The command is

flutter config --enable-linux-desktop
flutter test -d linux integration_test

But we always get an error:

Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
//...
TestDeviceException(Unable to start the app on the device.)
  package:flutter_tools/src/test/integration_test_device.dart 61:7  IntegrationTestTestDevice.start

Can Github Actions not handle the GPU / GUI related stuff fast enough on the CPU or what is going on. Is this even possible? I found only one repository which call similar command for a linux environment.

Thanks!


Solution

  • I saw this question, where Xvfb was mentioned in an answer, it worked:

    jobs:
      linux:
        runs-on: ubuntu-latest
        ...
        steps:
            run: |
              export DISPLAY=:99
              sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
              flutter test -d linux integration_test