Skip to content

Add tests for introspection - #9

Draft
sfc-gh-yutliu wants to merge 1 commit into
mainfrom
yutliu-add-test-introspection
Draft

Add tests for introspection#9
sfc-gh-yutliu wants to merge 1 commit into
mainfrom
yutliu-add-test-introspection

Conversation

@sfc-gh-yutliu

@sfc-gh-yutliu sfc-gh-yutliu commented Oct 23, 2025

Copy link
Copy Markdown
Collaborator

Add tests for introspection under information_schema.semantic_views.

  select 
    *
  from {{ target.database }}.information_schema.SEMANTIC_VIEWS
  where name ilike '%semantic_view_basic%'

Tests passed with dbt build --target snowflake.

(.venv) ➜  integration_tests git:(main) ✗ dbt build --target snowflake                               
16:53:42  Running with dbt=1.10.11
16:53:42  Registered adapter: snowflake=1.10.2
16:53:43  Found 9 models, 9 data tests, 1 seed, 2 operations, 2 sources, 487 macros
16:53:43  
16:53:43  Concurrency: 4 threads (target='snowflake')
16:53:43  
16:53:56  1 of 2 START hook: dbt_semantic_view_integration_tests.on-run-start.0 .......... [RUN]
16:53:56  1 of 2 OK hook: dbt_semantic_view_integration_tests.on-run-start.0 ............. [OK in 1.25s]
16:53:56  2 of 2 START hook: dbt_semantic_view_integration_tests.on-run-start.1 .......... [RUN]
16:53:56  2 of 2 OK hook: dbt_semantic_view_integration_tests.on-run-start.1 ............. [OK in 0.37s]
16:53:56  
16:53:56  1 of 19 START sql table model yutliu.table_refer_to_raw_semantic_view .......... [RUN]
16:53:56  2 of 19 START seed file yutliu_raw_data.my_seed ................................ [RUN]
16:53:56  3 of 19 START test semantic_view_introspection_succeeds ........................ [RUN]
16:53:58  1 of 19 OK created sql table model yutliu.table_refer_to_raw_semantic_view ..... [SUCCESS 1 in 1.98s]
16:53:58  4 of 19 START test table_refer_raw_semantic_view_matches_semantic_view ......... [RUN]
16:53:59  2 of 19 OK loaded seed file yutliu_raw_data.my_seed ............................ [INSERT 3 in 2.29s]
16:53:59  5 of 19 START test base_table .................................................. [RUN]
16:53:59  5 of 19 PASS base_table ........................................................ [PASS in 0.64s]
16:53:59  6 of 19 START sql table model yutliu.base_table ................................ [RUN]
16:54:01  6 of 19 OK created sql table model yutliu.base_table ........................... [SUCCESS 1 in 1.74s]
16:54:01  7 of 19 START sql semantic_view model yutliu.semantic_view_basic ............... [RUN]
16:54:01  8 of 19 START sql semantic_view model yutliu.semantic_view_with_ca_extension ... [RUN]
16:54:01  7 of 19 OK created sql semantic_view model yutliu.semantic_view_basic .......... [SUCCESS 1 in 0.35s]
16:54:01  9 of 19 START sql semantic_view model yutliu.semantic_view_with_calc_name_copy_grants  [RUN]
16:54:02  8 of 19 OK created sql semantic_view model yutliu.semantic_view_with_ca_extension  [SUCCESS 1 in 0.59s]
16:54:02  10 of 19 START sql semantic_view model yutliu.semantic_view_with_config_copy_grants  [RUN]
16:54:02  9 of 19 OK created sql semantic_view model yutliu.semantic_view_with_calc_name_copy_grants  [SUCCESS 1 in 0.30s]
16:54:02  11 of 19 START sql semantic_view model yutliu.semantic_view_with_copy_grants ... [RUN]
16:54:02  10 of 19 OK created sql semantic_view model yutliu.semantic_view_with_config_copy_grants  [SUCCESS 1 in 0.32s]
16:54:02  12 of 19 START sql semantic_view model yutliu.semantic_view_with_ddl_copy_grants_and_config_copy_grants  [RUN]
16:54:02  11 of 19 OK created sql semantic_view model yutliu.semantic_view_with_copy_grants  [SUCCESS 1 in 0.29s]
16:54:02  13 of 19 START test semantic_view_basic_has_comment ............................ [RUN]
16:54:02  12 of 19 OK created sql semantic_view model yutliu.semantic_view_with_ddl_copy_grants_and_config_copy_grants  [SUCCESS 1 in 0.22s]
16:54:02  14 of 19 START test semantic_view_basic_has_no_copy_grants ..................... [RUN]
16:54:02  13 of 19 PASS semantic_view_basic_has_comment .................................. [PASS in 0.34s]
16:54:02  15 of 19 START test semantic_view_sum_matches_base_table ....................... [RUN]
16:54:03  14 of 19 PASS semantic_view_basic_has_no_copy_grants ........................... [PASS in 0.69s]
16:54:03  16 of 19 START test semantic_view_with_ca_extension_has_extension .............. [RUN]
16:54:03  16 of 19 PASS semantic_view_with_ca_extension_has_extension .................... [PASS in 0.52s]
16:54:03  17 of 19 START test semantic_view_with_copy_has_copy_grants .................... [RUN]
16:54:04  17 of 19 PASS semantic_view_with_copy_has_copy_grants .......................... [PASS in 0.40s]
16:54:20  4 of 19 PASS table_refer_raw_semantic_view_matches_semantic_view ............... [PASS in 21.43s]
16:54:20  15 of 19 PASS semantic_view_sum_matches_base_table ............................. [PASS in 17.81s]
16:54:20  18 of 19 START sql table model yutliu.table_refer_to_semantic_view ............. [RUN]
16:54:22  18 of 19 OK created sql table model yutliu.table_refer_to_semantic_view ........ [SUCCESS 1 in 2.28s]
16:54:22  19 of 19 START test table_refer_semantic_view_matches_semantic_view ............ [RUN]
16:54:25  19 of 19 PASS table_refer_semantic_view_matches_semantic_view .................. [PASS in 2.95s]
16:56:11  3 of 19 PASS semantic_view_introspection_succeeds .............................. [PASS in 134.14s]
16:56:11  
16:56:11  Finished running 2 project hooks, 1 seed, 6 semantic view models, 3 table models, 9 data tests in 0 hours 2 minutes and 28.65 seconds (148.65s).
16:56:11  
16:56:11  Completed successfully
16:56:11  
16:56:11  Done. PASS=21 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant