Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add msg and refresh for coverage test #3413

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

vagetablechicken
Copy link
Collaborator

No description provided.

@vagetablechicken vagetablechicken linked an issue Jul 31, 2023 that may be closed by this pull request
@github-actions github-actions bot added the storage-engine openmldb storage engine. nameserver & tablet label Jul 31, 2023
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch coverage: 58.33% and project coverage change: +0.01% 🎉

Comparison is base (1b8d596) 75.33% compared to head (4159695) 75.34%.
Report is 8 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3413      +/-   ##
============================================
+ Coverage     75.33%   75.34%   +0.01%     
  Complexity      414      414              
============================================
  Files           707      707              
  Lines        128428   128442      +14     
  Branches       1191     1191              
============================================
+ Hits          96751    96775      +24     
+ Misses        31436    31426      -10     
  Partials        241      241              
Files Changed Coverage Δ
src/client/tablet_client.cc 58.41% <0.00%> (-0.58%) ⬇️
src/nameserver/name_server_impl.cc 44.93% <ø> (+0.16%) ⬆️
src/nameserver/name_server_impl.h 100.00% <ø> (ø)
src/tablet/tablet_impl.cc 65.34% <62.50%> (-0.08%) ⬇️
src/cmd/sql_cmd_test.cc 98.70% <100.00%> (+<0.01%) ⬆️
src/tablet/sql_cluster_availability_test.cc 93.98% <100.00%> (+0.02%) ⬆️

... and 12 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 31, 2023

Linux Test Report

       57 files  ±0       234 suites  ±0   1h 12m 1s ⏱️ - 3m 15s
12 083 tests ±0  12 076 ✔️ ±0  7 💤 ±0  0 ±0 
17 145 runs  ±0  17 138 ✔️ ±0  7 💤 ±0  0 ±0 

Results for commit 4159695. ± Comparison against base commit 1b8d596.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 31, 2023

SDK Test Report

  98 files  ±0    98 suites  ±0   1m 58s ⏱️ -29s
222 tests ±0  209 ✔️ ±0  13 💤 ±0  0 ±0 
269 runs  ±0  256 ✔️ ±0  13 💤 ±0  0 ±0 

Results for commit 4159695. ± Comparison against base commit 1b8d596.

This pull request removes 30 and adds 9 tests. Note that renamed tests count towards both.
  PARTITION BY db1.t1.col2 ORDER BY db1.t1.col1
  PARTITION BY t1.col2 ORDER BY t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](1)
 ) limit 10;](2)
 ) limit 10;](3)
 FROM db1.t1
 FROM t1
 WINDOW w1 AS (
 last join db2.t2 order by db2.t2.col1
…
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlLastJoinWithMultipleDB[,  SELECT sum(db1.t1.col1) over w1 as sum_t1_col1, db2.t2.str1 as t2_str1
 FROM db1.t1
 last join db2.t2 order by db2.t2.col1
 on db1.t1.col1 = db2.t2.col1 and db1.t1.col2 = db2.t2.col0
 WINDOW w1 AS (
  PARTITION BY db1.t1.col2 ORDER BY db1.t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](2)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlLastJoinWithMultipleDB[db1,  SELECT sum(t1.col1) over w1 as sum_t1_col1, db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0
 WINDOW w1 AS (
  PARTITION BY t1.col2 ORDER BY t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](1)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlLastJoinWithMultipleDB[null,  SELECT sum(db1.t1.col1) over w1 as sum_t1_col1, db2.t2.str1 as t2_str1
 FROM db1.t1
 last join db2.t2 order by db2.t2.col1
 on db1.t1.col1 = db2.t2.col1 and db1.t1.col2 = db2.t2.col0
 WINDOW w1 AS (
  PARTITION BY db1.t1.col2 ORDER BY db1.t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](3)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[, SELECT db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Fail to transform data provider op: table t1 not exists in database []](4)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[db1, SELECT db1.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Column Not found: db1.t2.str1](2)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[db1, SELECT db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Column Not found: .t2.col1](3)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[db1, SELECT t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Column Not found: .t2.str1](1)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlMultipleDBErrorTest[null, SELECT db2.t2.str1 as t2_str1
 FROM t1
 last join db2.t2 order by db2.t2.col1
 on t1.col1 = db2.t2.col1 and t1.col2 = db2.t2.col0;
, SQL parse error: Fail to transform data provider op: table t1 not exists in database []](5)
com._4paradigm.hybridse.sdk.SqlEngineTest ‑ sqlWindowLastJoin[ SELECT sum(t1.col1) over w1 as sum_t1_col1, t2.str1 as t2_str1
 FROM t1
 last join t2 order by t2.col1
 on t1.col1 = t2.col1 and t1.col2 = t2.col0
 WINDOW w1 AS (
  PARTITION BY t1.col2 ORDER BY t1.col1
  ROWS_RANGE BETWEEN 3 PRECEDING AND CURRENT ROW
 ) limit 10;](1)

♻️ This comment has been updated with latest results.

// helpful for debug
// TODO if refresh is not good, sleep more
Copy link
Contributor

Choose a reason for hiding this comment

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

[cpplint] reported by reviewdog 🐶
Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]

@@ -553,8 +553,13 @@ void TabletImpl::Refresh(RpcController* controller, const ::openmldb::api::Refre
::openmldb::api::GeneralResponse* response, Closure* done) {
brpc::ClosureGuard done_guard(done);
if (IsClusterMode()) {
if (RefreshSingleTable(request->tid())) {
PDLOG(INFO, "refresh success. tid %u", request->tid());
if(request->has_tid()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[cpplint] reported by reviewdog 🐶
Missing space before ( in if( [whitespace/parens] [5]

@@ -2998,8 +2998,12 @@ TEST_P(DBSDKTest, LongWindowsCleanup) {
HandleSQL("create database test2;");
HandleSQL("use test2;");
HandleSQL(create_sql);
sleep(5);
// TODO if refresh is not good, sleep more
Copy link
Contributor

Choose a reason for hiding this comment

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

[cpplint] reported by reviewdog 🐶
Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]

@@ -5219,6 +5224,7 @@ void TabletImpl::CreateProcedure(RpcController* controller, const openmldb::api:
const std::string& db_name = sp_info.db_name();
const std::string& sp_name = sp_info.sp_name();
const std::string& sql = sp_info.sql();
LOG(INFO) << "create procedure rpc in " << endpoint_; // no get size func << " with sp cache " << sp_cache_->
Copy link
Contributor

Choose a reason for hiding this comment

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

[cpplint] reported by reviewdog 🐶
At least two spaces is best between code and comments [whitespace/comments] [2]

@@ -5283,7 +5289,7 @@

response->set_code(::openmldb::base::ReturnCode::kOk);
response->set_msg("ok");
LOG(INFO) << "create procedure success! sp_name: " << sp_name << ", db: " << db_name << ", sql: " << sql;
LOG(INFO) << "create procedure success! sp_name: " << sp_name << ", db: " << db_name << ", sql: " << sql << " on " << endpoint_;
Copy link
Contributor

Choose a reason for hiding this comment

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

[cpplint] reported by reviewdog 🐶
Lines should be <= 120 characters long [whitespace/line_length] [2]

@vagetablechicken
Copy link
Collaborator Author

@@ -5222,7 +5227,8 @@ void TabletImpl::CreateProcedure(RpcController* controller, const openmldb::api:
if (sp_cache_->ProcedureExist(db_name, sp_name)) {
response->set_code(::openmldb::base::ReturnCode::kProcedureAlreadyExists);
response->set_msg("store procedure already exists");
PDLOG(WARNING, "store procedure[%s] already exists in db[%s]", sp_name.c_str(), db_name.c_str());
// print endpoint for ut debug
PDLOG(WARNING, "store procedure[%s] already exists in db[%s] on %s", sp_name.c_str(), db_name.c_str(), endpoint_.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

[cpplint] reported by reviewdog 🐶
Lines should be <= 120 characters long [whitespace/line_length] [2]

@@ -5311,7 +5317,7 @@
}
response->set_code(::openmldb::base::ReturnCode::kOk);
response->set_msg("ok");
PDLOG(INFO, "drop procedure success. db_name[%s] sp_name[%s]", db_name.c_str(), sp_name.c_str());
PDLOG(INFO, "drop procedure success. db_name[%s] sp_name[%s] on %s", db_name.c_str(), sp_name.c_str(), endpoint_.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

[cpplint] reported by reviewdog 🐶
Lines should be <= 120 characters long [whitespace/line_length] [2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
storage-engine openmldb storage engine. nameserver & tablet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coverage fails at high freq
1 participant