implement very very simple stream sql support
This commit is contained in:
@ -92,6 +92,9 @@ TEST_CASE("Cobra_to_stdout_bot", "[cobra_bots]")
|
||||
cobraBotConfig.enableHeartbeat = false;
|
||||
bool quiet = false;
|
||||
|
||||
cobraBotConfig.filter =
|
||||
std::string("select * from `") + channel + "` where id = 'sms_metric_A_id'";
|
||||
|
||||
// We could try to capture the output ... not sure how.
|
||||
bool fluentd = true;
|
||||
|
||||
|
@ -18,14 +18,24 @@ namespace ix
|
||||
{
|
||||
SECTION("expression A")
|
||||
{
|
||||
snake::StreamSql streamSql("select * from subscriber_republished_v1_neo where session LIKE '%{self.session_id}%'");
|
||||
snake::StreamSql streamSql(
|
||||
"select * from subscriber_republished_v1_neo where session LIKE '%123456%'");
|
||||
|
||||
nlohmann::json msg = {
|
||||
{"action", "auth/authenticate/error"},
|
||||
{"id", 1},
|
||||
{"body", {{"error", "authentication_failed"}, {"reason", "invalid secret"}}}};
|
||||
nlohmann::json msg = {{"session", "123456"}, {"id", "foo_id"}, {"timestamp", 12}};
|
||||
|
||||
REQUIRE(streamSql.match(msg));
|
||||
CHECK(streamSql.match(msg));
|
||||
}
|
||||
|
||||
SECTION("expression A")
|
||||
{
|
||||
snake::StreamSql streamSql("select * from `subscriber_republished_v1_neo` where "
|
||||
"session = '30091320ed8d4e50b758f8409b83bed7'");
|
||||
|
||||
nlohmann::json msg = {{"session", "30091320ed8d4e50b758f8409b83bed7"},
|
||||
{"id", "foo_id"},
|
||||
{"timestamp", 12}};
|
||||
|
||||
CHECK(streamSql.match(msg));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user