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

[Feature] Represent Generic Test .yml within test-paths in manifest.json #10818

Open
2 tasks done
epapineau opened this issue Oct 3, 2024 · 1 comment
Open
2 tasks done
Labels
awaiting_response dbt tests Issues related to built-in dbt testing functionality enhancement New feature or request paper_cut A small change that impacts lots of users in their day-to-day

Comments

@epapineau
Copy link
Contributor

epapineau commented Oct 3, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

I define a custom generic test in tests/generic/missing_timestamps.sql directory:

{% test missing_timestamps(model, column_name) %}
...
{% endtest %}

I document the test in tests/generic/properties.yml with:

macros: 
  - name: test_missing_timestamps
    description: Fail when timestamps are missing

I expect this documentation to work based on comments here and documentation requests here.

However, when I look at the manifest.json entry for the test_missing_timestamps macro the patch_path field is empty:

{'name': 'test_missing_timestamps',
 'resource_type': 'macro',
 'package_name': 'data_warehouse',
 'path': 'tests/generic/missing_timestamps.sql',
 'original_file_path': 'tests/generic/missing_timestamps.sql',
 'unique_id': 'macro.data_warehouse.test_missing_timestamps',
 'macro_sql': <omitted>,
 'depends_on': {'macros': []},
 'description': '',
 'meta': {},
 'docs': {'show': True, 'node_color': None},
 'patch_path': None,
 'arguments': [],
 'created_at': 1727980919.6159098,
 'supported_languages': None}

When I look at the manifest.json for the applied generic test , the patch_path is also empty.

Expected Behavior

I expect the information defined in the properties.yml to be populated for the macro as it is with non-generic-test macros.

Steps To Reproduce

  1. Create a custom generic test and an associated properties.yml to document it
  2. Apply the custom generic test to a model
  3. dbt parse
  4. Inspect dbt manifest macros for macro.project_name.test_name and manifest nodes for test.project_name.test_name_confgs

Relevant log output

No response

Environment

- OS: macOS 14.6.1
- Python: 3.11.1
- dbt: 1.8.6

Which database adapter are you using with dbt?

bigquery

Additional Context

No response

@epapineau epapineau added bug Something isn't working triage labels Oct 3, 2024
@dbeatty10 dbeatty10 added the dbt tests Issues related to built-in dbt testing functionality label Oct 4, 2024
@dbeatty10
Copy link
Contributor

Thanks for reaching out about this @epapineau !

Does it work for you if you move the content of your properties.yml file into the macros folder?

It generated the desired documentation for me via dbt docs generate and dbt docs serve when I put it in the macros directory, but not when I put it in the tests/generic directory. I've updated dbt-labs/docs.getdbt.com#5631 accordingly.

In the meantime, I'm going to convert this to a feature request to enable this for the tests/generic directory.

@dbeatty10 dbeatty10 added enhancement New feature or request and removed bug Something isn't working labels Oct 6, 2024
@dbeatty10 dbeatty10 changed the title [Bug] Generic Test .yml not represented in manifest.json [Feature] Represent Generic Test .yml within test-paths in manifest.json Oct 6, 2024
@graciegoheen graciegoheen added the paper_cut A small change that impacts lots of users in their day-to-day label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting_response dbt tests Issues related to built-in dbt testing functionality enhancement New feature or request paper_cut A small change that impacts lots of users in their day-to-day
Projects
None yet
Development

No branches or pull requests

3 participants