7

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!

User Rebo
  • 3,056
  • 25
  • 30

3 Answers3

0

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
User Rebo
  • 3,056
  • 25
  • 30
0

I am using the GabrielBB/xvfb-action@v1.6 github action to enable xvfb.

      - name: flutter test
        uses: GabrielBB/xvfb-action@v1.6
        with:
          working-directory: ./examples/flutter
          run: |
            flutter config --enable-linux-desktop
            flutter test integration_test/basics_test.dart -d linux
pubkey
  • 617
  • 8
  • 17
0

This was enough for me -

xvfb-run flutter test -d linux integration_test

xvfb is pre-installed on Ubuntu 22.04 Runner Image.

Credits -

  1. FrBrGeorge's answer to another question
Hrishikesh Kadam
  • 35,376
  • 3
  • 26
  • 36