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

Implement initial adapter tests on bigquery #142

Merged
merged 3 commits into from
Mar 29, 2022

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Mar 16, 2022

resolves #135

Description

Initial implementation of tests ported from dbt-adapter-tests

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-bigquery next" section.

@cla-bot cla-bot bot added the cla:yes label Mar 16, 2022
from dbt.tests.adapter.basic.test_snapshot_timestamp import BaseSnapshotTimestamp

"""
Trying to create view `dbt-dev-168022`.`test16473926894805161392_test_basic`.`swappable`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jtcohen6 What is your take on how to avoid this error?

Copy link
Contributor

@jtcohen6 jtcohen6 Mar 17, 2022

Choose a reason for hiding this comment

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

@gshank This is a "good" error! And it doesn't look like we have any existing integration tests to confirm that this "good" error is raised in this case, so I'd also call this a "good" test case :)

I think we could take either/both of these approaches:

  • xfail the standard test with this error message — it looks
  • inherit + reimplement the standard test, adding in --full-refresh, so that it can succeed

Maybe both, if that's straightforward enough to do?

@gshank gshank force-pushed the ct-362-new_test_framework_bigquery branch from 85dd272 to 092b965 Compare March 21, 2022 20:16
@gshank gshank force-pushed the ct-362-new_test_framework_bigquery branch from 092b965 to 07b704e Compare March 21, 2022 20:18
@gshank gshank requested a review from ChenyuLInx March 21, 2022 21:19
Copy link
Contributor

@ChenyuLInx ChenyuLInx left a comment

Choose a reason for hiding this comment

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

LGTM



class TestSimpleMaterializationsBigQuery(BaseSimpleMaterializations):
# This test requires a full-refresh to replace a table with a view
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we consider add this kind of logic to the dbt-core tests later on so that we don't need to do it anywhere in bigquery?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test_config sets a flag which does initiate different behavior in the dbt-core tests. I think we don't want to always do a full refresh in the adapter tests, because then we wouldn't ever be testing behavior without the full refresh, which ought to work for the other adapters.

@gshank gshank merged commit edebc47 into main Mar 29, 2022
@gshank gshank deleted the ct-362-new_test_framework_bigquery branch March 29, 2022 19:35
siephen pushed a commit to AgencyPMG/dbt-bigquery that referenced this pull request May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-362] Initial use of new adapter testing framework
3 participants