fix: tests

This commit is contained in:
Dennis Zhuang 2023-12-04 16:41:31 +08:00
parent 8bc874c261
commit a694f3c92d
2 changed files with 20 additions and 2 deletions

View File

@ -6,7 +6,7 @@
{emqx_connector, {path, "../../apps/emqx_connector"}}, {emqx_connector, {path, "../../apps/emqx_connector"}},
{emqx_resource, {path, "../../apps/emqx_resource"}}, {emqx_resource, {path, "../../apps/emqx_resource"}},
{emqx_bridge, {path, "../../apps/emqx_bridge"}}, {emqx_bridge, {path, "../../apps/emqx_bridge"}},
{greptimedb, {git, "https://github.com/GreptimeTeam/greptimedb-client-erl", {tag, "v0.1.3"}}} {greptimedb, {git, "https://github.com/GreptimeTeam/greptimedb-client-erl", {tag, "v0.1.4"}}}
]}. ]}.
{plugins, [rebar3_path_deps]}. {plugins, [rebar3_path_deps]}.
{project_plugins, [erlfmt]}. {project_plugins, [erlfmt]}.

View File

@ -797,11 +797,29 @@ t_bad_timestamp(Config) ->
#{?snk_kind := greptimedb_connector_send_query_error}, #{?snk_kind := greptimedb_connector_send_query_error},
10_000 10_000
), ),
fun(Result, _Trace) -> fun(Result, Trace) ->
?assertMatch({_, {ok, _}}, Result), ?assertMatch({_, {ok, _}}, Result),
{Return, {ok, _}} = Result, {Return, {ok, _}} = Result,
IsBatch = BatchSize > 1, IsBatch = BatchSize > 1,
case {QueryMode, IsBatch} of case {QueryMode, IsBatch} of
{async, true} ->
?assertEqual(ok, Return),
?assertMatch(
[#{error := points_trans_failed}],
?of_kind(greptimedb_connector_send_query_error, Trace)
);
{async, false} ->
?assertEqual(ok, Return),
?assertMatch(
[
#{
error := [
{error, {bad_timestamp, <<"bad_timestamp">>}}
]
}
],
?of_kind(greptimedb_connector_send_query_error, Trace)
);
{sync, false} -> {sync, false} ->
?assertEqual( ?assertEqual(
{error, [ {error, [