You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
I am trying to implement dbt unit tests without using any of the external package being installed. But the native dbt unit tests does not work and while executing it using the command dbt test --select test_name , it just not picking up the test and executing it. It says, the selection criterion does not match any node.
Expected Behavior
The test should be get picked up and executed successfully against the model using the dbt test command
Run: dbt test --select current_student_view_data
Outcome:
root@**********:/usr/app/dbt# dbt test --select current_ajo_view_data
06:54:23 Running with dbt=1.7.3
06:54:24 Registered adapter: snowflake=1.7.1
06:54:34 Found 67 models, 1 snapshot, 5 tests, 87 sources, 0 exposures, 0 metrics, 1017 macros, 0 groups, 0 semantic models
06:54:34 The selection criterion 'current_student_view_data' does not match any nodes
06:54:34
06:54:34 Nothing to do. Try checking your model configs and model specification args
Relevant log output
root@**********:/usr/app/dbt# dbt test --select current_ajo_view_data
06:54:23 Running with dbt=1.7.3
06:54:24 Registered adapter: snowflake=1.7.1
06:54:34 Found 67 models, 1 snapshot, 5 tests, 87 sources, 0 exposures, 0 metrics, 1017 macros, 0 groups, 0 semantic models
06:54:34 The selection criterion 'current_student_view_data' does not match any nodes
06:54:34
06:54:34 Nothing to do. Try checking your model configs and model specification args
--select without specifying what you're selecting, implies "model". You don't have a "current_student_view_data" model. Try using the model name "curr_raw_student_view", or use a selector that specifies the unit test in some way.
@sangee14 Could you move your YAML file containing your unit test(s) from the tests directory into the models directory and try your command again?
More detail
When you execute dbt list, you should get a row like this:
unit_test:my_project.current_student_view_data
But if you don't see that when you run dbt list, it means that dbt isn't picking up your YAML file that has your unit tests. I think that is what is happening here.
After moving it to the models directory, then I think you will get output like this:
$ dbt list
00:11:42 Running with dbt=1.8.8
my_project.curr_raw_student_view
unit_test:my_project.current_student_view_data
$ dbt test --select current_student_view_data
00:12:14 Running with dbt=1.8.8
00:12:14 Found 1 model, 410 macros, 1 unit test
00:12:14
00:12:14 1 of 1 START unit_test curr_raw_student_view::current_student_view_data ........ [RUN]
00:12:14 1 of 1 PASS curr_raw_student_view::current_student_view_data ................... [PASS in 0.16s]
00:12:15
00:12:15 Finished running 1 unit test in 0 hours 0 minutes and 0.33 seconds (0.33s).
00:12:15
00:12:15 Completed successfully
00:12:15
00:12:15 Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1
Follow-up feature request
I've opened this feature request to allow unit tests to be defined in the tests directory in addition to the models directory: #11093
Is this a new bug in dbt-core?
Current Behavior
I am trying to implement dbt unit tests without using any of the external package being installed. But the native dbt unit tests does not work and while executing it using the command
dbt test --select test_name
, it just not picking up the test and executing it. It says, the selection criterion does not match any node.Expected Behavior
The test should be get picked up and executed successfully against the model using the
dbt test
commandSteps To Reproduce
Run:
dbt test --select current_student_view_data
Outcome:
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: