Skip to content

[Rndstroppy-76]: tests introspection, probation#47

Merged
Cianidos merged 6 commits intomainfrom
RNDSTROPPY-76
Mar 2, 2026
Merged

[Rndstroppy-76]: tests introspection, probation#47
Cianidos merged 6 commits intomainfrom
RNDSTROPPY-76

Conversation

@Cianidos
Copy link
Contributor

@Cianidos Cianidos commented Feb 27, 2026

Description of Changes

stroppy probe path/to/test.ts [path/to/sql.sql] [--output (human | json)
Human readable format emits copy paste ready introspection about test.

Help message show how to read 'human' readable format.
./build/stroppy probe --help

Command allows you to get information about a test script without running it.
Probing performs a first-line check of the test for workability, exposing common
issues. It also provides introspection into the test configuration and
structure.

Description of -o human readable format sections provided below.

'# Stroppy Config' section shows the configuration passed to the stroppy module
via the 'DriverX.fromConfig(...)' function call. The configuration is presented
in protojson format. The config schema is defined in
'proto/stroppy/config.proto'.

'# K6 Options' follows the structure from 'k6/lib/options.go' and
'@types/k6/options/index.d.ts'. It shows the options object defined in the
script as
"import { Options } from 'k6/options';
export const options: Options = {...};"

'# SQL File Structure' section represents the SQL file required by the probed
test. Without these defined sections and queries, the test will fail.
Sections start with '--+ <SectionName>'.
Queries within sections are named '--= <QueryName>'.
You can copy-paste this text directly into an SQL file and write your queries to
match the test.

'# Steps' is logical separation of the test into steps. They are defined in the
test as 'Step("step name", ()=> {/*step code*/})' or using 'StepBegin("step
name"); StepEnd("step name");' pair.

'# Environment Variables' shows which env vars are used specifically within this
test. Only envs used as '__ENV.<env_name>' are shown here (no k6 options or
stroppy envs). Current environment values are also shown if found.

Usage:
  stroppy probe [flags]

Flags:
  -h, --help            help for probe
  -l, --local           prevent tmp dir creation (use local dependencies in test working directory)
  -o, --output string   (human, json) (default "human")

Global Flags:
  -a, --address string              address for the REST API server (default "localhost:6565")
  -c, --config string               JSON config file (default "/home/arenadev/.config/k6/config.json")
      --log-format string           log output format
      --log-output string           change the output for k6 logs, possible values are: 'stderr', 'stdout', 'none', 'loki[=host:port]', 'file[=./path.fileformat]' (default "stderr")
      --no-color                    disable colored output
      --profiling-enabled           enable profiling (pprof) endpoints, k6's REST API should be enabled as well
  -q, --quiet                       disable progress updates
      --secret-source stringArray   setting secret sources for k6 file[=./path.fileformat],
  -v, --verbose                     enable verbose logging

Example of tpcc probe:

stroppy probe workloads/tpcc/tpcc.ts

Use 'probe --help' to get details about sections

# Stroppy Config:
{
  "driver": {
    "url": "postgres://postgres:postgres@localhost:5432",
    "dbSpecific": {},
    "driverType": "DRIVER_TYPE_POSTGRES",
    "connectionType": {
      "sharedPool": {
        "sharedConnections": 100
      }
    }
  }
}

# K6 Options:
{
  "scenarios": {
    "delivery": {
      "executor": "constant-vus",
      "exec": "delivery",
      "vus": 4,
      "duration": "1h0m0s"
    },
    "new_order": {
      "executor": "constant-vus",
      "exec": "new_order",
      "vus": 44,
      "duration": "1h0m0s"
    },
    "order_status": {
      "executor": "constant-vus",
      "exec": "order_status",
      "vus": 4,
      "duration": "1h0m0s"
    },
    "payments": {
      "executor": "constant-vus",
      "exec": "payments",
      "vus": 43,
      "duration": "1h0m0s"
    },
    "stock_level": {
      "executor": "constant-vus",
      "exec": "stock_level",
      "vus": 4,
      "duration": "1h0m0s"
    }
  },
  "setupTimeout": "5m0s",
  "dns": {
  },
}

# SQL File Structure:
  --+ drop_schema
  --+ create_schema
  --+ workload
  --= delivery
  --= new_order
  --= order_status
  --= payment
  --= stock_level

# Steps
  "create_schema"
  "load_data"
  "workload"

# Environment Variables:
  DURATION=""
  SCALE_FACTOR=""
  WAREHOUSES=""
  DRIVER_URL=""
  SQL_FILE=""

Json, machine readable format.
stroppy probe workloads/tpcc/tpcc.ts -o json

{"global_config":{"driver":{"url":"postgres://postgres:postgres@localhost:5432","dbSpecific":{},"driverType":"DRIVER_TYPE_POSTGRES","connectionType":{"sharedPool":{"sharedConnections":100}}}},"options":{"paused":null,"vus":null,"duration":null,"iterations":null,"stages":null,"scenarios":{"delivery":{"executor":"constant-vus","startTime":null,"gracefulStop":null,"env":null,"exec":"delivery","tags":null,"vus":4,"duration":"1h0m0s"},"new_order":{"executor":"constant-vus","startTime":null,"gracefulStop":null,"env":null,"exec":"new_order","tags":null,"vus":44,"duration":"1h0m0s"},"order_status":{"executor":"constant-vus","startTime":null,"gracefulStop":null,"env":null,"exec":"order_status","tags":null,"vus":4,"duration":"1h0m0s"},"payments":{"executor":"constant-vus","startTime":null,"gracefulStop":null,"env":null,"exec":"payments","tags":null,"vus":43,"duration":"1h0m0s"},"stock_level":{"executor":"constant-vus","startTime":null,"gracefulStop":null,"env":null,"exec":"stock_level","tags":null,"vus":4,"duration":"1h0m0s"}},"executionSegment":null,"executionSegmentSequence":null,"noSetup":null,"setupTimeout":"5m0s","noTeardown":null,"teardownTimeout":null,"rps":null,"dns":{"ttl":null,"select":null,"policy":null},"maxRedirects":null,"userAgent":null,"batch":null,"batchPerHost":null,"httpDebug":null,"insecureSkipTLSVerify":null,"tlsCipherSuites":null,"tlsVersion":null,"tlsAuth":null,"throw":null,"thresholds":null,"blacklistIPs":null,"blockHostnames":null,"hosts":null,"noConnectionReuse":null,"noVUConnectionReuse":null,"minIterationDuration":null,"ext":null,"summaryTrendStats":null,"summaryTimeUnit":null,"systemTags":null,"tags":null,"metricSamplesBufferSize":null,"noCookiesReset":null,"discardResponseBodies":null},"sql_sections":[{"name":"drop_schema","queries":null},{"name":"create_schema","queries":null},{"name":"workload","queries":[{"name":"delivery","text":""},{"name":"new_order","text":""},{"name":"order_status","text":""},{"name":"payment","text":""},{"name":"stock_level","text":""}]}],"envs":["DURATION","SCALE_FACTOR","WAREHOUSES","DRIVER_URL","SQL_FILE"],"steps":["create_schema","load_data","workload"]}

Pretty-printed version.
stroppy probe workloads/tpcc/tpcc.ts -o json | jq

{
  "global_config": {
    "driver": {
      "url": "postgres://postgres:postgres@localhost:5432",
      "dbSpecific": {},
      "driverType": "DRIVER_TYPE_POSTGRES",
      "connectionType": {
        "sharedPool": {
          "sharedConnections": 100
        }
      }
    }
  },
  "options": {
    "paused": null,
    "vus": null,
    "duration": null,
    "iterations": null,
    "stages": null,
    "scenarios": {
      "delivery": {
        "executor": "constant-vus",
        "startTime": null,
        "gracefulStop": null,
        "env": null,
        "exec": "delivery",
        "tags": null,
        "vus": 4,
        "duration": "1h0m0s"
      },
      "new_order": {
        "executor": "constant-vus",
        "startTime": null,
        "gracefulStop": null,
        "env": null,
        "exec": "new_order",
        "tags": null,
        "vus": 44,
        "duration": "1h0m0s"
      },
      "order_status": {
        "executor": "constant-vus",
        "startTime": null,
        "gracefulStop": null,
        "env": null,
        "exec": "order_status",
        "tags": null,
        "vus": 4,
        "duration": "1h0m0s"
      },
      "payments": {
        "executor": "constant-vus",
        "startTime": null,
        "gracefulStop": null,
        "env": null,
        "exec": "payments",
        "tags": null,
        "vus": 43,
        "duration": "1h0m0s"
      },
      "stock_level": {
        "executor": "constant-vus",
        "startTime": null,
        "gracefulStop": null,
        "env": null,
        "exec": "stock_level",
        "tags": null,
        "vus": 4,
        "duration": "1h0m0s"
      }
    },
    "executionSegment": null,
    "executionSegmentSequence": null,
    "noSetup": null,
    "setupTimeout": "5m0s",
    "noTeardown": null,
    "teardownTimeout": null,
    "rps": null,
    "dns": {
      "ttl": null,
      "select": null,
      "policy": null
    },
    "maxRedirects": null,
    "userAgent": null,
    "batch": null,
    "batchPerHost": null,
    "httpDebug": null,
    "insecureSkipTLSVerify": null,
    "tlsCipherSuites": null,
    "tlsVersion": null,
    "tlsAuth": null,
    "throw": null,
    "thresholds": null,
    "blacklistIPs": null,
    "blockHostnames": null,
    "hosts": null,
    "noConnectionReuse": null,
    "noVUConnectionReuse": null,
    "minIterationDuration": null,
    "ext": null,
    "summaryTrendStats": null,
    "summaryTimeUnit": null,
    "systemTags": null,
    "tags": null,
    "metricSamplesBufferSize": null,
    "noCookiesReset": null,
    "discardResponseBodies": null
  },
  "sql_sections": [
    {
      "name": "drop_schema",
      "queries": null
    },
    {
      "name": "create_schema",
      "queries": null
    },
    {
      "name": "workload",
      "queries": [
        {
          "name": "delivery",
          "text": ""
        },
        {
          "name": "new_order",
          "text": ""
        },
        {
          "name": "order_status",
          "text": ""
        },
        {
          "name": "payment",
          "text": ""
        },
        {
          "name": "stock_level",
          "text": ""
        }
      ]
    }
  ],
  "envs": [
    "DURATION",
    "SCALE_FACTOR",
    "WAREHOUSES",
    "DRIVER_URL",
    "SQL_FILE"
  ],
  "steps": [
    "create_schema",
    "load_data",
    "workload"
  ]
}

Motivation and Context

Why is this change required?

How Has This Been Tested?

Describe tests or steps to verify.

Type of Changes

  • Bug fix
  • New feature
  • Documentation improvement
  • Refactoring
  • Other

Checklist

  • I have read the CONTRIBUTING.md
  • I have checked build and tests
  • I have updated documentation if needed

Now it's a separate complex step with lots of mock logic.
Probe absorbs useful to users metainfo, "probeprint", with config.

Closes RNDSTROPPY-76
human readable and json info about tests

Closes RNDSTROPPY-76
Closes RNDSTROPPY-76
@yaroher yaroher added the enhancement New feature or request label Mar 2, 2026
Closes RNDSTROPPY-76
@Cianidos Cianidos merged commit 4d47ada into main Mar 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants