{
  "description": "TestSuite is the Schema for the testsuites API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "TestSuiteSpec defines the desired state of TestSuite",
      "properties": {
        "after": {
          "description": "After steps is list of tests which will be sequentially orchestrated",
          "items": {
            "description": "TestSuiteStepSpec for particular type will have config for possible step types",
            "properties": {
              "delay": {
                "description": "TestSuiteStepDelay contains step delay parameters",
                "properties": {
                  "duration": {
                    "description": "Duration in ms",
                    "format": "int32",
                    "type": "integer"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "execute": {
                "description": "TestSuiteStepExecute defines step to be executed",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "namespace": {
                    "type": "string"
                  },
                  "stopOnFailure": {
                    "type": "boolean"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": {
                "description": "TestSuiteStepType defines different type of test suite steps",
                "enum": [
                  "execute",
                  "delay"
                ],
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "before": {
          "description": "Before steps is list of tests which will be sequentially orchestrated",
          "items": {
            "description": "TestSuiteStepSpec for particular type will have config for possible step types",
            "properties": {
              "delay": {
                "description": "TestSuiteStepDelay contains step delay parameters",
                "properties": {
                  "duration": {
                    "description": "Duration in ms",
                    "format": "int32",
                    "type": "integer"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "execute": {
                "description": "TestSuiteStepExecute defines step to be executed",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "namespace": {
                    "type": "string"
                  },
                  "stopOnFailure": {
                    "type": "boolean"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": {
                "description": "TestSuiteStepType defines different type of test suite steps",
                "enum": [
                  "execute",
                  "delay"
                ],
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "description": {
          "type": "string"
        },
        "executionRequest": {
          "description": "TestSuiteExecutionRequest defines the execution request body",
          "properties": {
            "cronJobTemplate": {
              "description": "cron job template extensions",
              "type": "string"
            },
            "executionLabels": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "execution labels",
              "type": "object"
            },
            "httpProxy": {
              "description": "http proxy for executor containers",
              "type": "string"
            },
            "httpsProxy": {
              "description": "https proxy for executor containers",
              "type": "string"
            },
            "labels": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "test suite labels",
              "type": "object"
            },
            "name": {
              "description": "test execution custom name",
              "type": "string"
            },
            "namespace": {
              "description": "test kubernetes namespace (\\\"testkube\\\" when not set)",
              "type": "string"
            },
            "secretUUID": {
              "description": "secret uuid",
              "type": "string"
            },
            "sync": {
              "description": "whether to start execution sync or async",
              "type": "boolean"
            },
            "timeout": {
              "description": "timeout for test suite execution",
              "format": "int32",
              "type": "integer"
            },
            "variables": {
              "additionalProperties": {
                "properties": {
                  "name": {
                    "description": "variable name",
                    "type": "string"
                  },
                  "type": {
                    "description": "variable type",
                    "type": "string"
                  },
                  "value": {
                    "description": "variable string value",
                    "type": "string"
                  },
                  "valueFrom": {
                    "description": "or load it from var source",
                    "properties": {
                      "configMapKeyRef": {
                        "description": "Selects a key of a ConfigMap.",
                        "properties": {
                          "key": {
                            "description": "The key to select.",
                            "type": "string"
                          },
                          "name": {
                            "default": "",
                            "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
                            "type": "string"
                          },
                          "optional": {
                            "description": "Specify whether the ConfigMap or its key must be defined",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "key"
                        ],
                        "type": "object",
                        "x-kubernetes-map-type": "atomic",
                        "additionalProperties": false
                      },
                      "fieldRef": {
                        "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,\nspec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.",
                        "properties": {
                          "apiVersion": {
                            "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".",
                            "type": "string"
                          },
                          "fieldPath": {
                            "description": "Path of the field to select in the specified API version.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "fieldPath"
                        ],
                        "type": "object",
                        "x-kubernetes-map-type": "atomic",
                        "additionalProperties": false
                      },
                      "resourceFieldRef": {
                        "description": "Selects a resource of the container: only resources limits and requests\n(limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.",
                        "properties": {
                          "containerName": {
                            "description": "Container name: required for volumes, optional for env vars",
                            "type": "string"
                          },
                          "divisor": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "string"
                              }
                            ],
                            "description": "Specifies the output format of the exposed resources, defaults to \"1\"",
                            "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                            "x-kubernetes-int-or-string": true
                          },
                          "resource": {
                            "description": "Required: resource to select",
                            "type": "string"
                          }
                        },
                        "required": [
                          "resource"
                        ],
                        "type": "object",
                        "x-kubernetes-map-type": "atomic",
                        "additionalProperties": false
                      },
                      "secretKeyRef": {
                        "description": "Selects a key of a secret in the pod's namespace",
                        "properties": {
                          "key": {
                            "description": "The key of the secret to select from.  Must be a valid secret key.",
                            "type": "string"
                          },
                          "name": {
                            "default": "",
                            "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
                            "type": "string"
                          },
                          "optional": {
                            "description": "Specify whether the Secret or its key must be defined",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "key"
                        ],
                        "type": "object",
                        "x-kubernetes-map-type": "atomic",
                        "additionalProperties": false
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "object"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "repeats": {
          "type": "integer"
        },
        "schedule": {
          "description": "schedule in cron job format for scheduled test execution",
          "type": "string"
        },
        "steps": {
          "description": "Steps is list of tests which will be sequentially orchestrated",
          "items": {
            "description": "TestSuiteStepSpec for particular type will have config for possible step types",
            "properties": {
              "delay": {
                "description": "TestSuiteStepDelay contains step delay parameters",
                "properties": {
                  "duration": {
                    "description": "Duration in ms",
                    "format": "int32",
                    "type": "integer"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "execute": {
                "description": "TestSuiteStepExecute defines step to be executed",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "namespace": {
                    "type": "string"
                  },
                  "stopOnFailure": {
                    "type": "boolean"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": {
                "description": "TestSuiteStepType defines different type of test suite steps",
                "enum": [
                  "execute",
                  "delay"
                ],
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "TestSuiteStatus defines the observed state of TestSuite",
      "properties": {
        "latestExecution": {
          "description": "latest execution result",
          "properties": {
            "endTime": {
              "description": "test suite execution end time",
              "format": "date-time",
              "type": "string"
            },
            "id": {
              "description": "execution id",
              "type": "string"
            },
            "startTime": {
              "description": "test suite execution start time",
              "format": "date-time",
              "type": "string"
            },
            "status": {
              "enum": [
                "queued",
                "running",
                "passed",
                "failed",
                "aborting",
                "aborted",
                "timeout"
              ],
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
