Added unit test for GetLegacyResource#120
Conversation
| {"pod_id", "TestUid"}, | ||
| {"zone", "TestZone"}, | ||
| }), m.resource()); | ||
| EXPECT_EQ("", m.metadata().version); |
There was a problem hiding this comment.
change this to:
EXPECT_TRUE(m.metadata().version.empty());
| })} | ||
| }); | ||
| const auto m = GetLegacyResource(reader, json::object({ | ||
| {"metadata", json::object({ |
There was a problem hiding this comment.
Isn't this just pod->As<json::Object>()?
There was a problem hiding this comment.
Removed pod, it was supposed to be inlined.
There was a problem hiding this comment.
I was actually suggesting you keep pod...
| EXPECT_FALSE(m.metadata().is_deleted); | ||
| EXPECT_EQ(Timestamp(), m.metadata().created_at); | ||
| EXPECT_EQ(Timestamp(), m.metadata().collected_at); | ||
| EXPECT_TRUE(m.metadata().ignore); |
There was a problem hiding this comment.
Leave this one, remove all of the other checks of m.metadata() — they're implementation details.
| EXPECT_EQ(Timestamp(), m.metadata().created_at); | ||
| EXPECT_EQ(Timestamp(), m.metadata().collected_at); | ||
| EXPECT_TRUE(m.metadata().ignore); | ||
| EXPECT_EQ(json::object({})->ToString(), m.metadata().metadata->ToString()); |
There was a problem hiding this comment.
Irrelevant now, but json::object()->ToString() is just "{}".
There was a problem hiding this comment.
Yep, but removed as you pointed out.
| })->As<json::Object>(), "TestContainerName"); | ||
| EXPECT_EQ(std::vector<std::string>({ | ||
| "gke_container.TestNamespace.TestUid.TestContainerName", | ||
| "gke_container.TestNamespace.TestName.TestContainerName" |
There was a problem hiding this comment.
Trailing comma, please.
| })} | ||
| }); | ||
| const auto m = GetLegacyResource(reader, json::object({ | ||
| {"metadata", json::object({ |
There was a problem hiding this comment.
I was actually suggesting you keep pod...
ea02f0f to
9fd6819
Compare
|
Rebased against master |
No description provided.