Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata-service: add connectorTestSuitesOptions #38116

Merged

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented May 10, 2024

What

Closes https://github.com/airbytehq/airbyte-internal-issues/issues/7548

We want to introduce new metadata fields for connectors to:

  • Configure which test suite will run in CI
  • Explicitely map test credentials in secret store to a connector test suite

How

  • Introduce a new top level connectorTestSuitesOptions to configure test suite runs.

How will this be used?

This will help in conditionally running specific test suites according to the content of the connector metadata file.

Examples

  • A source Python connector on which we want to run unitTests, integrationTests (without secrets) and acceptanceTests (with secrets):
# in metadata.yaml
connectorTestSuitesOptions:
  - suite: unitTests
  - suite: integrationTests
  - suite: acceptanceTests
    testSecrets:
      - name: SECRET_FOR_MY_AWESOME_SOURCE # The actual secret name in the secret store
        fileName: config.yaml # name of the file airbyte-ci will create after pulling the secret from the secret store
        secretStore:
          type: GSM
          alias: airbyte-internal-secret-store # This is to hide the actual address of the secret store, a mapping between alias and address will be stored as a secret value in GHA
  • A source java connector on which we want to run unit, integration and acceptance tests without secrets:
connectorTestSuitesOptions:
  - suite: unitTests
  - suite: integrationTests
  - suite: acceptanceTests

User Impact

None as these new fields are not used ATM.

Follow up work

Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview May 13, 2024 2:41pm

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @alafanechere and the rest of your teammates on Graphite Graphite

@alafanechere alafanechere force-pushed the augustin/05-10-metadata-service_add_connectorTestOptions branch 2 times, most recently from 8931678 to d8368f6 Compare May 13, 2024 14:13
@alafanechere alafanechere changed the title metadata-service: add connectorTestOptions metadata-service: add connectorTestSuitesOptions May 13, 2024
@alafanechere alafanechere force-pushed the augustin/05-10-metadata-service_add_connectorTestOptions branch from d8368f6 to 80c7f57 Compare May 13, 2024 14:40
@alafanechere alafanechere force-pushed the augustin/05-10-metadata-service_add_connectorTestOptions branch from 80c7f57 to 61d345b Compare May 13, 2024 14:41
@alafanechere alafanechere marked this pull request as ready for review May 13, 2024 14:41
@alafanechere alafanechere requested review from a team, bnchrch and clnoll May 13, 2024 14:41
Copy link
Contributor

@bnchrch bnchrch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thought on string enum vs model enum I'd love your thoughts on

type: string
enum:
- "unitTests"
- "integrationTests"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Given that

  1. We will likely have different configuration options for each test
  2. We may have different configuration values for the same option between tests
  3. We want these test suites to be discoverable

What do you think of a format that

  1. encourages connector devs to use connectorTestSuitesOptions.suite. integrationTests.enabled = false to disable a test suite
  2. provides settings globally and per suite?

example:

connectorTestSuitesOptions:
  suite:
    unitTests:
      enabled: true
    integrationTests:
      enabled: false
    acceptanceTests:
      enabled: true
      override:
        secrets:
          fileName: config_this.yaml
  settings:
    secrets:
      - name: SECRET_FOR_MY_AWESOME_SOURCE
        fileName: config.yaml
        secretStore:
          type: GSM
          alias: airbyte-internal-secret-store

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnchrch I think I like the enabled field. But I think I prefer keeping per test suites secrets as it explicitly declares test suite secrets requirements.
If we'd go with your suggestion airbyte-ci would have to eagerly mount the secrets declared in settings to each test suites even if they're not required. I'd prefer to keep things as explicit as possible and have a way to assess which test suite needs which secret... Does it sound reasonable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds very reasonable! Approved!

Copy link
Contributor

@bnchrch bnchrch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added via Giphy

type: string
enum:
- "unitTests"
- "integrationTests"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds very reasonable! Approved!

@alafanechere alafanechere merged commit 1f1744f into master May 13, 2024
36 checks passed
@alafanechere alafanechere deleted the augustin/05-10-metadata-service_add_connectorTestOptions branch May 13, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants