Merge pull request #197611 from primeos/nixos-tests-chromium

nixos/tests/chromium: Fixes for Google Chrome and M107+
This commit is contained in:
Michael Weiss 2022-10-25 00:07:06 +02:00 committed by GitHub
commit f8fae712ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,7 +39,9 @@ mapAttrs (channel: chromiumPkg: makeTest {
name = "chromium-${channel}";
meta = {
maintainers = with maintainers; [ aszlig primeos ];
} // optionalAttrs (chromiumPkg.meta ? timeout) {
# https://github.com/NixOS/hydra/issues/591#issuecomment-435125621
# Note: optionalAttrs is used since meta.timeout is not set for Google Chrome
inherit (chromiumPkg.meta) timeout;
};
@ -65,6 +67,9 @@ mapAttrs (channel: chromiumPkg: makeTest {
from contextlib import contextmanager
major_version = "${versions.major (getVersion chromiumPkg.name)}"
# Run as user alice
def ru(cmd):
return "su - ${user} -c " + shlex.quote(cmd)
@ -84,7 +89,6 @@ mapAttrs (channel: chromiumPkg: makeTest {
binary = pname
# Add optional CLI options:
options = []
major_version = "${versions.major (getVersion chromiumPkg.name)}"
if major_version > "95" and not pname.startswith("google-chrome"):
# Workaround to avoid a GPU crash:
options.append("--use-gl=swiftshader")
@ -242,9 +246,11 @@ mapAttrs (channel: chromiumPkg: makeTest {
machine.screenshot("after_copy_from_chromium")
with test_new_win("gpu_info", "chrome://gpu", "chrome://gpu"):
# To check the text rendering (catches regressions like #131074):
machine.wait_for_text("Graphics Feature Status")
if major_version < "107":
# TODO: Fix the chrome://gpu test for M107+
with test_new_win("gpu_info", "chrome://gpu", "chrome://gpu"):
# To check the text rendering (catches regressions like #131074):
machine.wait_for_text("Graphics Feature Status")
with test_new_win("version_info", "chrome://version", "About Version") as clipboard: