Skip to content

Add check-only mode and "pre_shell" option

Vitaliy Kukharik requested to merge check-only into master
  • test_with_artifacts.sh: Perform checks and exit the script if the CHECK_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.

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

Merge request reports