Skip to content

Commit

Permalink
Auto update global dictionary. (envoyproxy#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwzhang authored Sep 26, 2017
1 parent c8bbd1c commit f3088af
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 190 deletions.
19 changes: 19 additions & 0 deletions mixerclient/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ licenses(["notice"])

load("@protobuf_bzl//:protobuf.bzl", "cc_proto_library")

py_binary(
name = "create_global_dictionary",
srcs = ["create_global_dictionary.py"],
)

genrule(
name = "global_dictionary_header_gen",
srcs = [
"@mixerapi_git//:mixer/v1/global_dictionary.yaml",
],
outs = [
"src/global_dictionary.cc",
],
cmd = "$(location //:create_global_dictionary) $(location @mixerapi_git//:mixer/v1/global_dictionary.yaml) > $@",
tools = [
"//:create_global_dictionary",
],
)

cc_library(
name = "mixer_client_lib",
srcs = [
Expand Down
3 changes: 2 additions & 1 deletion mixerclient/src/attribute_converter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ default_words: "time-key"
default_words: "int-key2"
default_words: "key"
default_words: "value"
global_word_count: 150
global_word_count: 111
)";

class AttributeConverterTest : public ::testing::Test {
Expand Down Expand Up @@ -316,6 +316,7 @@ TEST_F(AttributeConverterTest, BatchConvertTest) {
::istio::mixer::v1::ReportRequest expected_report_pb;
ASSERT_TRUE(
TextFormat::ParseFromString(kReportAttributes, &expected_report_pb));
report_pb->set_global_word_count(111);
EXPECT_TRUE(MessageDifferencer::Equals(*report_pb, expected_report_pb));
}

Expand Down
189 changes: 0 additions & 189 deletions mixerclient/src/global_dictionary.cc

This file was deleted.

0 comments on commit f3088af

Please sign in to comment.