tests: do not import helpers.nix directly

This commit is contained in:
Gaetan Lepage 2024-02-09 15:03:32 +01:00 committed by Gaétan Lepage
parent 304c62516d
commit a121d96091
4 changed files with 7 additions and 5 deletions

View file

@ -3,13 +3,14 @@
pkgs,
config,
system,
helpers,
makeNixvimWithModuleUnfree,
makeNixvimWithModule,
...
}: {
checks = {
tests = import ../tests {
inherit pkgs;
inherit pkgs helpers;
inherit (pkgs) lib;
makeNixvim = configuration:
makeNixvimWithModuleUnfree {
@ -25,7 +26,7 @@
};
lib-tests = import ../tests/lib-tests.nix {
inherit pkgs;
inherit pkgs helpers;
inherit (pkgs) lib;
};
};

View file

@ -1,6 +1,7 @@
{
makeNixvim,
lib,
helpers,
pkgs,
}: let
fetchTests = import ./fetch-tests.nix;
@ -9,7 +10,7 @@
# List of files containing configurations
testFiles = fetchTests {
inherit lib pkgs;
inherit lib pkgs helpers;
root = ./test-sources;
};

View file

@ -2,6 +2,7 @@
root,
lib,
pkgs,
helpers,
}: let
# Handle an entry from readDir and either extract the configuration if its a regular file,
# or continue to recurse if it's a directory. While recursing maintain a list of the traversed
@ -35,7 +36,6 @@
# Remove the nesting
testsList = lib.lists.flatten (parseDirectories root []);
helpers = import ../lib/helpers.nix {inherit lib;};
testsListEvaluated = builtins.map ({
cases,
namespace,

View file

@ -3,8 +3,8 @@
{
lib,
pkgs,
helpers,
}: let
helpers = import ../lib/helpers.nix {inherit lib pkgs;};
results = pkgs.lib.runTests {
testToLuaObject = {
expr = helpers.toLuaObject {