mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
tests: aggregate all test derivations into one using a linkFarm
This commit is contained in:
parent
10d114f5a6
commit
6c3f97ccc0
2 changed files with 46 additions and 36 deletions
43
flake.nix
43
flake.nix
|
@ -59,8 +59,8 @@
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
checks =
|
checks = {
|
||||||
(import ./tests {
|
tests = import ./tests {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
# Some nixvim supported plugins require the use of unfree packages.
|
# Some nixvim supported plugins require the use of unfree packages.
|
||||||
|
@ -75,27 +75,26 @@
|
||||||
config = configuration;
|
config = configuration;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
|
||||||
// {
|
|
||||||
lib-tests = import ./tests/lib-tests.nix {
|
|
||||||
inherit (pkgs) pkgs lib;
|
|
||||||
};
|
|
||||||
extra-args-tests = import ./tests/extra-args.nix {
|
|
||||||
inherit pkgs;
|
|
||||||
inherit (self.legacyPackages.${system}) makeNixvimWithModule;
|
|
||||||
};
|
|
||||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
||||||
src = ./.;
|
|
||||||
hooks = {
|
|
||||||
alejandra = {
|
|
||||||
enable = true;
|
|
||||||
excludes = ["plugins/_sources"];
|
|
||||||
};
|
|
||||||
statix.enable = true;
|
|
||||||
};
|
|
||||||
settings.statix.ignore = ["plugins/lsp/language-servers/rust-analyzer-config.nix"];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
lib-tests = import ./tests/lib-tests.nix {
|
||||||
|
inherit (pkgs) pkgs lib;
|
||||||
|
};
|
||||||
|
extra-args-tests = import ./tests/extra-args.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit (self.legacyPackages.${system}) makeNixvimWithModule;
|
||||||
|
};
|
||||||
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||||
|
src = ./.;
|
||||||
|
hooks = {
|
||||||
|
alejandra = {
|
||||||
|
enable = true;
|
||||||
|
excludes = ["plugins/_sources"];
|
||||||
|
};
|
||||||
|
statix.enable = true;
|
||||||
|
};
|
||||||
|
settings.statix.ignore = ["plugins/lsp/language-servers/rust-analyzer-config.nix"];
|
||||||
|
};
|
||||||
|
};
|
||||||
devShells = {
|
devShells = {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||||
|
|
|
@ -12,18 +12,29 @@
|
||||||
inherit lib pkgs;
|
inherit lib pkgs;
|
||||||
root = ./test-sources;
|
root = ./test-sources;
|
||||||
};
|
};
|
||||||
in
|
|
||||||
|
exampleFiles = {
|
||||||
|
example = let
|
||||||
|
config = import ../example.nix {inherit pkgs;};
|
||||||
|
in
|
||||||
|
builtins.removeAttrs config.programs.nixvim [
|
||||||
|
# This is not available to standalone modules, only HM & NixOS Modules
|
||||||
|
"enable"
|
||||||
|
# This is purely an example, it does not reflect a real usage
|
||||||
|
"extraConfigLua"
|
||||||
|
"extraConfigVim"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# We attempt to build & execute all configurations
|
# We attempt to build & execute all configurations
|
||||||
builtins.mapAttrs mkTestDerivation (testFiles
|
derivationList =
|
||||||
// {
|
pkgs.lib.mapAttrsToList
|
||||||
example = let
|
(
|
||||||
config = import ../example.nix {inherit pkgs;};
|
name: path: {
|
||||||
in
|
inherit name;
|
||||||
builtins.removeAttrs config.programs.nixvim [
|
path = mkTestDerivation name path;
|
||||||
# This is not available to standalone modules, only HM & NixOS Modules
|
}
|
||||||
"enable"
|
)
|
||||||
# This is purely an example, it does not reflect a real usage
|
(testFiles // exampleFiles);
|
||||||
"extraConfigLua"
|
in
|
||||||
"extraConfigVim"
|
pkgs.linkFarm "nixvim-tests" derivationList
|
||||||
];
|
|
||||||
})
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue