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] Add functionality to only run tests #1279

Open
1 task
luis-fnogueira opened this issue Oct 23, 2024 · 1 comment
Open
1 task

[Feature] Add functionality to only run tests #1279

luis-fnogueira opened this issue Oct 23, 2024 · 1 comment
Labels
area:rendering Related to rendering, like Jinja, Airflow tasks, etc dbt:test Primarily related to dbt test command or functionality enhancement New feature or request triage-needed Items need to be reviewed / assigned to milestone

Comments

@luis-fnogueira
Copy link

Description

Hi y'all!

I'd like to periodically run only the dbt tests of my project using cosmos, using an approach similar to:


        render_config=RenderConfig(                               
            test_behavior=TestBehavior.ONLY_TESTS

Would that be possible for future releases? Or is already there a workaround to do that? I could not figure it out at the documentation.

Use case/motivation

I'd like to periodically have an alert on Slack about how my dbt tests are. Like a summary.

Related issues

No response

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!
@luis-fnogueira luis-fnogueira added enhancement New feature or request triage-needed Items need to be reviewed / assigned to milestone labels Oct 23, 2024
@dosubot dosubot bot added area:rendering Related to rendering, like Jinja, Airflow tasks, etc dbt:test Primarily related to dbt test command or functionality labels Oct 23, 2024
@tatiana
Copy link
Collaborator

tatiana commented Oct 29, 2024

@luis-fnogueira This feels like a duplicate of #1242 and potentially related to #959.

Would it be an option to use the DbtTestLocalOperator (

class DbtTestLocalOperator(DbtTestMixin, DbtLocalBaseOperator):
) or an equivalent directly to run tests only? Would this solve your use-case?

As illustrated in:

test_operator = DbtTestLocalOperator(
profile_config=real_profile_config,
project_dir=DBT_PROJ_DIR,
task_id="test",
dbt_cmd_flags=["--models", "stg_customers"],
install_deps=True,
append_env=True,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rendering Related to rendering, like Jinja, Airflow tasks, etc dbt:test Primarily related to dbt test command or functionality enhancement New feature or request triage-needed Items need to be reviewed / assigned to milestone
Projects
None yet
Development

No branches or pull requests

2 participants