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 3, 2018

This commit 1) takes changes from dhrupadb-api-server-test and merges them against master as well as 2) adding tests for the dispatch operator in api_server

protected:
MetadataStoreTest() : config(), store(config) {}

std::map<MonitoredResource, MetadataStore::Metadata> GetMetadataMap() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

We got rid of this in #111 . GetMetadataMap() was made public.

int server_threads,
const std::string& host, int port)
: MetadataApiServer(config, store, server_threads, host, port,
std::map<std::pair<std::string, std::string>, Handler>({
Copy link
Contributor

Choose a reason for hiding this comment

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

You didn't have to make this change. First, you can test the Dispatcher class separately, and the HandleMonitoredResource callback separately (that's why the latter was pulled out in the first place). Second, the new code looks a lot uglier because of the explicit specs for the map and pair types. I would back out this whole commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking things over now, I agree. Ill close this pull request and open a new one testing Dispatcher directly

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. I meant this commit, not this PR. You could have reused the PR for the dispatch tests (or the HandleMonitoredResource test, which you still can — just reopen the PR).

EXPECT_EQ("", "");
class ApiServerTest : public ::testing::Test {
protected:
static void CallDispatcher(
Copy link
Contributor

Choose a reason for hiding this comment

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

The MetadataApiServer::Dispatcher class is public (an oversight, probably — there's no need for it to be — but for now it is accessible), so you can just create instances in the test.
You would need to wrap HandleMonitoredResource into an accessor function like this, because that one is private.

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