Skip to content

Commit

Permalink
airbyte-ci: add connectionOptions to metadata.yaml, for use by live t…
Browse files Browse the repository at this point in the history
…ests (#42860)
  • Loading branch information
clnoll authored Jul 30, 2024
1 parent be5e974 commit c9f45a0
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
)
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
from .SourceFileInfo import *
from .SuggestedStreams import *
from .SupportLevel import *
from .TestConnections import *
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/metadata_service/lib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "metadata-service"
version = "0.8.0"
version = "0.9.0"
description = ""
authors = ["Ben Church <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit c9f45a0

Please sign in to comment.