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:
Erik Arvstedt 2021-12-08 04:07:32 +01:00
parent 77d8c00c53
commit eaf98f92db
No known key found for this signature in database
GPG key ID: 33312B944DD97846
4 changed files with 71 additions and 0 deletions

View file

@ -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