Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Conversation

@ACEmilG
Copy link
Contributor

@ACEmilG ACEmilG commented Apr 2, 2018

No description provided.

@igorpeshansky igorpeshansky changed the title Added GetModMetadata unit test Added GetPodMetadata unit test Apr 2, 2018
EXPECT_EQ(time::rfc3339::FromString("2018-03-03T01:23:45.678901234Z"),
m.metadata().created_at);
EXPECT_EQ(Timestamp(), m.metadata().collected_at);
EXPECT_EQ(false, m.metadata().ignore);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXPECT_FALSE(m.metadata().ignore);

{"namespace_name", "TestNamespace"},
}), m.resource());
EXPECT_EQ("TestVersion", m.metadata().version);
EXPECT_EQ(false, m.metadata().is_deleted);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXPECT_FALSE(m.metadata().is_deleted);

Copy link
Contributor

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

Copy link
Contributor

@supriyagarg supriyagarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comment. Otherwise LGTM

const KubernetesReader& reader, const json::Object* pod,
json::value associations, Timestamp collected_at, bool is_deleted) const
throw(json::Exception) {
return reader.GetPodMetadata(pod, std::move(associations), collected_at, is_deleted);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is too long

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed this one! Fixed

Copy link
Contributor

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits.

"KubernetesClusterLocation: TestClusterLocation\n"
"MetadataApiResourceTypePerarator: \",\"\n"
"MetadataIngestionRawContentVersion: TestVersion\n"
));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unindent 2 spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

{"name", json::string("TestName")},
{"uid", json::string("TestUid")},
{"creationTimestamp", json::string("2018-03-03T01:23:45.678901234Z")},
})}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing comma, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

json::string("2018-03-03T01:23:45.678901234Z")},
{"name", json::string("TestName")},
{"namespace", json::string("TestNamespace")},
{"uid", json::string("TestUid")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing comma, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

{"uid", json::string("TestUid")},
{"creationTimestamp", json::string("2018-03-03T01:23:45.678901234Z")},
})},
})->As<json::Object>(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ->As<json::Object>() and ->ToString() calls get lost at the end of inline JSON values... That's why I'm suggesting factoring them out into locals, to make this more readable... WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I'll go forward and do this now.

Copy link
Contributor

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@ACEmilG ACEmilG merged commit cdb4bdd into master Apr 2, 2018
@ACEmilG ACEmilG deleted the ACEmilG-GetPodMetadata-test branch April 2, 2018 22:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants