forked from lix-project/nix-eval-jobs
Add test for a job with a nested attrset
This commit is contained in:
parent
7a9f13831c
commit
813c5d7aae
|
@ -1,7 +1,9 @@
|
||||||
let
|
{ pkgs ? import (builtins.getFlake (toString ./.)).inputs.nixpkgs { } }:
|
||||||
pkgs = import (builtins.getFlake (toString ./.)).inputs.nixpkgs { };
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
builtJob = pkgs.writeText "job1" "job1";
|
builtJob = pkgs.writeText "job1" "job1";
|
||||||
substitutedJob = pkgs.hello;
|
substitutedJob = pkgs.hello;
|
||||||
|
nested = {
|
||||||
|
job = pkgs.hello;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
hydraJobs = {
|
hydraJobs = import ./ci.nix { inherit pkgs; };
|
||||||
builtJob = pkgs.writeText "job1" "job1";
|
|
||||||
substitutedJob = pkgs.hello;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ def common_test(extra_args: List[str]) -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
results = [json.loads(r) for r in res.stdout.split("\n") if r]
|
results = [json.loads(r) for r in res.stdout.split("\n") if r]
|
||||||
assert len(results) == 2
|
assert len(results) == 3
|
||||||
|
|
||||||
built_job = results[0]
|
built_job = results[0]
|
||||||
assert built_job["attr"] == "builtJob"
|
assert built_job["attr"] == "builtJob"
|
||||||
|
@ -32,7 +32,11 @@ def common_test(extra_args: List[str]) -> None:
|
||||||
assert built_job["drvPath"].endswith(".drv")
|
assert built_job["drvPath"].endswith(".drv")
|
||||||
assert built_job["meta"]['broken'] is False
|
assert built_job["meta"]['broken'] is False
|
||||||
|
|
||||||
substituted_job = results[1]
|
nested_job = results[1]
|
||||||
|
assert nested_job["attr"] == "nested.job"
|
||||||
|
assert nested_job["name"].startswith("hello-")
|
||||||
|
|
||||||
|
substituted_job = results[2]
|
||||||
assert substituted_job["attr"] == "substitutedJob"
|
assert substituted_job["attr"] == "substitutedJob"
|
||||||
assert substituted_job["name"].startswith("hello-")
|
assert substituted_job["name"].startswith("hello-")
|
||||||
assert substituted_job["meta"]['broken'] is False
|
assert substituted_job["meta"]['broken'] is False
|
||||||
|
|
Loading…
Reference in a new issue