From c9f45a0b85735f58102fcd78385f6f673e731aa6 Mon Sep 17 00:00:00 2001 From: Catherine Noll Date: Tue, 30 Jul 2024 12:48:19 -0400 Subject: [PATCH] airbyte-ci: add connectionOptions to metadata.yaml, for use by live tests (#42860) --- .../generated/ConnectorMetadataDefinitionV0.py | 15 ++++++++++++++- .../generated/ConnectorTestSuiteOptions.py | 15 ++++++++++++++- .../models/generated/TestConnections.py | 14 ++++++++++++++ .../models/generated/__init__.py | 1 + .../models/src/ConnectorTestSuiteOptions.yaml | 6 ++++++ .../models/src/TestConnections.yaml | 17 +++++++++++++++++ .../metadata_service/lib/pyproject.toml | 2 +- 7 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/TestConnections.py create mode 100644 airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/TestConnections.yaml diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py index 6fac6b5f5342..8a6c55009bf3 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorMetadataDefinitionV0.py @@ -26,6 +26,14 @@ class Config: type: Optional[Literal["GSM"]] = Field(None, description="The type of the secret store") +class TestConnections(BaseModel): + class Config: + extra = Extra.forbid + + name: str = Field(..., description="The connection name") + id: str = Field(..., description="The connection ID") + + class ReleaseStage(BaseModel): __root__: Literal["alpha", "beta", "generally_available", "custom"] = Field( ..., description="enum that describes a connector's release stage", title="ReleaseStage" @@ -183,8 +191,13 @@ class ConnectorTestSuiteOptions(BaseModel): class Config: extra = Extra.forbid - suite: Literal["unitTests", "integrationTests", "acceptanceTests"] = Field(..., description="Name of the configured test suite") + suite: Literal["unitTests", "integrationTests", "acceptanceTests", "liveTests"] = Field( + ..., description="Name of the configured test suite" + ) testSecrets: Optional[List[Secret]] = Field(None, description="List of secrets required to run the test suite") + testConnections: Optional[List[TestConnections]] = Field( + None, description="List of sandbox cloud connections that tests can be run against" + ) class ActorDefinitionResourceRequirements(BaseModel): diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py index 6f15be16543e..d11f42738e95 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/ConnectorTestSuiteOptions.py @@ -17,6 +17,14 @@ class Config: type: Optional[Literal["GSM"]] = Field(None, description="The type of the secret store") +class TestConnections(BaseModel): + class Config: + extra = Extra.forbid + + name: str = Field(..., description="The connection name") + id: str = Field(..., description="The connection ID") + + class Secret(BaseModel): class Config: extra = Extra.forbid @@ -30,5 +38,10 @@ class ConnectorTestSuiteOptions(BaseModel): class Config: extra = Extra.forbid - suite: Literal["unitTests", "integrationTests", "acceptanceTests"] = Field(..., description="Name of the configured test suite") + suite: Literal["unitTests", "integrationTests", "acceptanceTests", "liveTests"] = Field( + ..., description="Name of the configured test suite" + ) testSecrets: Optional[List[Secret]] = Field(None, description="List of secrets required to run the test suite") + testConnections: Optional[List[TestConnections]] = Field( + None, description="List of sandbox cloud connections that tests can be run against" + ) diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/TestConnections.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/TestConnections.py new file mode 100644 index 000000000000..47f65d3462b0 --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/TestConnections.py @@ -0,0 +1,14 @@ +# generated by datamodel-codegen: +# filename: TestConnections.yaml + +from __future__ import annotations + +from pydantic import BaseModel, Extra, Field + + +class TestConnections(BaseModel): + class Config: + extra = Extra.forbid + + name: str = Field(..., description="The connection name") + id: str = Field(..., description="The connection ID") diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py index 21030aad906a..32dd7f76e6ee 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/__init__.py @@ -24,3 +24,4 @@ from .SourceFileInfo import * from .SuggestedStreams import * from .SupportLevel import * +from .TestConnections import * diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml index e7b81ceca8d2..2830332ee520 100644 --- a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/ConnectorTestSuiteOptions.yaml @@ -15,8 +15,14 @@ properties: - "unitTests" - "integrationTests" - "acceptanceTests" + - "liveTests" testSecrets: description: "List of secrets required to run the test suite" type: array items: "$ref": "Secret.yaml" + testConnections: + description: "List of sandbox cloud connections that tests can be run against" + type: array + items: + "$ref": "TestConnections.yaml" diff --git a/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/TestConnections.yaml b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/TestConnections.yaml new file mode 100644 index 000000000000..0ca92550ae9f --- /dev/null +++ b/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/TestConnections.yaml @@ -0,0 +1,17 @@ +--- +"$schema": http://json-schema.org/draft-07/schema# +"$id": https://github.com/airbytehq/airbyte/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/TestConnections.yaml +title: TestConnections +description: List of sandbox cloud connections that tests can be run against +type: object +required: + - name + - id +additionalProperties: false +properties: + name: + type: string + description: "The connection name" + id: + type: string + description: "The connection ID" diff --git a/airbyte-ci/connectors/metadata_service/lib/pyproject.toml b/airbyte-ci/connectors/metadata_service/lib/pyproject.toml index a0ee05cf6e26..97d6a863725e 100644 --- a/airbyte-ci/connectors/metadata_service/lib/pyproject.toml +++ b/airbyte-ci/connectors/metadata_service/lib/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "metadata-service" -version = "0.8.0" +version = "0.9.0" description = "" authors = ["Ben Church "] readme = "README.md"