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

Added GetPodMetadata unit test#118

Merged
ACEmilG merged 5 commits intomasterfrom
ACEmilG-GetPodMetadata-test
Apr 2, 2018
Merged

Added GetPodMetadata unit test#118
ACEmilG merged 5 commits intomasterfrom
ACEmilG-GetPodMetadata-test

Conversation

@ACEmilG
Copy link
Copy Markdown
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
Comment thread test/kubernetes_unittest.cc Outdated
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
Copy Markdown
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);

Comment thread test/kubernetes_unittest.cc Outdated
{"namespace_name", "TestNamespace"},
}), m.resource());
EXPECT_EQ("TestVersion", m.metadata().version);
EXPECT_EQ(false, m.metadata().is_deleted);
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread test/kubernetes_unittest.cc Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread test/kubernetes_unittest.cc Outdated
"KubernetesClusterLocation: TestClusterLocation\n"
"MetadataApiResourceTypePerarator: \",\"\n"
"MetadataIngestionRawContentVersion: TestVersion\n"
));
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread test/kubernetes_unittest.cc Outdated
{"name", json::string("TestName")},
{"uid", json::string("TestUid")},
{"creationTimestamp", json::string("2018-03-03T01:23:45.678901234Z")},
})}
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added

Comment thread test/kubernetes_unittest.cc Outdated
json::string("2018-03-03T01:23:45.678901234Z")},
{"name", json::string("TestName")},
{"namespace", json::string("TestNamespace")},
{"uid", json::string("TestUid")}
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added

Comment thread test/kubernetes_unittest.cc Outdated
{"uid", json::string("TestUid")},
{"creationTimestamp", json::string("2018-03-03T01:23:45.678901234Z")},
})},
})->As<json::Object>(),
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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