Skip to content

Commit

Permalink
Add info_invalid to graph node serialization (#13688)
Browse files Browse the repository at this point in the history
* Add info_invalid to graph node serialization

* Add info_invalid to graph node serialization

* Address review comments

* Address review comments x2
  • Loading branch information
AbrilRBS authored Apr 14, 2023
1 parent 1a61536 commit c5f9bd9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions conans/client/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def serialize(self):
result["binary"] = self.binary
# TODO: This doesn't match the model, check it
result["invalid_build"] = self.cant_build
result["info_invalid"] = getattr(getattr(self.conanfile, "info", None), "invalid", None)
# Adding the conanfile information: settings, options, etc
result.update(self.conanfile.serialize())
result["context"] = self.context
Expand Down
2 changes: 0 additions & 2 deletions conans/test/integration/command/info/info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ class MyTest(ConanFile):
assert recipe["provides"] == ["bar"]




class TestConanfilePath:
def test_cwd(self):
# Check the first positional argument is a relative path
Expand Down
2 changes: 2 additions & 0 deletions conans/test/integration/package_id/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ def validate(self):

client.run("graph info --require pkg/0.1 -s os=Windows")
self.assertIn("binary: Invalid", client.out)
assert "info_invalid: Windows not supported" in client.out

client.run("graph info --require pkg/0.1 -s os=Windows --format json")
myjson = json.loads(client.stdout)
self.assertEqual(myjson["nodes"][1]["binary"], BINARY_INVALID)
assert myjson["nodes"][1]["info_invalid"] == "Windows not supported" in client.out

def test_validate_header_only(self):
client = TestClient()
Expand Down

0 comments on commit c5f9bd9

Please sign in to comment.