Skip to content

[ci] Introduce LUCI versions of Linux desktop platform tests #4223

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

Merged
merged 10 commits into from
Jul 15, 2023

Conversation

stuartmorgan-g
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g commented Jun 15, 2023

Adds scripts and LUCI targets for the Linux desktop platform test tasks, corresponding to the Cirrus linux-platform_test tasks.

Part of flutter/flutter#114373

Adds scripts and LUCI targets for the Linux desktop build-all and
platform test tasks, corresponding to the Cirrus
linux-build_all_packages and linux-platform_test tasks.

Part of flutter/flutter#114373
Copy link
Contributor Author

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried this with led because I use it so infrequently I can never remember what exactly I can edit from other existing things and what I can't, so my plan is just to land this, see if it works once things propagate, and then iterate from there. If either of you want to pre-test with led though, please feel free :)

.ci.yaml Outdated
properties:
os: Ubuntu
cores: "8"
device_type: none
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three lines are copied from the config that seems to be running these tests in flutter/flutter.

.ci.yaml Outdated
{"dependency": "cmake", "version": "build_id:8787856497187628321"},
{"dependency": "ninja", "version": "version:1.9.0"},
{"dependency": "curl", "version": "version:7.64.0"}
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are copied from the flutter/flutter dependencies list of the desktop tests.

In flutter/flutter these are on targets, not in platform_properties, but since we'll need these in several tests I put them in a new configuration up here instead. Is that the right way to do it? Is there best practice/guidance on when to do configs vs duplicating in targets?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the preferred way to go. Define any shared properties in platform level if all tests need. If some specific test needs an extra property, then add that to the target level.

@keyonghan
Copy link
Contributor

I haven't tried this with led because I use it so infrequently I can never remember what exactly I can edit from other existing things and what I can't, so my plan is just to land this, see if it works once things propagate, and then iterate from there. If either of you want to pre-test with led though, please feel free :)

The build_all_packages pass:
master: https://ci.chromium.org/raw/build/logs.chromium.org/flutter/led/keyonghan_google.com/269b7e9ff0df272084bba40b425b315662d3df99aa7e7fc7c0cfba85474fe0ff/+/build.proto?server=chromium-swarm.appspot.com
stable:
https://ci.chromium.org/raw/build/logs.chromium.org/flutter/led/keyonghan_google.com/38dd56dd725a5009be30a60d23b230700c093e6d32f66f969633cc74af827d59/+/build.proto?server=chromium-swarm.appspot.com

But the platform_tests failed on:

�[31m  packages/file_selector/file_selector_linux�[0m
�[31m  packages/url_launcher/url_launcher_linux�[0m

https://ci.chromium.org/raw/build/logs.chromium.org/flutter/led/keyonghan_google.com/3a796a41aa42539d61af742091425ee61be19e63fbb870883d6c810428746ada/+/build.proto?server=chromium-swarm.appspot.com

Running command: "cmake --build /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/build/linux/x64/release --target unit_tests" in /b/s/w/ir/x/w/packages
[1/4] Generating /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/libflutter_linux_gtk.so, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_engine.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_call.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_response.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_value.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/fl_view.h, /b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/linux/flutter/ephemeral/flutter_linux/flutter_linux.h, _phony_
Running file_selector_linux_test...
Running command: "/b/s/w/ir/x/w/packages/packages/file_selector/file_selector_linux/example/build/linux/x64/release/plugins/file_selector_linux/file_selector_linux_test " in /b/s/w/ir/x/w/packages
Unable to init server: Could not connect: Connection refused

(file_selector_linux_test:38577): Gtk-WARNING **: 13:55:06.278: cannot open display: 
Running command: "cmake --build /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/build/linux/x64/release --target unit_tests" in /b/s/w/ir/x/w/packages
[1/4] Generating /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/libflutter_linux_gtk.so, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_basic_message_channel.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_binary_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_binary_messenger.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_dart_project.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_engine.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_json_message_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_json_method_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_message_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_call.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_channel.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_method_response.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_plugin_registrar.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_plugin_registry.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_standard_message_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_standard_method_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_string_codec.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_value.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/fl_view.h, /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/flutter_linux/flutter_linux.h, _phony_
Running url_launcher_linux_test...
Running command: "/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/build/linux/x64/release/plugins/url_launcher_linux/url_launcher_linux_test " in /b/s/w/ir/x/w/packages
Running main() from /b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/build/linux/x64/release/_deps/googletest-src/googletest/src/gtest_main.cc
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from UrlLauncherPlugin
[ RUN      ] UrlLauncherPlugin.CanLaunchSuccess
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux/linux/test/url_launcher_linux_test.cc:27: Failure
Value of: fl_value_equal(fl_method_success_response_get_result( FL_METHOD_SUCCESS_RESPONSE(response)), expected)
  Actual: false
Expected: true
[  FAILED  ] UrlLauncherPlugin.CanLaunchSuccess (4 ms)
[ RUN      ] UrlLauncherPlugin.CanLaunchFailureUnhandled
[       OK ] UrlLauncherPlugin.CanLaunchFailureUnhandled (0 ms)
[ RUN      ] UrlLauncherPlugin.CanLaunchFileSuccess
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux/linux/test/url_launcher_linux_test.cc:51: Failure
Value of: fl_value_equal(fl_method_success_response_get_result( FL_METHOD_SUCCESS_RESPONSE(response)), expected)
  Actual: false
Expected: true
[  FAILED  ] UrlLauncherPlugin.CanLaunchFileSuccess (0 ms)
[ RUN      ] UrlLauncherPlugin.CanLaunchFailureInvalidFileExtension
[       OK ] UrlLauncherPlugin.CanLaunchFailureInvalidFileExtension (0 ms)
[ RUN      ] UrlLauncherPlugin.CanLaunchFailureInvalidUrl
[       OK ] UrlLauncherPlugin.CanLaunchFailureInvalidUrl (0 ms)
[----------] 5 tests from UrlLauncherPlugin (5 ms total)
[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (5 ms total)
[  PASSED  ] 3 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] UrlLauncherPlugin.CanLaunchSuccess
[  FAILED  ] UrlLauncherPlugin.CanLaunchFileSuccess

@stuartmorgan-g
Copy link
Contributor Author

Unable to init server: Could not connect: Connection refused

(file_selector_linux_test:38577): Gtk-WARNING **: 13:55:06.278: cannot open display: 

Interesting, based on flutter/flutter#90676 (comment) I was expecting this not to happen any more. @godofredoc do you have any more context you can provide on that comment? Is there something I need to do in order to have an X server available in tests?

@stuartmorgan-g
Copy link
Contributor Author

[ RUN ] UrlLauncherPlugin.CanLaunchSuccess
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux/linux/test/url_launcher_linux_test.cc:27: Failure
Value of: fl_value_equal(fl_method_success_response_get_result( FL_METHOD_SUCCESS_RESPONSE(response)), expected)
Actual: false
Expected: true
[ FAILED ] UrlLauncherPlugin.CanLaunchSuccess (4 ms)
[ RUN ] UrlLauncherPlugin.CanLaunchFailureUnhandled
[ OK ] UrlLauncherPlugin.CanLaunchFailureUnhandled (0 ms)
[ RUN ] UrlLauncherPlugin.CanLaunchFileSuccess
/b/s/w/ir/x/w/packages/packages/url_launcher/url_launcher_linux/example/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux/linux/test/url_launcher_linux_test.cc:51: Failure
Value of: fl_value_equal(fl_method_success_response_get_result( FL_METHOD_SUCCESS_RESPONSE(response)), expected)
Actual: false
Expected: true
[ FAILED ] UrlLauncherPlugin.CanLaunchFileSuccess (0 ms)

This one is the lack of https://github.com/flutter/packages/blob/main/.ci/Dockerfile#L37-L40, which I forgot about. @keyonghan can you add this to your list of things I'll need infra support on in your comment? We'll need to figure out how to manage that setup in a LUCI world (or keep using Docker for this test, in which case this would be blocked on LUCI Docker).

@stuartmorgan-g
Copy link
Contributor Author

Unable to init server: Could not connect: Connection refused

(file_selector_linux_test:38577): Gtk-WARNING **: 13:55:06.278: cannot open display: 

Interesting, based on flutter/flutter#90676 (comment) I was expecting this not to happen any more. @godofredoc do you have any more context you can provide on that comment? Is there something I need to do in order to have an X server available in tests?

Oh, it looks like it's not that the new bots just handle this as the comment led me to think, but that xvfb is supported:

I'll try adding that to the script.

@godofredoc
Copy link
Contributor

t you can provide on that comment? Is there something I need to do in order to have an X server available in tests?

We need a change in the packages recipe similar to this one https://flutter-review.googlesource.com/c/recipes/+/39186 pass the xvfb property in .ci.yaml

@stuartmorgan-g
Copy link
Contributor Author

t you can provide on that comment? Is there something I need to do in order to have an X server available in tests?

We need a change in the packages recipe similar to this one https://flutter-review.googlesource.com/c/recipes/+/39186 pass the xvfb property in .ci.yaml

The way flutter/packages is structured we shouldn't need that recipe change; the details of how things are executed are all in-repo scripts.

I assumed that .ci.yaml property was acting as an install mechanism, but that doesn't seem to be the case based on what you linked to there. But I don't see anything related to xvfb in the dependencies list, so how is it getting installed?

@godofredoc
Copy link
Contributor

t you can provide on that comment? Is there something I need to do in order to have an X server available in tests?

We need a change in the packages recipe similar to this one https://flutter-review.googlesource.com/c/recipes/+/39186 pass the xvfb property in .ci.yaml

The way flutter/packages is structured we shouldn't need that recipe change; the details of how things are executed are all in-repo scripts.

I assumed that .ci.yaml property was acting as an install mechanism, but that doesn't seem to be the case based on what you linked to there. But I don't see anything related to xvfb in the dependencies list, so how is it getting installed?

xvfb is preinstalled on the vm image.

@stuartmorgan-g
Copy link
Contributor Author

The build_all_packages pass

I split out #4229 to land that while I iterate on this (especially since having that landed will make it easier for me to continue iterating on this without led if there are further complications).

@keyonghan
Copy link
Contributor

@stuartmorgan-g
Copy link
Contributor Author

With the latest xvfb support, file_selector_linux_test passed

🎉 So we just need to figure out a solution to the xdg-* thing of setting default apps.

Are the XDG utils pre-install on the image by any chance?

@keyonghan
Copy link
Contributor

🎉 So we just need to figure out a solution to the xdg-* thing of setting default apps.

Are the XDG utils pre-install on the image by any chance?

@yusuf-goog Could we include the xdg-utils in our focal images for the VMs?

auto-submit bot pushed a commit that referenced this pull request Jun 16, 2023
Adds a desktop Linux platform configuration, and a LUCI version of the Linux desktop build-all test.

Split from #4223

Part of flutter/flutter#114373
@stuartmorgan-g
Copy link
Contributor Author

Marking as draft while we work out the dependencies.

@stuartmorgan-g stuartmorgan-g marked this pull request as draft June 29, 2023 18:51
@stuartmorgan-g stuartmorgan-g changed the title [ci] Introduce LUCI versions of Linux desktop tests [ci] Introduce LUCI versions of Linux desktop platform tests Jul 6, 2023
@stuartmorgan-g stuartmorgan-g force-pushed the luci-linux-desktop-initial branch from adc272d to 65be06a Compare July 6, 2023 14:26
@stuartmorgan-g
Copy link
Contributor Author

stuartmorgan-g commented Jul 6, 2023

🎉 So we just need to figure out a solution to the xdg-* thing of setting default apps.
Are the XDG utils pre-install on the image by any chance?

@yusuf-goog Could we include the xdg-utils in our focal images for the VMs?

It turns out they are, but don't appear to be usable (or at least not using the same calls we make in Docker). I filed flutter/flutter#130074

(The last commit shoehorns the script into one of the existing desktop targets just for easy testing via presubmit, so the failure is currently visible in Linux_desktop build_all_packages_master.)

.ci.yaml Outdated
@@ -292,8 +292,14 @@ targets:
properties:
add_recipes_cq: "true"
version_file: flutter_master.version
target_file: linux_build_all_packages.yaml
# DO NOT LAND: For testing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this PR just for testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last commit to this PR is for testing, to see if it would work (which it didn't, thus flutter/flutter#130074)

yusuf-goog added a commit to yusuf-goog/packages that referenced this pull request Jul 13, 2023
This change sets up a .desktop file for our cipd chrome package
which is required to get xdg-settings working.

Unblocks: flutter#4223

Bug:flutter/flutter#130074
@stuartmorgan-g stuartmorgan-g marked this pull request as ready for review July 13, 2023 02:07
@stuartmorgan-g
Copy link
Contributor Author

@yusuf-goog This is now fully working, and ready for review.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2023
@auto-submit auto-submit bot merged commit 86c2b7d into flutter:main Jul 15, 2023
@stuartmorgan-g stuartmorgan-g deleted the luci-linux-desktop-initial branch July 15, 2023 02:33
fluttermirroringbot pushed a commit to flutter/flutter that referenced this pull request Jul 17, 2023
flutter/packages@369ee7e...6889cca

2023-07-17 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.20.3 to 2.20.4 (flutter/packages#4490)
2023-07-15 stuartmorgan@google.com [ci] Switch Android unit tests to LUCI (flutter/packages#4406)
2023-07-15 stuartmorgan@google.com [ci] Introduce LUCI versions of Linux desktop platform tests (flutter/packages#4223)
2023-07-14 43054281+camsim99@users.noreply.github.com [camerax] Marks all wrapped classes as immutable (flutter/packages#4451)
2023-07-14 47866232+chunhtai@users.noreply.github.com [go_router] Bumps example go_router version and migrate example code (flutter/packages#4469)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
flutter/packages@369ee7e...6889cca

2023-07-17 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.20.3 to 2.20.4 (flutter/packages#4490)
2023-07-15 stuartmorgan@google.com [ci] Switch Android unit tests to LUCI (flutter/packages#4406)
2023-07-15 stuartmorgan@google.com [ci] Introduce LUCI versions of Linux desktop platform tests (flutter/packages#4223)
2023-07-14 43054281+camsim99@users.noreply.github.com [camerax] Marks all wrapped classes as immutable (flutter/packages#4451)
2023-07-14 47866232+chunhtai@users.noreply.github.com [go_router] Bumps example go_router version and migrate example code (flutter/packages#4469)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants