clanLib.jsonschema: move tests from pkgs/clan-cli

This commit is contained in:
DavHau
2023-08-09 16:05:16 +02:00
parent 9438a9eb5f
commit 7262208a4c
12 changed files with 38 additions and 28 deletions

View File

@@ -27,30 +27,7 @@
## End optional dependencies
};
checks = self'.packages.clan-cli.tests // {
# check if the `clan config` example jsonschema and data is valid
clan-config-example-schema-valid = pkgs.runCommand "clan-config-example-schema-valid" { } ''
echo "Checking that example-schema.json is valid"
${pkgs.check-jsonschema}/bin/check-jsonschema \
--check-metaschema ${./.}/tests/config/example-schema.json
echo "Checking that example-data.json is valid according to example-schema.json"
${pkgs.check-jsonschema}/bin/check-jsonschema \
--schemafile ${./.}/tests/config/example-schema.json \
${./.}/tests/config/example-data.json
touch $out
'';
# check if the `clan config` nix jsonschema converter unit tests succeed
clan-config-nix-unit-tests = pkgs.runCommand "clan-edit-unit-tests" { } ''
export NIX_PATH=nixpkgs=${pkgs.path}
${self'.packages.nix-unit}/bin/nix-unit \
${./.}/tests/config/test.nix \
--eval-store $(realpath .)
touch $out
'';
};
checks = self'.packages.clan-cli.tests;
};
}