jefflester / minitrino

A tool that makes it easy to run modular Trino environments locally.
Apache License 2.0
32 stars 3 forks source link

Build module testing framework #25

Closed jefflester closed 10 months ago

jefflester commented 3 years ago

Module Tests

Each module's metadata.json file will be extended to include a tests node. An example of this may look like the following:

{
  "tests": [
    {
      "type": "query",
      "data": "SELECT 1;",
      "successCriteria": {
        "rowCount": 27,
        "contains": [
          "foo"
        ]
      }
    },
    {
      "type": "shell",
      "container": "trino",
      "data": "cat /etc/starburst/config.properties",
      "successCriteria": {
        "exitCode": 0,
        "contains": [
          "starburst.data-product.enabled=true"
        ]
      }
    },
    {
      "type": "shell",
      "data": "curl -X GET -H 'Accept: application/json' -H 'X-Trino-User: admin' 'localhost:8080/api/v1/dataProduct/products/2'",
      "successCriteria": {
        "exitCode": 0,
        "contains": [
          "Not Found",
          "\"status\":\"404\""
        ]
      }
    },
    {
      "type": "logs",
      "container": "minio",
      "successCriteria": {
        "contains": [
          "bucket created"
        ]
      }
    }
  ]
}

JSON Nodes

jefflester commented 10 months ago

Closed with #69