flake/ci: re-enable most tests on buildbot

Most still run on all platforms, but many now only run on x86_64-linux.
This commit is contained in:
Matt Sturgeon 2025-05-30 17:37:23 +01:00
parent 74e6ada9d1
commit 7d0ac00557
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 19 additions and 2 deletions

View file

@ -7,8 +7,15 @@
perSystem = perSystem =
{ pkgs, ... }: { pkgs, ... }:
{ {
# TODO: consider whether all these tests are needed in the `checks` output
checks = pkgs.callPackages ../../tests { checks = pkgs.callPackages ../../tests {
inherit helpers self; 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;
};
}; };
} }

View file

@ -5,6 +5,7 @@
linkFarm, linkFarm,
self, # The flake instance self, # The flake instance
system ? pkgs.stdenv.hostPlatform.system, system ? pkgs.stdenv.hostPlatform.system,
allSystems ? true,
}: }:
let let
autoArgs = pkgs // { autoArgs = pkgs // {
@ -31,8 +32,15 @@ let
callTests = lib.callPackagesWith autoArgs; callTests = lib.callPackagesWith autoArgs;
selfPackages = self.packages.${system}; 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 in
{ lib.optionalAttrs buildForThisSystem {
extra-args-tests = callTest ./extra-args.nix { }; extra-args-tests = callTest ./extra-args.nix { };
extend = callTest ./extend.nix { }; extend = callTest ./extend.nix { };
extra-files = callTest ./extra-files.nix { }; extra-files = callTest ./extra-files.nix { };
@ -47,10 +55,12 @@ in
lsp-all-servers = callTest ./lsp-servers.nix { }; lsp-all-servers = callTest ./lsp-servers.nix { };
} }
# Expose some tests from the docs as flake-checks too # 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.<test> # Individual tests can be run using: nix build .#docs.user-configs.tests.<test>
docs-user-configs = linkFarm "user-configs-tests" selfPackages.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 { } // callTests ./platforms { }
# Tests generated from ./test-sources # Tests generated from ./test-sources
# Grouped as a number of link-farms in the form { test-1, test-2, ... test-N } # Grouped as a number of link-farms in the form { test-1, test-2, ... test-N }