如何通过GitHub Action自动化Linux-Desktop上的Flutter应用程序自动化测试CI

发布于 2025-01-25 08:44:25 字数 589 浏览 4 评论 0原文

我们希望通过GitHub操作使我们的集成测试在Linux桌面(Ubuntu-Latest)上起作用。

该命令是

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

,但我们总是会遇到错误:

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

GitHub操作可以在CPU上不够快地处理与GPU / GUI相关的内容或正在发生的事情。这甚至可能吗? 我只找到

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

菊凝晚露 2025-02-01 08:44:25

这对我来说就足够了 -

xvfb -run flutter Test -d linux Integration_test

xvfb ubuntu 22.04 跑步者图像。

积分 -

  1. frbrgeorge对另一个问题的回答

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
GRAY°灰色天空 2025-02-01 08:44:25

我正在使用gabrielbb/ github操作以启用xvfb。

      - name: flutter test
        uses: GabrielBB/[email protected]
        with:
          working-directory: ./examples/flutter
          run: |
            flutter config --enable-linux-desktop
            flutter test integration_test/basics_test.dart -d linux

I am using the GabrielBB/[email protected] github action to enable xvfb.

      - name: flutter test
        uses: GabrielBB/[email protected]
        with:
          working-directory: ./examples/flutter
          run: |
            flutter config --enable-linux-desktop
            flutter test integration_test/basics_test.dart -d linux
听风吹 2025-02-01 08:44:25

我看到了这个问题,其中xvfb在答案中提到了:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文