From 7d0ac00557dd97d4353cfcad8ffb65163ac1d782 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Fri, 30 May 2025 17:37:23 +0100 Subject: [PATCH] flake/ci: re-enable most tests on buildbot Most still run on all platforms, but many now only run on x86_64-linux. --- flake/dev/tests.nix | 7 +++++++ tests/default.nix | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/flake/dev/tests.nix b/flake/dev/tests.nix index 1067ca7a..70c77dd4 100644 --- a/flake/dev/tests.nix +++ b/flake/dev/tests.nix @@ -7,8 +7,15 @@ perSystem = { pkgs, ... }: { + # TODO: consider whether all these tests are needed in the `checks` output checks = pkgs.callPackages ../../tests { inherit helpers self; }; + + # TODO: consider whether all these tests are needed to be built by buildbot + ci.buildbot = pkgs.callPackages ../../tests { + inherit helpers self; + allSystems = false; + }; }; } diff --git a/tests/default.nix b/tests/default.nix index d2a3ff6b..bf730078 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -5,6 +5,7 @@ linkFarm, self, # The flake instance system ? pkgs.stdenv.hostPlatform.system, + allSystems ? true, }: let autoArgs = pkgs // { @@ -31,8 +32,15 @@ let callTests = lib.callPackagesWith autoArgs; selfPackages = self.packages.${system}; + + # For tests that CI should only build on one system, + # This is true when on that system. + # + # TODO: consider refactoring tests/default.nix so that some tests are + # defined by it, while others are defined elsewhere... + buildForThisSystem = allSystems || system == "x86_64-linux"; in -{ +lib.optionalAttrs buildForThisSystem { extra-args-tests = callTest ./extra-args.nix { }; extend = callTest ./extend.nix { }; extra-files = callTest ./extra-files.nix { }; @@ -47,10 +55,12 @@ in lsp-all-servers = callTest ./lsp-servers.nix { }; } # Expose some tests from the docs as flake-checks too -// lib.optionalAttrs (selfPackages ? docs) { +// lib.optionalAttrs (selfPackages ? docs && buildForThisSystem) { # Individual tests can be run using: nix build .#docs.user-configs.tests. docs-user-configs = linkFarm "user-configs-tests" selfPackages.docs.user-configs.tests; } + +# These are always built on all systems, even when `allSystems = false` // callTests ./platforms { } # Tests generated from ./test-sources # Grouped as a number of link-farms in the form { test-1, test-2, ... test-N }