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

Unit testing feature branch pull request #8411

Merged
merged 41 commits into from
Jan 16, 2024
Merged

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Aug 15, 2023

resolves #8283

This is a long-running feature branch pull request, used to merge main and verify that the current state is still working.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • 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
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

Co-authored-by: Michelle Ark <michelle.ark@dbtlabs.com>
@gshank gshank requested review from a team as code owners August 15, 2023 14:22
@cla-bot cla-bot bot added the cla:yes label Aug 15, 2023
@gshank gshank marked this pull request as draft August 15, 2023 14:22
@gshank gshank requested review from MichelleArk and graciegoheen and removed request for aranke and colin-rogers-dbt August 15, 2023 14:22
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Attention: 219 lines in your changes are missing coverage. Please review.

Comparison is base (15704ab) 86.76% compared to head (42b0b85) 86.95%.

Files Patch % Lines
core/dbt/adapters/events/adapter_types_pb2.py 2.16% 181 Missing ⚠️
core/dbt/deprecations.py 62.50% 6 Missing ⚠️
core/dbt/parser/unit_tests.py 97.09% 5 Missing ⚠️
core/dbt/contracts/graph/nodes.py 94.87% 4 Missing ⚠️
core/dbt/task/test.py 97.05% 3 Missing ⚠️
core/dbt/contracts/files.py 93.33% 2 Missing ⚠️
core/dbt/contracts/graph/manifest.py 90.00% 2 Missing ⚠️
core/dbt/exceptions.py 50.00% 2 Missing ⚠️
core/dbt/parser/common.py 80.00% 2 Missing ⚠️
core/dbt/parser/generic_test_builders.py 81.81% 2 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8411      +/-   ##
==========================================
+ Coverage   86.76%   86.95%   +0.19%     
==========================================
  Files         185      187       +2     
  Lines       24321    25020     +699     
==========================================
+ Hits        21101    21756     +655     
- Misses       3220     3264      +44     
Flag Coverage Δ
integration 84.34% <78.48%> (+0.19%) ⬆️
unit 63.29% <43.81%> (-0.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

core/dbt/task/unit_test.py Fixed Show fixed Hide fixed
core/dbt/task/unit_test.py Fixed Show fixed Hide fixed
aranke and others added 5 commits November 16, 2023 16:24
…fied in YAML config (#9064)

Co-authored-by: Michelle Ark <MichelleArk@users.noreply.github.com>
Fix #8652: Use seed value if rows not specified
* Switch to using 'test' command instead of 'unit-test'

* Remove old unit test

* Put daff changes into task/test.py

* changie

* test_type:unit

* Add unit test to build and make test

* Select test_type:data

* Add unit tets to test_graph_selector_methods.py

* Fix fqn to incude path components

* Update build test

* Remove part of message in test_csv_fixtures.py that's different on Windows

* Rename build test directory
class TestRunner(CompileRunner):
_ANSI_ESCAPE = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")

Check warning

Code scanning / CodeQL

Overly permissive regular expression range Medium

Suspicious character range that is equivalent to [@A-Z].
class TestRunner(CompileRunner):
_ANSI_ESCAPE = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")

Check warning

Code scanning / CodeQL

Overly permissive regular expression range Medium

Suspicious character range that is equivalent to \[0-9:;<=>?\].
gshank and others added 6 commits November 30, 2023 12:26
* convert test to data_test

* generate proto types

* fixing tests

* add tests

* add more tests

* test cleanup

* WIP

* fix graph

* fix testing manifest

* set resource type back to test and reset unique id

* reset expected run results

* cleanup

* changie

* modify to only look for tests under columns in schema files

* stop using dashes
@gshank gshank force-pushed the unit_testing_feature_branch branch 2 times, most recently from 5e98353 to 8fbbb65 Compare January 2, 2024 22:38
@gshank gshank force-pushed the unit_testing_feature_branch branch from 8fbbb65 to 56dfb34 Compare January 2, 2024 22:53
@gshank gshank marked this pull request as ready for review January 16, 2024 21:56
@gshank gshank requested a review from a team as a code owner January 16, 2024 21:56
@gshank gshank requested review from vadim82 and removed request for a team January 16, 2024 21:56
@gshank gshank merged commit b5a0c4c into main Jan 16, 2024
51 checks passed
@gshank gshank deleted the unit_testing_feature_branch branch January 16, 2024 22:37
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-2911] [Epic] Unit testing dbt models
5 participants