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

Convert docs_generate_tests to new framework #5058

Merged
merged 8 commits into from
Apr 20, 2022
Merged

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Apr 13, 2022

resolves #5035

Description

Convert the 029_docs_generate_tests to new pytest framework.

Pull request opened for initial review, but will also be splitting up these tests into adapter zone and non-adapter-zone 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 added information about my change to be included in the CHANGELOG.

@gshank gshank requested a review from a team as a code owner April 13, 2022 22:28
@cla-bot cla-bot bot added the cla:yes label Apr 13, 2022
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@ChenyuLInx ChenyuLInx added the Skip Changelog Skips GHA to check for changelog file label Apr 13, 2022
@gshank
Copy link
Contributor Author

gshank commented Apr 14, 2022

I am going to split this test into two parts, a 'docs_generate' part in the adapter zone, and an 'artifacts' tests in dbt-core standard tests.

@ChenyuLInx
Copy link
Contributor

I am going to split this test into two parts, a 'docs_generate' part in the adapter zone, and an 'artifacts' tests in dbt-core standard tests.

Is the docs generate part going to be mainly related to catalog generate?

@gshank
Copy link
Contributor Author

gshank commented Apr 14, 2022

Yes, I'll remove the manifest and run_results varification from the adapter zone test, and remove the catalog verification from the artifacts tests. In the artifacts tests I will try to switch to compile instead of 'docs generate".

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.

This looks great! Love that adapter one only have catalog related

@gshank gshank requested a review from ChenyuLInx April 20, 2022 15:09
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.

This looks good! Left two questions for question about thinking process, not blocker.

@@ -120,6 +120,11 @@ def dbt_profile_target():
}


@pytest.fixture(scope="class")
def profile_user(dbt_profile_target):
Copy link
Contributor

Choose a reason for hiding this comment

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

Which adapter need this change and why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need a way to get the "owner" in the catalog. It's different for different adapters. Some of them use the "user" in the profile, some use other things. So this is special fixture to help with that. We didn't have a standard way to get the profile's user before.

"""Any string. Use this in assert calls"""

def __eq__(self, other):
return isinstance(other, str)
Copy link
Contributor

Choose a reason for hiding this comment

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

The three classes here looks very similar, why we are doing it as 3 individual instead of having one that you can maybe pass in a specific type? Also, think we can achieve AnyString by not passing in contains for AnyStringWith?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're separate classes because they were copied from existing classes in the integration test suite. You do have a point that a single class that takes a type would work here.

@gshank gshank merged commit 7d0fccd into main Apr 20, 2022
@gshank gshank deleted the ct-478-docs_generate_tests branch April 20, 2022 15:30
agoblet pushed a commit to BigDataRepublic/dbt-core that referenced this pull request May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-478] Convert 029_docs_generate tests to new framework.
2 participants