forked from lix-project/nix-eval-jobs
Remove outputs from JSON output
The output of the evaluator should only include either the full derivation (not yet implemented) or fields not directly accessible from the drv such as meta. Right now the output is a fairly arbitrary selection of fields.
This commit is contained in:
parent
8ccdf6497c
commit
434376f8e1
|
@ -171,11 +171,9 @@ static void worker(
|
|||
|
||||
auto drvPath = drv->queryDrvPath();
|
||||
|
||||
nlohmann::json job;
|
||||
|
||||
job["nixName"] = drv->queryName();
|
||||
job["system"] =drv->querySystem();
|
||||
job["drvPath"] = drvPath;
|
||||
reply["name"] = drv->queryName();
|
||||
reply["system"] = drv->querySystem();
|
||||
reply["drvPath"] = drvPath;
|
||||
|
||||
nlohmann::json meta;
|
||||
for (auto & name : drv->queryMetaNames()) {
|
||||
|
@ -193,7 +191,6 @@ static void worker(
|
|||
nlohmann::json field = nlohmann::json::parse(ss.str());
|
||||
meta[name] = field;
|
||||
}
|
||||
job["meta"] = meta;
|
||||
|
||||
/* Register the derivation as a GC root. !!! This
|
||||
registers roots for jobs that we may have already
|
||||
|
@ -206,14 +203,6 @@ static void worker(
|
|||
localStore->addPermRoot(storePath, root);
|
||||
}
|
||||
|
||||
DrvInfo::Outputs outputs = drv->queryOutputs();
|
||||
nlohmann::json out;
|
||||
for (auto & p : outputs) {
|
||||
out[p.first] = p.second;
|
||||
}
|
||||
job["outputs"] = std::move(out);
|
||||
|
||||
reply["job"] = std::move(job);
|
||||
}
|
||||
|
||||
else if (v->type() == nAttrs)
|
||||
|
|
|
@ -27,12 +27,12 @@ def common_test(extra_args: List[str]) -> None:
|
|||
|
||||
built_job = results[0]
|
||||
assert built_job["attr"] == "builtJob"
|
||||
assert built_job["job"]["nixName"] == "job1"
|
||||
assert built_job["name"] == "job1"
|
||||
|
||||
|
||||
substituted_job = results[1]
|
||||
assert substituted_job["attr"] == "substitutedJob"
|
||||
assert substituted_job["job"]["nixName"].startswith("hello-")
|
||||
assert substituted_job["name"].startswith("hello-")
|
||||
|
||||
|
||||
def test_flake() -> None:
|
||||
|
|
Loading…
Reference in a new issue