Add check-only mode and "pre_shell" option
-
test_with_artifacts.sh
: Perform checks and exit the script if theCHECK_ONLY=true
variable is specified. -
gitlab-ci.yml
: Check the JSON input data before deploying the server/creating a clone.
This allows us to detect invalid JSON at an earlier stage. Thus, there will be no attempt to deploy a new server (dedicated-env) or create a clone (shared-env) if the JSON is not valid.
Example (valid JSON):
CHECK_ONLY=true ./test_with_artifacts.sh '{
"wal_compression OFF": {
"pre_configs": [
"wal_compression=off",
"work_mem=100MB"
],
"workload_pgbench": "pgbench -U postgres -c4 -j4 -nr -P10 -T60 postgres"
},
"wal_compression ON": {
"pre_configs": [
"wal_compression=on",
"work_mem=100MB"
],
"workload_pgbench": "pgbench -U postgres -c4 -j4 -nr -P10 -T60 postgres"
}
}'
JSON input is valid.
Example (Invalid JSON):
CHECK_ONLY=true ./test_with_artifacts.sh '{
"wal_compression OFF": {
"pre_configs": [
"wal_compression=off",
"work_mem=100MB"
],
"workload_pgbench": "pgbench -U postgres -c4 -j4 -nr -P10 -T60 postgres"
},
"wal_compression ON": {
"pre_configs": [
"wal_compression=on",
"work_mem=100MB"
],
"statement": "pgbench -U postgres -c4 -j4 -nr -P10 -T60 postgres"
}
}'
ERROR: Unsupported operation type: "statement". Supported types are: "pre_configs", "pre_sql", "workload_pgbench", "workload_sql".
CHECK_ONLY=true ./test_with_artifacts.sh '{
"wal_compression OFF": {
"pre_configs": [
"wal_compression=off",
"work_mem=100MB"
],
"workload_pgbench": "pgbench -U postgres -c4 -j4 -nr -P10 -T60 postgres"
},
"wal_compression ON": {
"pre_configs": [
"wal_compression=on",
"work_mem=100MB"
]
"workload_pgbench": "pgbench -U postgres -c4 -j4 -nr -P10 -T60 postgres"
}
}'
parse error: Expected separator between values at line 14, column 22
ERROR: Invalid JSON input.
CHECK_ONLY=true ./test_with_artifacts.sh
ERROR: No input provided.
- failed (shared-env) job: https://gitlab.com/postgres-ai/postgresql-consulting/tests-and-benchmarks/-/jobs/5737248814#L29
- successful (shared-env) job: https://gitlab.com/postgres-ai/postgresql-consulting/tests-and-benchmarks/-/jobs/5737265906#L29
- failed (dedicated-env) job: https://gitlab.com/postgres-ai/postgresql-consulting/tests-and-benchmarks/-/jobs/5737315255#L31
- successful (dedicated-env) job: https://gitlab.com/postgres-ai/postgresql-consulting/tests-and-benchmarks/-/jobs/5737349293#L31
Additionally
- Added "pre_shell" option
- allows you to execute any shell commands to prepare the test, for example, to generate a csv file.
Edited by Vitaliy Kukharik