test: add test nixosSearch
This checks that creating module docs for search.nixos.org succceeds. Errors can happen when complex `default` values can't be evaluated or on malformed Docbook XML in descriptions.
This commit is contained in:
parent
77d8c00c53
commit
eaf98f92db
@ -26,11 +26,16 @@ if [[ ${1:-} != -f ]] && ! git diff --quiet ../flake.{nix,lock}; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Updating flake 'nixos-search'"
|
||||
nix flake update ../test/nixos-search
|
||||
echo
|
||||
|
||||
versions=$(nix eval --json -f update-flake.nix versions)
|
||||
|
||||
## Uncomment the following to generate a version change message for testing
|
||||
# versions=$(echo "$versions" | sed 's|1|0|g')
|
||||
|
||||
echo "Updating main flake"
|
||||
nix flake update ..
|
||||
|
||||
echo
|
||||
|
44
test/nixos-search/flake.lock
Normal file
44
test/nixos-search/flake.lock
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixos-search": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1638831015,
|
||||
"narHash": "sha256-WmCsa6gSY01Yt0wminCbNV8Mn+4iU1OEF5r3YUh6SVs=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-search",
|
||||
"rev": "fa5fe2a61c36ed90506af75c19bfaf2f9d537d87",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-search",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1631118067,
|
||||
"narHash": "sha256-tEcFvm3a6ToeBGwHdjfB2mVQwa4LZCZTQYE2LnY3ycA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "09cd65b33c5653d7d2954fef4b9f0e718c899743",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-unstable",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixos-search": "nixos-search"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
9
test/nixos-search/flake.nix
Normal file
9
test/nixos-search/flake.nix
Normal file
@ -0,0 +1,9 @@
|
||||
# This flake just mirrors input `nixos-search`.
|
||||
# Because `nixos-search` is a dev-only dependency, we don't add
|
||||
# it to the main flake.
|
||||
{
|
||||
inputs.nixos-search.url = "github:nixos/nixos-search";
|
||||
outputs = { self, nixos-search }: {
|
||||
inherit (nixos-search) packages;
|
||||
};
|
||||
}
|
@ -267,6 +267,18 @@ flake() {
|
||||
nix flake check "$scriptDir/.."
|
||||
}
|
||||
|
||||
# Test generating module documentation for search.nixos.org
|
||||
nixosSearch() {
|
||||
if ! checkFlakeSupport "nixosSearch"; then return; fi
|
||||
|
||||
if [[ $outLinkPrefix ]]; then
|
||||
# Add gcroots for flake-info
|
||||
nix build $scriptDir/nixos-search#flake-info -o "$outLinkPrefix-flake-info"
|
||||
fi
|
||||
echo "Running flake-info (nixos-search)"
|
||||
nix run $scriptDir/nixos-search#flake-info -- flake ../.
|
||||
}
|
||||
|
||||
# A basic subset of tests to keep the total runtime within
|
||||
# manageable bounds (<4 min on desktop systems).
|
||||
# These are also run on the CI server.
|
||||
@ -300,6 +312,7 @@ all() {
|
||||
buildable
|
||||
examples
|
||||
flake
|
||||
nixosSearch
|
||||
}
|
||||
|
||||
# An alias for buildTest
|
||||
|
Loading…
Reference in New Issue
Block a user