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

Fast follows for Unit Testing #4975

Merged
merged 26 commits into from
Feb 27, 2024
Merged

Fast follows for Unit Testing #4975

merged 26 commits into from
Feb 27, 2024

Conversation

matthewshaver
Copy link
Contributor

@matthewshaver matthewshaver commented Feb 22, 2024

What are you changing in this pull request and why?

Fast follows for unit tests:

  • Breaks the reference page into sections in a folder.
  • Adds resource links to the /docs page on unit tests.
  • The Methods page is updated to reflect unit tests.
  • Links to information about the --empty flag.
  • Various other edits and clean ups.

Checklist

@matthewshaver matthewshaver requested a review from a team as a code owner February 22, 2024 16:50
@matthewshaver matthewshaver requested review from graciegoheen and removed request for a team February 22, 2024 16:51
Copy link

vercel bot commented Feb 22, 2024

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

Name Status Preview Comments Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2024 7:12pm

@github-actions github-actions bot added content Improvements or additions to content size: medium This change will take up to a week to address Docs team Authored by the Docs team @dbt Labs labels Feb 22, 2024
@matthewshaver matthewshaver changed the title Adding data types to unit testing Adding data formats to unit testing Feb 22, 2024
@graciegoheen
Copy link
Collaborator

graciegoheen commented Feb 22, 2024

This feels very similar to / duplicative of this section that we already have on the reference page. Can we combine or separate into its own page and link to it instead?

@matthewshaver
Copy link
Contributor Author

@graciegoheen What would be your preference? The fast follow note I have is to add data formats to this page but I can do it as a separate page. A few questions

A sentence with a link is much easier to miss than an entire section of the document (maybe important because this is a new feature in beta). Is that going to hinder the beta for users?
There are only 2 formats supported right now, so it wouldn't be a meaty page at the moment. Is the intent to have this page linked to in other portions of the docs outside of unit testing?

I can create it as a snippet as well, make it reusable without creating a new page for it. Let me know your thoughts.

@graciegoheen
Copy link
Collaborator

graciegoheen commented Feb 22, 2024

We already have this link:

Screenshot 2024-02-22 at 1 43 31 PM

but we could specifically tag that to the existing format section.

The reference doc section for unit testing only has a single section:

Screenshot 2024-02-22 at 1 44 31 PM

Whereas the section for data tests has many:

Screenshot 2024-02-22 at 1 45 10 PM

If we have a separate page for something as simple as limit for data testing, I don't see why we wouldn't follow a similar pattern for unit tests?

I mainly just want to avoid maintaining duplicative versions of this documentation - since we already have this "format" section on the reference page:
Screenshot 2024-02-22 at 1 46 34 PM

so a snippet could totally work as well!

@runleonarun do you have thoughts here?

@runleonarun
Copy link
Collaborator

@graciegoheen and @matthewshaver
I think it would be useful to have formats be its own page under "For unit tests" because both About unit tests property and Unit tests pages are already quite long.

If we did that, we could make this tweak to the Before you Begin in the About Unit Testing page to look something like this:

Before you Begin

  • We currently only support unit testing SQL models.
  • We currently only support adding unit tests to models in your current project.
  • If your model has multiple versions, by default the unit test will run on all versions of your model. Read unit testing versioned models for more information.
  • We support dict and csv formats in unit testing. Read more about formatting unit tests in Formats.

This does make me wonder if we should do the same for versions and input? Otherwise it might be awkward. The input section could have more fleshed out examples like in other sections.

@graciegoheen
Copy link
Collaborator

I would be in favor of doing the same for versions, inputs, and overrides! Thanks @runleonarun

@matthewshaver matthewshaver changed the title Adding data formats to unit testing Enhancing unit testing docs Feb 26, 2024
@matthewshaver matthewshaver changed the title Break unit testing ref page into sub pages Fast follows for Unit Testing Feb 26, 2024
Copy link
Collaborator

@runleonarun runleonarun left a comment

Choose a reason for hiding this comment

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

Just a few suggestions. I know it's close to the release but I feel like we can clarify these things in unit testing to help beta users.

@@ -52,165 +52,8 @@ unit_tests:

Copy link
Collaborator

@runleonarun runleonarun Feb 27, 2024

Choose a reason for hiding this comment

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

@matthewshaver we chatted about adding a heading to the file above. Something like
## File structure

@graciegoheen would this make sense for all files that lay out the configs or properties and their options like we do above?

matthewshaver and others added 3 commits February 26, 2024 20:39
Co-authored-by: Leona B. Campbell <3880403+runleonarun@users.noreply.github.com>
Adding info to the ref page
Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
Copy link
Collaborator

@runleonarun runleonarun 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! We can follow up with any other requests

@matthewshaver matthewshaver merged commit 80ec1e3 into current Feb 27, 2024
7 checks passed
@matthewshaver matthewshaver deleted the unit-testing-ff branch February 27, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content Docs team Authored by the Docs team @dbt Labs February-2024 size: large This change will more than a week to address and might require more than one person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs for unit testing, data types Fast follows for Unit Testing
3 participants