{
  "description": "Test is the Schema for the tests API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "TestSpec defines the desired state of Test",
      "properties": {
        "content": {
          "additionalProperties": false,
          "description": "test content object",
          "properties": {
            "data": {
              "description": "test content body",
              "type": [
                "string",
                "null"
              ]
            },
            "repository": {
              "additionalProperties": false,
              "description": "repository of test content",
              "properties": {
                "authType": {
                  "description": "auth type for git requests",
                  "enum": [
                    "basic",
                    "header"
                  ],
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "branch": {
                  "description": "branch/tag name for checkout",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "certificateSecret": {
                  "description": "git auth certificate secret for private repositories",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "commit": {
                  "description": "commit id (sha) for checkout",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "path": {
                  "description": "if needed we can checkout particular path (dir or file) in case of BIG/mono repositories",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tokenSecret": {
                  "additionalProperties": false,
                  "description": "SecretRef is the Testkube internal reference for secret storage in Kubernetes secrets",
                  "properties": {
                    "key": {
                      "description": "object key",
                      "type": "string"
                    },
                    "name": {
                      "description": "object name",
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "name"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": {
                  "description": "VCS repository type",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "uri": {
                  "description": "uri of content file or git directory",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "usernameSecret": {
                  "additionalProperties": false,
                  "description": "SecretRef is the Testkube internal reference for secret storage in Kubernetes secrets",
                  "properties": {
                    "key": {
                      "description": "object key",
                      "type": "string"
                    },
                    "name": {
                      "description": "object name",
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "name"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "workingDir": {
                  "description": "if provided we checkout the whole repository and run test from this directory",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "type": {
              "description": "test type",
              "enum": [
                "string",
                "file-uri",
                "git-file",
                "git-dir",
                "git"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            "uri": {
              "description": "uri of test content",
              "type": [
                "string",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "description": {
          "description": "test description",
          "type": [
            "string",
            "null"
          ]
        },
        "executionRequest": {
          "additionalProperties": false,
          "description": "test execution request body",
          "properties": {
            "activeDeadlineSeconds": {
              "description": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.",
              "format": "int64",
              "type": [
                "integer",
                "null"
              ]
            },
            "args": {
              "description": "additional executor binary arguments",
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "argsMode": {
              "description": "usage mode for arguments",
              "enum": [
                "append",
                "override",
                "replace"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            "artifactRequest": {
              "additionalProperties": false,
              "description": "artifact request body with test artifacts",
              "properties": {
                "dirs": {
                  "description": "artifact directories for scraping",
                  "items": {
                    "type": "string"
                  },
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "masks": {
                  "description": "regexp to filter scraped artifacts, single or comma separated",
                  "items": {
                    "type": "string"
                  },
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "omitFolderPerExecution": {
                  "description": "don't use a separate folder for execution artifacts",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "sharedBetweenPods": {
                  "description": "whether to share volume between pods",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "sidecarScraper": {
                  "description": "run scraper as pod sidecar container",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "storageBucket": {
                  "description": "artifact bucket storage",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "storageClassName": {
                  "description": "artifact storage class name for container executor",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "useDefaultStorageClassName": {
                  "description": "whether to use default storage class name",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "volumeMountPath": {
                  "description": "artifact volume mount path for container executor",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "command": {
              "description": "executor binary command",
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "cronJobTemplate": {
              "description": "cron job template extensions",
              "type": [
                "string",
                "null"
              ]
            },
            "cronJobTemplateReference": {
              "description": "name of the template resource",
              "type": [
                "string",
                "null"
              ]
            },
            "disableWebhooks": {
              "description": "whether webhooks should be called on execution\nDeprecated: field is not used",
              "type": [
                "boolean",
                "null"
              ]
            },
            "envConfigMaps": {
              "description": "config map references",
              "items": {
                "additionalProperties": false,
                "description": "Reference to env resource",
                "properties": {
                  "mapToVariables": {
                    "description": "whether we shoud map to variables from resource",
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "mount": {
                    "description": "whether we shoud mount resource",
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "mountPath": {
                    "description": "where we shoud mount resource",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "reference": {
                    "additionalProperties": false,
                    "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.",
                    "properties": {
                      "name": {
                        "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "reference"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "envSecrets": {
              "description": "secret references",
              "items": {
                "additionalProperties": false,
                "description": "Reference to env resource",
                "properties": {
                  "mapToVariables": {
                    "description": "whether we shoud map to variables from resource",
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "mount": {
                    "description": "whether we shoud mount resource",
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "mountPath": {
                    "description": "where we shoud mount resource",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "reference": {
                    "additionalProperties": false,
                    "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.",
                    "properties": {
                      "name": {
                        "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "reference"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "envs": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "Environment variables passed to executor. Deprecated: use Basic Variables instead",
              "type": [
                "object",
                "null"
              ]
            },
            "executePostRunScriptBeforeScraping": {
              "description": "execute post run script before scraping (prebuilt executor only)",
              "type": [
                "boolean",
                "null"
              ]
            },
            "executionLabels": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "test execution labels",
              "type": [
                "object",
                "null"
              ]
            },
            "executionNamespace": {
              "description": "namespace for test execution (Pro edition only)",
              "type": [
                "string",
                "null"
              ]
            },
            "httpProxy": {
              "description": "http proxy for executor containers",
              "type": [
                "string",
                "null"
              ]
            },
            "httpsProxy": {
              "description": "https proxy for executor containers",
              "type": [
                "string",
                "null"
              ]
            },
            "image": {
              "description": "container executor image",
              "type": [
                "string",
                "null"
              ]
            },
            "imagePullSecrets": {
              "description": "container executor image pull secrets",
              "items": {
                "additionalProperties": false,
                "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.",
                "properties": {
                  "name": {
                    "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "isVariablesFileUploaded": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "jobTemplate": {
              "description": "job template extensions",
              "type": [
                "string",
                "null"
              ]
            },
            "jobTemplateReference": {
              "description": "name of the template resource",
              "type": [
                "string",
                "null"
              ]
            },
            "name": {
              "description": "test execution custom name",
              "type": [
                "string",
                "null"
              ]
            },
            "namespace": {
              "description": "test kubernetes namespace (\\\"testkube\\\" when not set)",
              "type": [
                "string",
                "null"
              ]
            },
            "negativeTest": {
              "description": "negative test will fail the execution if it is a success and it will succeed if it is a failure",
              "type": [
                "boolean",
                "null"
              ]
            },
            "number": {
              "description": "test execution number",
              "format": "int32",
              "type": [
                "integer",
                "null"
              ]
            },
            "postRunScript": {
              "description": "script to run after test execution",
              "type": [
                "string",
                "null"
              ]
            },
            "preRunScript": {
              "description": "script to run before test execution",
              "type": [
                "string",
                "null"
              ]
            },
            "pvcTemplate": {
              "description": "pvc template extensions",
              "type": [
                "string",
                "null"
              ]
            },
            "pvcTemplateReference": {
              "description": "name of the template resource",
              "type": [
                "string",
                "null"
              ]
            },
            "scraperTemplate": {
              "description": "scraper template extensions",
              "type": [
                "string",
                "null"
              ]
            },
            "scraperTemplateReference": {
              "description": "name of the template resource",
              "type": [
                "string",
                "null"
              ]
            },
            "secretEnvs": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "Execution variables passed to executor from secrets. Deprecated: use Secret Variables instead",
              "type": [
                "object",
                "null"
              ]
            },
            "slavePodRequest": {
              "additionalProperties": false,
              "description": "pod request body",
              "properties": {
                "podTemplate": {
                  "description": "pod template extensions",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "podTemplateReference": {
                  "description": "name of the template resource",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "resources": {
                  "additionalProperties": false,
                  "description": "pod resources request specification",
                  "properties": {
                    "limits": {
                      "additionalProperties": false,
                      "description": "resource request specification",
                      "properties": {
                        "cpu": {
                          "description": "requested cpu units",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "memory": {
                          "description": "requested memory units",
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "requests": {
                      "additionalProperties": false,
                      "description": "resource request specification",
                      "properties": {
                        "cpu": {
                          "description": "requested cpu units",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "memory": {
                          "description": "requested memory units",
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "sourceScripts": {
              "description": "run scripts using source command (container executor only)",
              "type": [
                "boolean",
                "null"
              ]
            },
            "sync": {
              "description": "whether to start execution sync or async",
              "type": [
                "boolean",
                "null"
              ]
            },
            "testSecretUUID": {
              "description": "test secret uuid",
              "type": [
                "string",
                "null"
              ]
            },
            "testSuiteName": {
              "description": "unique test suite name (CRD Test suite name), if it's run as a part of test suite",
              "type": [
                "string",
                "null"
              ]
            },
            "testSuiteSecretUUID": {
              "description": "test suite secret uuid, if it's run as a part of test suite",
              "type": [
                "string",
                "null"
              ]
            },
            "variables": {
              "additionalProperties": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "description": "variable name",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "type": {
                    "description": "variable type",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "value": {
                    "description": "variable string value",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "valueFrom": {
                    "additionalProperties": false,
                    "description": "or load it from var source",
                    "properties": {
                      "configMapKeyRef": {
                        "additionalProperties": false,
                        "description": "Selects a key of a ConfigMap.",
                        "properties": {
                          "key": {
                            "description": "The key to select.",
                            "type": "string"
                          },
                          "name": {
                            "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "optional": {
                            "description": "Specify whether the ConfigMap or its key must be defined",
                            "type": [
                              "boolean",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "key"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "fieldRef": {
                        "additionalProperties": false,
                        "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.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",
                              "null"
                            ]
                          },
                          "fieldPath": {
                            "description": "Path of the field to select in the specified API version.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "fieldPath"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "resourceFieldRef": {
                        "additionalProperties": false,
                        "description": "Selects a resource of the container: only resources limits and requests (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",
                              "null"
                            ]
                          },
                          "divisor": {
                            "description": "Specifies the output format of the exposed resources, defaults to \"1\"",
                            "oneOf": [
                              {
                                "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "x-kubernetes-int-or-string": true
                          },
                          "resource": {
                            "description": "Required: resource to select",
                            "type": "string"
                          }
                        },
                        "required": [
                          "resource"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "secretKeyRef": {
                        "additionalProperties": false,
                        "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": {
                            "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "optional": {
                            "description": "Specify whether the Secret or its key must be defined",
                            "type": [
                              "boolean",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "key"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      }
                    },
                    "type": [
                      "object",
                      "null"
                    ]
                  }
                },
                "type": "object"
              },
              "type": [
                "object",
                "null"
              ]
            },
            "variablesFile": {
              "description": "variables file content - need to be in format for particular executor (e.g. postman envs file)",
              "type": [
                "string",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "name": {
          "description": "test name",
          "type": [
            "string",
            "null"
          ]
        },
        "schedule": {
          "description": "schedule in cron job format for scheduled test execution",
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "description": "reference to test source resource",
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "description": "test type",
          "type": [
            "string",
            "null"
          ]
        },
        "uploads": {
          "description": "files to be used from minio uploads",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "status": {
      "additionalProperties": false,
      "description": "TestStatus defines the observed state of Test",
      "properties": {
        "latestExecution": {
          "additionalProperties": false,
          "description": "latest execution result",
          "properties": {
            "endTime": {
              "description": "test end time",
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "id": {
              "description": "execution id",
              "type": [
                "string",
                "null"
              ]
            },
            "number": {
              "description": "execution number",
              "format": "int32",
              "type": [
                "integer",
                "null"
              ]
            },
            "startTime": {
              "description": "test start time",
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "status": {
              "enum": [
                "queued",
                "running",
                "passed",
                "failed",
                "aborted",
                "timeout"
              ],
              "type": [
                "string",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}