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

1s1t: Refactor sqlgenerator integration test #28890

Merged
merged 27 commits into from Aug 3, 2023

Conversation

edgao
Copy link
Contributor

@edgao edgao commented Jul 31, 2023

closes #27569; closes #27567

add a BaseSqlGeneratorIntegrationTest, and make BigQuerySqlGeneratorIntegrationTest extend it. Move most test cases into the base class. Similarly to the TypingDedupingTest, some of these test cases depend on an input records file (defined in the base test module) and an expected records file (defined in the destination module). A lot of these tests are only verifying record counts; we might want to beef them up eventually but I think they're sufficient for now.

Also switched the tests to use a composite PK.

A small subset of tests are still defined in the bigquery test implementation:

  • createTableIncremental - 99% of the code in this test is just querying for the table definition + asserting on it. IMO it would be more complicated to try and extract that logic into the base class. The base class just defines an abstract method, to remind us to implement this method for each destination.
  • testCreateTableInOtherRegion - this doesn't make sense in most destinations, so it's not included in the base class.

Also, swap the order of StreamId.finalTableId's parameters, so that the "suffix" param is the last argument 😛 so there's a small amount of runtime code being modified, but it's behaving identically to before.

All tests pass locally:
image

@github-actions
Copy link
Contributor

github-actions bot commented Jul 31, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@edgao edgao force-pushed the edgao/1s1t/sqlgeneratorintegrationtest branch 4 times, most recently from 8917066 to 703f42e Compare August 3, 2023 16:12
@edgao edgao force-pushed the edgao/1s1t/sqlgeneratorintegrationtest branch from c2066ae to 5227fa2 Compare August 3, 2023 17:06
@octavia-squidington-iii
Copy link
Collaborator

destination-mssql test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 6.83s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-mssql test

@octavia-squidington-iii
Copy link
Collaborator

destination-starburst-galaxy test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 8.84s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-starburst-galaxy test

@octavia-squidington-iii
Copy link
Collaborator

destination-tidb test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 6.91s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-tidb test

@octavia-squidington-iii
Copy link
Collaborator

destination-dynamodb test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 8.46s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-dynamodb test

@octavia-squidington-iii
Copy link
Collaborator

destination-mysql-strict-encrypt test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 7.60s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-mysql-strict-encrypt test

@octavia-squidington-iii
Copy link
Collaborator

destination-yugabytedb test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 7.46s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-yugabytedb test

@octavia-squidington-iii
Copy link
Collaborator

destination-mariadb-columnstore test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 8.11s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-mariadb-columnstore test

@octavia-squidington-iii
Copy link
Collaborator

destination-tidb test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 3.98s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-tidb test

@octavia-squidington-iii
Copy link
Collaborator

destination-mssql test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 3.78s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-mssql test

@octavia-squidington-iii
Copy link
Collaborator

destination-dynamodb test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 4.41s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-dynamodb test

@octavia-squidington-iii
Copy link
Collaborator

destination-clickhouse-strict-encrypt test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 3.71s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-clickhouse-strict-encrypt test

@edgao edgao marked this pull request as draft August 3, 2023 17:19
@octavia-squidington-iii
Copy link
Collaborator

destination-starburst-galaxy test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 5.61s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-starburst-galaxy test

@octavia-squidington-iii
Copy link
Collaborator

destination-clickhouse test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 4.20s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-clickhouse test

@octavia-squidington-iii
Copy link
Collaborator

destination-mssql-strict-encrypt test report (commit 5227fa2da4) - ❌

⏲️ Total pipeline duration: 3.96s

Step Result

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-mssql-strict-encrypt test

// This is not a typical stream ID would look like, but SqlGenerator isn't allowed to make any
// assumptions about StreamId structure.
// In practice, the final table would be testDataset.users, and the raw table would be
// airbyte_internal.testDataset_ab__ab_users.
Copy link
Contributor

Choose a reason for hiding this comment

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

raw table name update

// This is not a typical stream ID would look like, but SqlGenerator isn't allowed to make any
// assumptions about StreamId structure.
// In practice, the final table would be testDataset.users, and the raw table would be
// airbyte_internal.testDataset_ab__ab_users.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// airbyte_internal.testDataset_ab__ab_users.
// airbyte_internal.testDataset_raw__stream_users.

@edgao edgao marked this pull request as ready for review August 3, 2023 20:53
@octavia-squidington-iii
Copy link
Collaborator

destination-bigquery test report (commit 6bcff568e1) - ❌

⏲️ Total pipeline duration: 32mn57s

Step Result
Validate airbyte-integrations/connectors/destination-bigquery/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Build connector tar
Build destination-bigquery docker image for platform linux/x86_64
Build airbyte/normalization:dev
./gradlew :airbyte-integrations:connectors:destination-bigquery:integrationTest

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-bigquery test

@octavia-squidington-iii
Copy link
Collaborator

destination-bigquery test report (commit 832b5b7107) - ❌

⏲️ Total pipeline duration: 31mn50s

Step Result
Validate airbyte-integrations/connectors/destination-bigquery/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Build connector tar
Build destination-bigquery docker image for platform linux/x86_64
Build airbyte/normalization:dev
./gradlew :airbyte-integrations:connectors:destination-bigquery:integrationTest

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-bigquery test

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Aug 3, 2023
@edgao edgao enabled auto-merge (squash) August 3, 2023 22:51
@octavia-squidington-iii
Copy link
Collaborator

destination-bigquery test report (commit 1659090f3e) - ✅

⏲️ Total pipeline duration: 33mn41s

Step Result
Validate airbyte-integrations/connectors/destination-bigquery/metadata.yaml
Connector version semver check
Connector version increment check
QA checks
Build connector tar
Build destination-bigquery docker image for platform linux/x86_64
Build airbyte/normalization:dev
./gradlew :airbyte-integrations:connectors:destination-bigquery:integrationTest

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-bigquery test

@edgao edgao merged commit ac67bfd into master Aug 3, 2023
23 checks passed
@edgao edgao deleted the edgao/1s1t/sqlgeneratorintegrationtest branch August 3, 2023 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/destination/bigquery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Genericize SqlGeneratorIntegrationTest to be reusable for other destinations Multi-Column PK Tests
3 participants