Extend pre-checks. Misc. Improvements: escape $, support arrays in pre_sql and workload_sql; support empty arrays
Make sure that the options are specified in the correct format:
-
option=value
in the 'pre_configs' option, and is an array. -
The pgbench
utility is specified in the 'workload_pgbench' option.- It is difficult to fully check the syntax of the command being executed without actually executing it. Therefore, we are adding only a basic check for the presence of the pgbench command.
- Note: Analyze the result after executing the test.
-
SQL statement in the 'pre_sql' and 'workload_sql' options.- Skip it. It would be extremely difficult and inefficient to create a full-fledged SQL parser in a Bash script, given the complexity of the SQL syntax and the variety of possible commands and constructs.
- Note: Analyze the result after executing the test.
Improvements
- Support for an empty array in pre_configs
- Execute commands only if the array is not empty
- Fixed: https://gitlab.com/postgres-ai/postgresql-consulting/tests-and-benchmarks/-/jobs/5855245322
- Support for newline characters in SQL
- Escape newline characters in
TEST_RUNS
variable, and delete newline characters in 'pre_sql
' and 'workload_sql
' options. - Fixed: https://gitlab.com/postgres-ai/postgresql-consulting/tests-and-benchmarks/-/jobs/5839732812
- Escape newline characters in
- Support for DO blocks in SQL
- Added a workaround for CI pipelines where the '$$' symbol is not properly escaped
- Support for arrays in pre_sql and workload_sql
Edited by Vitaliy Kukharik