From 0fa4d17725f846951f2b80502a5f6c3695a31f99 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Mon, 24 Oct 2022 21:08:43 +0200 Subject: [PATCH 1/2] nixos/tests/chromium: Fix the tests for Google Chrome The meta attribute "timeout" is only set for Chromium (might still be required due to the long build duration). The Google Chrome tests were failing with: error: attribute 'timeout' missing According to nixos/lib/testing/meta.nix "null values are filtered out by `meta`" so `timeout = chromiumPkg.meta.timeout or null` might be fine as well. --- nixos/tests/chromium.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/tests/chromium.nix b/nixos/tests/chromium.nix index 6b296fe8a61a..c6b04e618974 100644 --- a/nixos/tests/chromium.nix +++ b/nixos/tests/chromium.nix @@ -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; }; From 5389fbe7839749354df38517124a55259ebf3453 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Mon, 24 Oct 2022 21:26:03 +0200 Subject: [PATCH 2/2] nixos/tests/chromium: Disable a failing test for M107+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I haven't had time to look into this yet but it looks like opening chrome://gpu doesn't work anymore without proper GPU rendering (we use software rendering due to the virtualisation). According to the console output the new window never opens (at least with Google Chrome - I couldn't test it with Chromium yet due to the failing builds for M107 and M108): ``` (finished: sending keys ‘chrome://gpu ‘, in 0.14 seconds) machine: waiting for a window to appear machine: must succeed: xwininfo -root -tree | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d' (finished: must succeed: xwininfo -root -tree | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d', in 0.05 seconds) machine # Error: eglChooseConfig returned zero configs machine # at Create (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:53) machine # machine: must succeed: xwininfo -root -tree | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d' machine # WARNING: lavapipe is not a conformant vulkan implementation, testing use only. (finished: must succeed: xwininfo -root -tree | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d', in 0.06 seconds) machine: must succeed: xwininfo -root -tree | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d' (finished: must succeed: xwininfo -root -tree | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d', in 0.09 seconds) [...] ``` --- nixos/tests/chromium.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nixos/tests/chromium.nix b/nixos/tests/chromium.nix index c6b04e618974..618633935213 100644 --- a/nixos/tests/chromium.nix +++ b/nixos/tests/chromium.nix @@ -67,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) @@ -86,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") @@ -244,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: