From 3caf3e1e08220b59dee1dfe81549b3a0739f8565 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 4 Oct 2024 21:00:30 -0700 Subject: testsuite: add a functional2 test suite based on pytest I am tired of bad shell scripts, let me write bad python quickly instead. It's definitely, $100%, better. This is not planned as an immediate replacement of the old test suite, but we::jade would not oppose tests getting ported. What is here is a mere starting point and there is a lot more functionality that we need. Fixes: https://git.lix.systems/lix-project/lix/issues/488 Change-Id: If762efce69030bb667491b263b874c36024bf7b6 --- package.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'package.nix') diff --git a/package.nix b/package.nix index ff862bf92..b0b933ece 100644 --- a/package.nix +++ b/package.nix @@ -170,6 +170,7 @@ let functionalTestFiles = fileset.unions [ ./tests/functional + ./tests/functional2 ./tests/unit (fileset.fileFilter (f: lib.strings.hasPrefix "nix-profile" f.name) ./scripts) ]; @@ -243,6 +244,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ python3 + python3.pkgs.pytest meson ninja cmake @@ -474,6 +476,10 @@ stdenv.mkDerivation (finalAttrs: { pythonPackages = ( p: [ + # FIXME: these have to be added twice due to the nix shell using a + # wrapped python instead of build inputs for its python inputs + p.pytest + p.yapf p.python-frontmatter p.requests -- cgit v1.2.3 From 4180b84a677c363ab9f5ce500f0e5fa822d6c133 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 4 Oct 2024 21:17:25 -0700 Subject: testsuite: use xdist for parallel test running This is capped at 12 because 3.7 seconds of startup is painful enough and 5.5 seconds with 24 was more annoying. Change-Id: I327db40fd98deaa5330cd9cf6de99fb07b2c1cb0 --- package.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'package.nix') diff --git a/package.nix b/package.nix index b0b933ece..2d485be93 100644 --- a/package.nix +++ b/package.nix @@ -245,6 +245,7 @@ stdenv.mkDerivation (finalAttrs: { [ python3 python3.pkgs.pytest + python3.pkgs.pytest-xdist meson ninja cmake @@ -479,6 +480,7 @@ stdenv.mkDerivation (finalAttrs: { # FIXME: these have to be added twice due to the nix shell using a # wrapped python instead of build inputs for its python inputs p.pytest + p.pytest-xdist p.yapf p.python-frontmatter -- cgit v1.2.3