Skip to content

Commit 86c2b7d

Browse files
[ci] Introduce LUCI versions of Linux desktop platform tests (flutter#4223)
Adds scripts and LUCI targets for the Linux desktop platform test tasks, corresponding to the Cirrus linux-platform_test tasks. Part of flutter#114373
1 parent 6181f65 commit 86c2b7d

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

.ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,35 @@ targets:
498498
target_file: linux_build_all_packages.yaml
499499
channel: stable
500500

501+
- name: Linux_desktop platform_tests master
502+
bringup: true # New target
503+
recipe: packages/packages
504+
timeout: 30
505+
properties:
506+
version_file: flutter_master.version
507+
target_file: linux_platform_tests.yaml
508+
channel: master
509+
# Install Chrome as a default handler for schemes for url_launcher.
510+
dependencies: >-
511+
[
512+
{"dependency": "chrome_and_driver", "version": "version:114.0"}
513+
]
514+
515+
- name: Linux_desktop platform_tests stable
516+
bringup: true # New target
517+
recipe: packages/packages
518+
presubmit: false
519+
timeout: 30
520+
properties:
521+
version_file: flutter_stable.version
522+
target_file: linux_platform_tests.yaml
523+
channel: stable
524+
# Install Chrome as a default handler for schemes for url_launcher.
525+
dependencies: >-
526+
[
527+
{"dependency": "chrome_and_driver", "version": "version:114.0"}
528+
]
529+
501530
### iOS+macOS tasks ###
502531
# TODO(stuartmorgan): Move this to ARM once google_maps_flutter has ARM
503532
# support. `pod lint` makes a synthetic target that doesn't respect the

.ci/scripts/set_default_linux_apps.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
# Copyright 2013 The Flutter Authors. All rights reserved.
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
set -e
6+
7+
# Set up a .desktop file pointing to the CIPD-installed Chrome.
8+
readonly LOCAL_DESKTOP_FILE_DIR=~/.local/share/applications
9+
mkdir -p "${LOCAL_DESKTOP_FILE_DIR}"
10+
readonly DESKTOP_FILE_NAME=cipd-chrome.desktop
11+
readonly CIPD_CHROME_DESKTOP_FILE="${LOCAL_DESKTOP_FILE_DIR}/${DESKTOP_FILE_NAME}"
12+
cat << EOF > "${CIPD_CHROME_DESKTOP_FILE}"
13+
[Desktop Entry]
14+
Version=1.0
15+
Name=Google Chrome
16+
GenericName=Web Browser
17+
Comment=Access the Internet
18+
Exec=${CHROME_EXECUTABLE} %U
19+
StartupNotify=true
20+
Terminal=false
21+
Icon=google-chrome
22+
Type=Application
23+
Categories=Network;WebBrowser;
24+
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/file;
25+
EOF
26+
27+
# Enable xdg-* commands to work correctly.
28+
export DESKTOP_SESSION=gnome
29+
30+
# Set Chrome as the default handler for http, https, and file, for url_launcher
31+
# tests that expect handlers for those schemes.
32+
xdg-mime default "${DESKTOP_FILE_NAME}" inode/directory
33+
xdg-settings set default-web-browser "${DESKTOP_FILE_NAME}"

.ci/scripts/xvfb_tool_runner.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Copyright 2013 The Flutter Authors. All rights reserved.
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
set -e
6+
7+
xvfb-run ./script/tool_runner.sh "$@"

.ci/targets/linux_platform_tests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
tasks:
2+
- name: prepare tool
3+
script: .ci/scripts/prepare_tool.sh
4+
- name: set default apps
5+
script: .ci/scripts/set_default_linux_apps.sh
6+
- name: build examples
7+
script: script/tool_runner.sh
8+
args: ["build-examples", "--linux"]
9+
- name: native test
10+
script: .ci/scripts/xvfb_tool_runner.sh
11+
args: ["native-test", "--linux"]
12+
- name: drive examples
13+
script: .ci/scripts/xvfb_tool_runner.sh
14+
args: ["drive-examples", "--linux", "--exclude=script/configs/exclude_integration_linux.yaml"]

0 commit comments

Comments
 (0)