1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-08 01:51:01 +01:00

Merge pull request #14399 from obsidiansystems/json-schema-path-info

Convert store path info JSON docs to formal JSON Schema, and test
This commit is contained in:
John Ericson 2025-10-30 17:35:20 +00:00 committed by GitHub
commit 7e2d2db8ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 327 additions and 90 deletions

View file

@ -75,6 +75,56 @@ schemas = [
'single_built_built.json',
],
},
# Match overall
{
'stem' : 'store-object-info',
'schema' : schema_dir / 'store-object-info-v1.yaml',
'files' : [
'pure.json',
'impure.json',
'empty_pure.json',
'empty_impure.json',
],
},
{
'stem' : 'nar-info',
'schema' : schema_dir / 'store-object-info-v1.yaml',
'files' : [
'pure.json',
'impure.json',
],
},
# Match exact variant
{
'stem' : 'store-object-info',
'schema' : schema_dir / 'store-object-info-v1.yaml#/$defs/base',
'files' : [
'pure.json',
'empty_pure.json',
],
},
{
'stem' : 'store-object-info',
'schema' : schema_dir / 'store-object-info-v1.yaml#/$defs/impure',
'files' : [
'impure.json',
'empty_impure.json',
],
},
{
'stem' : 'nar-info',
'schema' : schema_dir / 'store-object-info-v1.yaml#/$defs/base',
'files' : [
'pure.json',
],
},
{
'stem' : 'nar-info',
'schema' : schema_dir / 'store-object-info-v1.yaml#/$defs/narInfo',
'files' : [
'impure.json',
],
},
]
# Validate each example against the schema

View file

@ -0,0 +1 @@
../../src/libstore-tests/data/nar-info

View file

@ -25,6 +25,8 @@ mkMesonDerivation (finalAttrs: {
../../src/libstore-tests/data/store-path
../../src/libstore-tests/data/derivation
../../src/libstore-tests/data/derived-path
../../src/libstore-tests/data/path-info
../../src/libstore-tests/data/nar-info
./.
];

View file

@ -0,0 +1 @@
../../src/libstore-tests/data/path-info