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

Improve DAT: Random namespace to avoid namespace collision. #29652

Merged
merged 3 commits into from
Aug 22, 2023

Conversation

davinchia
Copy link
Contributor

@davinchia davinchia commented Aug 20, 2023

What

Minimise test flakiness by randomising the namespace in the TestNamespace test case.

How

By writing to the same namespace, multiple tests running at the same time for a single destination can cause overwrites and incorrectly failed tests.

Recommended reading order

The one class.

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user?

For connector PRs, use this section to explain which type of semantic versioning bump occurs as a result of the changes. Refer to our Semantic Versioning for Connectors guidelines for more information. Breaking changes to connectors must be documented by an Airbyte engineer (PR author, or reviewer for community PRs) by using the Breaking Change Release Playbook.

If there are breaking changes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Actions

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Connector version is set to 0.0.1
    • Dockerfile has version 0.0.1
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog with an entry for the initial version. See changelog example
    • docs/integrations/README.md

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

@davinchia davinchia marked this pull request as ready for review August 20, 2023 23:25
@davinchia davinchia requested a review from a team as a code owner August 20, 2023 23:25
@davinchia
Copy link
Contributor Author

/legacy-test connector=destination-snowflake

@davinchia
Copy link
Contributor Author

davinchia commented Aug 21, 2023

looks like the slash command isn't working so I manually kicked off a run which passed: https://github.com/airbytehq/airbyte/actions/runs/5920524608

@@ -1805,7 +1805,8 @@ public Stream<? extends Arguments> provideArguments(final ExtensionContext conte
.filter(testCase -> testCase.get("enabled").asBoolean())
.map(testCase -> Arguments.of(
testCase.get("id").asText(),
testCase.get("namespace").asText(),
// Randomise namespace to avoid collisions between tests.
Strings.addRandomSuffix(testCase.get("namespace").asText(), "", 5),
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this leave any randomly names schemas or tables in the database at the end of the test? I don't think so...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question - I actually think we already do so today.. it doesn't look like the Redshift Acceptance Test cleans up after itself for this particular case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like Snowflake and Redshift are set up to erase entries in the TEST_SCHEMA.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@davinchia
Copy link
Contributor Author

I'm kicking off one more test before merging in: https://github.com/airbytehq/airbyte/actions/runs/5932710869

@davinchia
Copy link
Contributor Author

Test passed! Merging!

@davinchia davinchia merged commit ec3fb40 into master Aug 22, 2023
21 checks passed
@davinchia davinchia deleted the davinchia/better-dat branch August 22, 2023 05:07
edgao added a commit that referenced this pull request Aug 22, 2023
edgao added a commit that referenced this pull request Aug 22, 2023
harrytou pushed a commit to KYVENetwork/airbyte that referenced this pull request Sep 1, 2023
…q#29652)

By writing to the same namespace, multiple tests running at the same time for a single destination can cause overwrites and incorrectly failed tests.

Minimise test flakiness by randomising the namespace in the TestNamespace test case.

Co-authored-by: davinchia <davinchia@users.noreply.github.com>
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.

3 participants