Commit Graph

26 Commits

Author SHA1 Message Date
shuming.li 1785077e7b
[UT] Fix print_hit_materialized_views to ensure the result deterministic (#63862)
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
2025-10-10 18:25:44 +08:00
shuming.li ee28a4b9ac
[UT] Avoid partition ttl scheduler affecting tests (#63615)
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
2025-09-26 17:11:07 +08:00
PengFei Li d60c76aa52
[Tool] Add CLEANUP block to SQL-tester for reliable per-case teardown (#63068)
## Why I’m doing
- Tests often enable temporary configs, create transient objects, or invoke external side-effects. When a test fails mid-way, ad-hoc cleanup embedded in the test body may be skipped, leaving residue that causes flakiness and cross-test interference.
- This change provides a first-class, always-run teardown mechanism that executes after each case, regardless of pass/fail, improving test reliability and isolation, and simplifying test authoring.

## What I’m doing
- Introduce a CLEANUP block to SQL-tester that defines statements to run in tearDown for each case.
- Semantics:
  - CLEANUP runs unconditionally in tearDown after each case (pass/fail/timeout).
  - Results in CLEANUP are not validated; failures are logged but do not prevent later cleanup steps.
  - Existing built-in cleanup (e.g., dropping parsed DATABASE/RESOURCE) still runs; CLEANUP is additive.
  - In record mode, the CLEANUP block is preserved in-place in the generated R file.
- Syntax and example:
```sql
-- name: my_case
...
CLEANUP {
  -- SQL must end with ';'
  DROP TABLE IF EXISTS t1;
  DROP DATABASE IF EXISTS db_${uuid0};
  -- shell and function are allowed
  shell: echo "cleanup ${uuid0}"
  function: restore_env("arg1")
} END CLEANUP
```

**Code changes**
- test/README.md
  - Document the CLEANUP grammar, usage, semantics, and example.
- test/lib/__init__.py
  - Add CLEANUP/END CLEANUP flags.
- test/lib/choose_cases.py
  - Parse CLEANUP blocks, collect commands, validate format, include in case model, support variable/uuid replacement, and record block in-place during -r mode.
- test/test_sql_cases.py
  - Execute collected CLEANUP commands in tearDown unconditionally; keep record-mode output aligned; ensure built-in database/resource cleanup still runs.

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
2025-09-15 14:27:43 +08:00
andyziye fb44105882
[Tool] Add cluster status checker before SQL case (#61577)
Signed-off-by: andyziye <yeziyu@starrocks.com>
2025-08-05 19:10:24 +08:00
Zach 18f327f8b3
[Feature]Support Arrow Flight SQL V1 (#57956)
Signed-off-by: Zac-saodiseng <3253345336@qq.com>
Signed-off-by: Zach <3253345336@qq.com>
2025-05-26 14:22:43 +08:00
liubotao becbf01951
[Feature] Support the Arrow Flight SQL protocol to enhance data transfer efficiency (#50199)
Signed-off-by: liubotao <316945435@qq.com>
2024-11-15 15:27:52 +08:00
shuming.li 3c896df731
[BugFix] Fix mv refresh with multi partition columns ref base tables (#52017)
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
2024-10-17 16:14:46 +08:00
andyziye 4eff9df108
[Tool] Detect SQL-Tester conf and filter the cases (#50336)
Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
2024-09-04 09:38:21 +08:00
andyziye cb0b04c223
[Tool] SQL-Tester: Support connection pool in concurrency (#50424) 2024-09-03 10:41:35 +08:00
andyziye 58f8262e3c
[Tool] Fix uuid is replaced in SQL-Tester loop struct (#50205) 2024-08-23 21:18:26 +08:00
andyziye 1ba1a59d38
[Tool] SQL-Tester support `loop` and `concurrency` grammar (#49856)
Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
2024-08-22 16:54:50 +08:00
andyziye 0ebc5cb360
[Tool] CI env change to ubuntu (#48373)
Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
2024-08-22 09:40:49 +08:00
shuming.li cfeb27ba47
[UT] Fix mv sqltester bugs (#50087)
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
2024-08-21 21:43:53 +08:00
shuming.li 4b4db3181a
[Enhancement] Support mv refresh to use materialized view rewrite by enable_mv_refresh_query_rewrite config (#45338)
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
2024-08-09 12:38:00 +08:00
andyziye caf94f3b83
[Tool] SQL-Tester add timeout limit for single case (#48792)
Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
2024-08-01 19:53:31 +08:00
shuming.li e22a42af91
[Enhancement] (Multi Ref Base Table Part2) MVPCTRefreshPlanBuilder supports multi ref base tables in mv refresh (#48284)
Signed-off-by: shuming.li <ming.moriarty@gmail.com>
2024-07-16 19:27:30 +08:00
Letian Jiang d1af71bd41
[Tool] Connect non-StarRocks engine on demand (#47536)
Signed-off-by: Letian Jiang <letian.jiang@outlook.com>
2024-06-26 20:46:00 +08:00
Letian Jiang 1457922cf5
[Tool] SQL test support hive/spark/trino engines (#47333)
Signed-off-by: Letian Jiang <letian.jiang@outlook.com>
2024-06-26 15:36:14 +08:00
andyziye 312b03db0c
[Tool] Add AWS config in SQL-Tester (#37258) 2023-12-19 13:20:10 +08:00
huailiu1122 019fa2220b
[Tool] Fix sqltest R file write in T file cases order (#29968) 2023-08-31 11:34:14 +08:00
huailiu1122 8b99939516
[Tool]fix sqltest framework db duplicated warning info (#26872) 2023-08-03 17:12:42 +08:00
andyziye 27e4d827ac
[Tool] FE Total Coverage (#27303)
Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
2023-07-15 19:30:34 +08:00
huailiu1122 55d6ef5343
[Tool]fix bug (#25605) 2023-06-20 11:35:39 +08:00
huailiu1122 aa16cd077c
[Tool] rebuild sql test framework and add repeat runs (#25315) 2023-06-15 15:32:15 +08:00
AndyZiYe 2766ff4ea9
[Tool] Sql-tester add case name && fix requirements (#20364)
Sql-tester add report && case name && requirements
Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
2023-03-27 19:06:02 +08:00
AndyZiYe 7c50236fb7
[Tool] SQL Testing Framework (#17892)
add sql-test framework
2023-02-17 17:07:20 +08:00