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 automatic table cleanup after go sdk tests #3799

Merged
merged 1 commit into from Mar 12, 2024

Conversation

oh2024
Copy link
Collaborator

@oh2024 oh2024 commented Mar 11, 2024

  • What kind of change does this PR introduce?
    This PR introduces a test enhancement in the Go SDK. It adds automatic cleanup logic for database table created during tests, ensuring that tests can be rerun without the need for manual table deletion.

  • What is the current behavior? (You can also link to an open issue here)
    Currently, the tests in the Go SDK create demo table in the database to verify various functionalities. However, it's not automatically cleaned up after the tests are completed. This behavior requires manual intervention to delete the table before tests can be rerun, leading to inefficiencies in the development process.

  • What is the new behavior (if this is a feature change)?
    With this change, the Go SDK tests now include cleanup logic that automatically deletes demo table created during the testing process. This ensures that the database is restored to its initial state after the tests complete, allowing for tests to be rerun multiple times without manual cleanup. This improvement streamlines the testing process, making it more efficient and less error-prone.

@oh2024 oh2024 changed the title Automatic Table Cleanup in Go SDK Tests for Reusability test: add automatic table cleanup after tests Mar 11, 2024
@oh2024 oh2024 changed the title test: add automatic table cleanup after tests test: add automatic table cleanup after go sdk tests Mar 11, 2024
Copy link
Contributor

SDK Test Report

101 files  ±0  101 suites  ±0   2m 5s ⏱️ -8s
345 tests ±0  331 ✅ ±0  14 💤 ±0  0 ❌ ±0 
471 runs  ±0  457 ✅ ±0  14 💤 ±0  0 ❌ ±0 

Results for commit eb83f3d. ± Comparison against base commit 42f9b89.

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)

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.31%. Comparing base (5e7f266) to head (eb83f3d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3799      +/-   ##
============================================
+ Coverage     40.28%   40.31%   +0.02%     
  Complexity      658      658              
============================================
  Files           194      194              
  Lines         11436    11436              
  Branches       1380     1380              
============================================
+ Hits           4607     4610       +3     
+ Misses         6525     6522       -3     
  Partials        304      304              

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

Copy link
Contributor

Linux Test Report

 53 files  ±0   60 suites  ±0   27m 58s ⏱️ -3s
671 tests ±0  651 ✅ ±0  7 💤 ±0  13 ❌ ±0 
672 runs  ±0  652 ✅ ±0  7 💤 ±0  13 ❌ ±0 

For more details on these failures, see this check.

Results for commit eb83f3d. ± Comparison against base commit 42f9b89.

Copy link
Collaborator

@tobegit3hub tobegit3hub left a comment

Choose a reason for hiding this comment

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

LGTM

@tobegit3hub tobegit3hub merged commit 3df6bd1 into 4paradigm:main Mar 12, 2024
19 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants