Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit772062a

Browse files
committed
Segregate setup and running of stress test
1 parentb2f8e82 commit772062a

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

‎run_tests.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
#
4-
# Copyright (c)2018, Postgres Professional
4+
# Copyright (c)2019, Postgres Professional
55
#
66
# supported levels:
77
#* standard
@@ -55,7 +55,7 @@ fi
5555

5656
# build and install PostgreSQL
5757
if ["$LEVEL"="hardcore" ]|| \
58-
["$LEVEL"="nightmare" ];then
58+
["$LEVEL"="nightmare" ];then
5959
# enable Valgrind support
6060
sed -i.bak"s/\/* #define USE_VALGRIND *\//#define USE_VALGRIND/g" src/include/pg_config_manual.h
6161

@@ -148,7 +148,8 @@ pip install -r tests/requirements.txt
148148
set -e#exit virtualenv with error code
149149
python tests/pg_qs_test_runner.py --port$PGPORT
150150
if [["$USE_TPCDS"=="1" ]];then
151-
python tests/pg_qs_test_runner.py --port$PGPORT --tpc-ds
151+
python tests/pg_qs_test_runner.py --port$PGPORT --tpc-ds-setup
152+
python tests/pg_qs_test_runner.py --port$PGPORT --tpc-ds-run
152153
fi
153154
deactivate
154155
set -x

‎tests/pg_qs_test_runner.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,15 @@ def main(config):
8686
key:config.__dict__[key]forkeyin ('host','port','user','database','password')
8787
}
8888

89-
ifconfig.use_tpcds:
89+
ifconfig.tpcds_setup:
90+
print('Setup database for TPC-DS bench')
91+
tpcds.setup_tpcds(conn_params)
92+
print('Database is setup successfully')
93+
return
94+
95+
ifconfig.tpcds_run:
9096
print('Starting stress test')
91-
tpcds.test_tpc_ds(conn_params)
97+
tpcds.run_tpcds(conn_params)
9298
print('Stress finished successfully')
9399
return
94100

@@ -115,7 +121,8 @@ def main(config):
115121
parser.add_argument('--user',dest='user',default='postgres',help='user name')
116122
parser.add_argument('--database',dest='database',default='postgres',help='database name')
117123
parser.add_argument('--password',dest='password',nargs=0,action=PasswordPromptAction,default='',help='password')
118-
parser.add_argument('--tpc-ds',dest='use_tpcds',action='store_true',help='run only stress test based on TPC-DS benchmark')
124+
parser.add_argument('--tpc-ds-setup',dest='tpcds_setup',action='store_true',help='setup database to run TPC-DS benchmark')
125+
parser.add_argument('--tpc-ds-run',dest='tpcds_run',action='store_true',help='run only stress test based on TPC-DS benchmark')
119126

120127
args=parser.parse_args()
121128
main(args)

‎tests/tpcds.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,10 @@ def setup_tpcds(config):
4848

4949
print('done!')
5050

51-
deftest_tpc_ds(config):
51+
defrun_tpcds(config):
5252
"""TPC-DS stress test"""
5353

54-
setup_tpcds(config)
55-
5654
print('Preparing TPC-DS queries...')
57-
# # Execute query in separate thread
58-
# # with open('tmp_stress/tpcds-kit/tools/query_0.sql', 'r') as f:
59-
# with open('tests/query_tpcds.sql', 'r') as f:
60-
# sql = f.read()
61-
62-
# queries = sql.split(';')
63-
# for i, query in enumerate(queries):
64-
# queries[i] = query.replace('%','%%')
65-
# if (len(query.strip()) == 0):
66-
# del queries[i]
6755
queries= []
6856
forquery_fileinsorted(os.listdir('tmp_stress/tpcds-result-reproduction/query_qualification/')):
6957
withopen('tmp_stress/tpcds-result-reproduction/query_qualification/%s'%query_file,'r')asf:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp