Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter integration test page does not mention the requirement for an x server to be running on the machine #10464

Closed
1 task
af-chacon opened this issue Apr 26, 2024 · 1 comment · Fixed by #10563
Assignees
Labels
devos.Linux Relates to developing apps on the Linux platform e2-days Effort: < 5 days from.page-issue Reported in a reader-filed concern p1-high Major but not urgent concern: Resolve in months. Update each month. st.triage.ltw Indicates Lead Tech Writer has triaged target.Linux Target apps on the Linux Platform test.integration Relates to integration testing

Comments

@af-chacon
Copy link

Page URL

https://docs.flutter.dev/testing/integration-tests

Page source

https://github.com/flutter/website/blob/main/src/content/testing/integration-tests/index.md

Describe the problem

Upon attempting to run integration tests on github actions I ran into an issue where the command flutter test integration_test -d linux -r github would fail due to there not being a debugger to connect to.

image

After many attempts at getting this running, I found an obscure reference that the command above requires the existence of an x-server on Linux.

The following worked:

      - name: Run Integration Tests
        uses: smithki/xvfb-action@v1.1.2
        with:
          run: flutter test integration_test -d linux -r github

The usage of xvfb-run is required in CI using Linux and this is not documented.

Expected fix

Please add a reference to requiring an x-server running on linux for the integration_test to work.
Additionally, a working example of a github actions yml would be helpful for future users of this feature.

Here is an example of this:

name: Flutter Web Build and Test

on:
  push:
    branches: ["master"]
  pull_request:
    branches: ["master"]

  workflow_dispatch:

jobs:
  setup:
    name: Setup & Build & Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: subosito/flutter-action@v2
        with:
          channel: stable
          flutter-version-file: pubspec.yaml
          cache: true

      - name: Get Dependencies
        run: flutter pub get

      - name: Install Linux Dependencies
        run: |
          sudo apt-get update -y
          sudo apt-get install -y ninja-build libgtk-3-dev

      - name: Start Web Release Build
        run: flutter build linux

      - name: Run Unit Tests
        run: flutter test

      - name: Run Integration Tests
        uses: smithki/xvfb-action@v1.1.2
        with:
          run: flutter test integration_test -d linux -r github

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on docs.flutter.dev.
@af-chacon af-chacon added the from.page-issue Reported in a reader-filed concern label Apr 26, 2024
@sfshaza2 sfshaza2 added p1-high Major but not urgent concern: Resolve in months. Update each month. e2-days Effort: < 5 days labels Apr 26, 2024
@sfshaza2
Copy link
Contributor

Thanks, @af-chacon, for bringing this to our attention and providing a workaround!

@atsansone atsansone added devos.Linux Relates to developing apps on the Linux platform target.Linux Target apps on the Linux Platform test.integration Relates to integration testing st.triage.ltw Indicates Lead Tech Writer has triaged labels Apr 29, 2024
@atsansone atsansone self-assigned this Apr 29, 2024
atsansone added a commit that referenced this issue May 20, 2024
This PR removes the duplicate content between two pages
([Introduction](https://flutter-docs-prod--pr10563-fix-10464-kelxxfuk.web.app/cookbook/testing/integration/introduction)
and [Write and run an integration
test](https://flutter-docs-prod--pr10563-fix-10464-kelxxfuk.web.app/testing/integration-tests)),
adds a CI note, and adds the desktop integration testing information.

Fixes #10464
Fixes #6115 
Fixes #9512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devos.Linux Relates to developing apps on the Linux platform e2-days Effort: < 5 days from.page-issue Reported in a reader-filed concern p1-high Major but not urgent concern: Resolve in months. Update each month. st.triage.ltw Indicates Lead Tech Writer has triaged target.Linux Target apps on the Linux Platform test.integration Relates to integration testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants