Skip to content

Commit

Permalink
Merge pull request #7872 from obsidiansystems/test-derivation-to-json
Browse files Browse the repository at this point in the history
`Derivation::toJSON`: fix bug!
  • Loading branch information
tomberek committed Feb 20, 2023
2 parents c7bd3a8 + 208c8d3 commit 5510daf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libstore/derivations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ nlohmann::json Derivation::toJSON(const Store & store) const
res["system"] = platform;
res["builder"] = builder;
res["args"] = args;
res["env"] = env;

return res;
}
Expand Down
9 changes: 9 additions & 0 deletions src/libstore/tests/derivation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ TEST_JSON(Derivation, impure,
"bar",
"baz"
],
"env": {
"BIG_BAD": "WOLF"
},
"outputs": {}
})",
({
Expand All @@ -107,6 +110,12 @@ TEST_JSON(Derivation, impure,
"bar",
"baz",
};
drv.env = {
{
"BIG_BAD",
"WOLF",
},
};
drv;
}))

Expand Down

0 comments on commit 5510daf

Please sign in to comment.