tests: set _file to avoid <unknown-file> messages

Since the module system is importing an anonymous fnOrAttr module,
instead of a `path` type module, it doesn't have enough context to
figure out the module's file automatically.
This commit is contained in:
Matt Sturgeon 2024-09-07 17:43:20 +01:00
parent ce4c3a72c1
commit 810eacf516
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -10,9 +10,13 @@ let
inherit (test-derivation) mkTestDerivationFromNixvimModule; inherit (test-derivation) mkTestDerivationFromNixvimModule;
moduleToTest = moduleToTest =
name: module: file: name: module:
mkTestDerivationFromNixvimModule { mkTestDerivationFromNixvimModule {
inherit name module; inherit name;
module = {
_file = file;
imports = [ module ];
};
pkgs = pkgsUnfree; pkgs = pkgsUnfree;
}; };
@ -39,10 +43,17 @@ let
in in
# We attempt to build & execute all configurations # We attempt to build & execute all configurations
lib.pipe (testFiles ++ [ exampleFiles ]) [ lib.pipe (testFiles ++ [ exampleFiles ]) [
(builtins.map (file: { (builtins.map (
inherit (file) name; {
path = pkgs.linkFarm file.name (builtins.mapAttrs moduleToTest file.cases); name,
})) file,
cases,
}:
{
inherit name;
path = pkgs.linkFarm name (builtins.mapAttrs (moduleToTest file) cases);
}
))
(helpers.groupListBySize 10) (helpers.groupListBySize 10)
(lib.imap1 ( (lib.imap1 (
i: group: rec { i: group: rec {