mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
wrapper-manager-fds/tests: init derivation for tests
This is to make checking with flakes a bit easier. Though, there are much better ways to integrate this even with just the nix-command experimental feature.
This commit is contained in:
parent
1ba01aa5a8
commit
0f1df5e447
@ -1,9 +1,19 @@
|
|||||||
{ branch ? "nixos-stable" }:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
sources = import ../npins;
|
sources = import ../npins;
|
||||||
pkgs = import sources.${branch} { };
|
in
|
||||||
|
{ pkgs ? import sources.nixos-unstable { } }:
|
||||||
|
|
||||||
|
let
|
||||||
|
lib = import ./lib { inherit pkgs; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib = import ./lib { inherit pkgs; };
|
inherit lib;
|
||||||
|
libTestPkg =
|
||||||
|
pkgs.runCommand "wrapper-manager-fds-lib-test" {
|
||||||
|
testData = builtins.toJSON lib;
|
||||||
|
passAsFile = [ "testData" ];
|
||||||
|
nativeBuildInputs = with pkgs; [ yajsv jq ];
|
||||||
|
} ''
|
||||||
|
yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath"
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
16
subprojects/wrapper-manager-fds/tests/lib/tests.schema.json
Normal file
16
subprojects/wrapper-manager-fds/tests/lib/tests.schema.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"title": "wrapper-manager-fds Nix test object",
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
"^\\w+$": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"minItems": 0,
|
||||||
|
"maxItems": 0
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
@ -3,22 +3,22 @@
|
|||||||
lib.runTests {
|
lib.runTests {
|
||||||
testsUtilsGetBin = {
|
testsUtilsGetBin = {
|
||||||
expr = self.utils.getBin [
|
expr = self.utils.getBin [
|
||||||
../modules
|
../../lib
|
||||||
../../modules
|
../../modules
|
||||||
];
|
];
|
||||||
expected = [
|
expected = [
|
||||||
(lib.getBin ../modules)
|
(lib.getBin ../../lib)
|
||||||
(lib.getBin ../../modules)
|
(lib.getBin ../../modules)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
testsUtilsGetLibexec = {
|
testsUtilsGetLibexec = {
|
||||||
expr = self.utils.getLibexec [
|
expr = self.utils.getLibexec [
|
||||||
../modules
|
../../lib
|
||||||
../../modules
|
../../modules
|
||||||
];
|
];
|
||||||
expected = [
|
expected = [
|
||||||
"${../modules}/libexec"
|
"${../../lib}/libexec"
|
||||||
"${../../modules}/libexec"
|
"${../../modules}/libexec"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user