From 6d42ddb7f9828f1929469418eb0ccd47f8a123da Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 27 Mar 2023 19:58:47 +0800 Subject: [PATCH] test: add udfpy_main.py to ci --- tests/parallel_test/cases.task | 1 + tests/system-test/0-others/udfpy/af_count.py | 20 ++++++-------------- tests/system-test/0-others/udfpy_main.py | 4 ++-- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 6e0b180ed8..00e7c6ddd1 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -120,6 +120,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/fsync.py ,,n,system-test,python3 ./test.py -f 0-others/compatibility.py ,,n,system-test,python3 ./test.py -f 0-others/tag_index_basic.py +,,n,system-test,python3 ./test.py -f 0-others/udfpy_main.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_database.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py diff --git a/tests/system-test/0-others/udfpy/af_count.py b/tests/system-test/0-others/udfpy/af_count.py index 285ef96b55..226e02235f 100644 --- a/tests/system-test/0-others/udfpy/af_count.py +++ b/tests/system-test/0-others/udfpy/af_count.py @@ -1,5 +1,3 @@ -import pickle - def init(): pass @@ -7,23 +5,17 @@ def destroy(): pass def start(): - return pickle.dumps([]) + return pickle.dumps(0) def finish(buf): - counts = pickle.loads(buf) - all_count = 0 - for count in counts: - all_count += count - - return all_count + count = pickle.loads(buf) + return count def reduce(datablock, buf): (rows, cols) = datablock.shape() - counts = pickle.loads(buf) - batch_count = 0 + count = pickle.loads(buf) for i in range(rows): val = datablock.data(i, 0) if val is not None: - batch_count += 1 - counts.append(batch_count) - return pickle.dumps(counts) + count += 1 + return pickle.dumps(count) \ No newline at end of file diff --git a/tests/system-test/0-others/udfpy_main.py b/tests/system-test/0-others/udfpy_main.py index 55a60d4314..eaadfbdbd6 100644 --- a/tests/system-test/0-others/udfpy_main.py +++ b/tests/system-test/0-others/udfpy_main.py @@ -401,8 +401,8 @@ class TDTestCase: # var stable = "meters" tbname = "d" - count = 3 - rows = 3000000 + count = 10 + rows = 50000 # do self.create_table(stable, tbname, count) self.insert_data(tbname, rows) -- GitLab