mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Turn derivation unit tests into unit characterization tests
The brings a number of advantages, including: - Easier to update test data if design changes (and I do think our derivation JSON is not yet complaint with the guidelines). - Easier to reuse test data in other implementations, inching closer to compliance tests for Nix *the concept* rather than any one implementation.
This commit is contained in:
parent
232e236672
commit
a419b61497
17 changed files with 228 additions and 155 deletions
|
@ -0,0 +1 @@
|
|||
Derive([],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",(["cat","dog"],[("cat",["kitten"]),("goose",["gosling"])]))],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")])
|
1
unit-test-data/libstore/derivation/bad-version.drv
Normal file
1
unit-test-data/libstore/derivation/bad-version.drv
Normal file
|
@ -0,0 +1 @@
|
|||
DrvWithVersion("invalid-version",[],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",["cat","dog"])],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")])
|
1
unit-test-data/libstore/derivation/dynDerivationDeps.drv
Normal file
1
unit-test-data/libstore/derivation/dynDerivationDeps.drv
Normal file
|
@ -0,0 +1 @@
|
|||
DrvWithVersion("xp-dyn-drv",[],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",(["cat","dog"],[("cat",["kitten"]),("goose",["gosling"])]))],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")])
|
38
unit-test-data/libstore/derivation/dynDerivationDeps.json
Normal file
38
unit-test-data/libstore/derivation/dynDerivationDeps.json
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"args": [
|
||||
"bar",
|
||||
"baz"
|
||||
],
|
||||
"builder": "foo",
|
||||
"env": {
|
||||
"BIG_BAD": "WOLF"
|
||||
},
|
||||
"inputDrvs": {
|
||||
"/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv": {
|
||||
"dynamicOutputs": {
|
||||
"cat": {
|
||||
"dynamicOutputs": {},
|
||||
"outputs": [
|
||||
"kitten"
|
||||
]
|
||||
},
|
||||
"goose": {
|
||||
"dynamicOutputs": {},
|
||||
"outputs": [
|
||||
"gosling"
|
||||
]
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
"cat",
|
||||
"dog"
|
||||
]
|
||||
}
|
||||
},
|
||||
"inputSrcs": [
|
||||
"/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"
|
||||
],
|
||||
"name": "dyn-dep-derivation",
|
||||
"outputs": {},
|
||||
"system": "wasm-sel4"
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"hash": "894517c9163c896ec31a2adbd33c0681fd5f45b2c0ef08a64c92a03fb97f390f",
|
||||
"hashAlgo": "sha256",
|
||||
"path": "/nix/store/rhcg9h16sqvlbpsa6dqm57sbr2al6nzg-drv-name-output-name"
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"hash": "894517c9163c896ec31a2adbd33c0681fd5f45b2c0ef08a64c92a03fb97f390f",
|
||||
"hashAlgo": "r:sha256",
|
||||
"path": "/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-drv-name-output-name"
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"hash": "894517c9163c896ec31a2adbd33c0681fd5f45b2c0ef08a64c92a03fb97f390f",
|
||||
"hashAlgo": "text:sha256",
|
||||
"path": "/nix/store/6s1zwabh956jvhv4w9xcdb5jiyanyxg1-drv-name-output-name"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"hashAlgo": "r:sha256"
|
||||
}
|
1
unit-test-data/libstore/derivation/output-deferred.json
Normal file
1
unit-test-data/libstore/derivation/output-deferred.json
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
4
unit-test-data/libstore/derivation/output-impure.json
Normal file
4
unit-test-data/libstore/derivation/output-impure.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"hashAlgo": "r:sha256",
|
||||
"impure": true
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"path": "/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-drv-name-output-name"
|
||||
}
|
1
unit-test-data/libstore/derivation/simple.drv
Normal file
1
unit-test-data/libstore/derivation/simple.drv
Normal file
|
@ -0,0 +1 @@
|
|||
Derive([],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",["cat","dog"])],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")])
|
25
unit-test-data/libstore/derivation/simple.json
Normal file
25
unit-test-data/libstore/derivation/simple.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"args": [
|
||||
"bar",
|
||||
"baz"
|
||||
],
|
||||
"builder": "foo",
|
||||
"env": {
|
||||
"BIG_BAD": "WOLF"
|
||||
},
|
||||
"inputDrvs": {
|
||||
"/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv": {
|
||||
"dynamicOutputs": {},
|
||||
"outputs": [
|
||||
"cat",
|
||||
"dog"
|
||||
]
|
||||
}
|
||||
},
|
||||
"inputSrcs": [
|
||||
"/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"
|
||||
],
|
||||
"name": "simple-derivation",
|
||||
"outputs": {},
|
||||
"system": "wasm-sel4"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue