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 · 4 comments
Open
1 task

[Feature] Add functionality to only run tests #1279

luis-fnogueira opened this issue Oct 23, 2024 · 4 comments
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,
)

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Nov 29, 2024
@luis-fnogueira
Copy link
Author

DbtTestLocalOperator

Hi! I'd have to test it because I haven't found this documentation at https://astronomer.github.io/astronomer-cosmos/. Thanks a lot for the suggestion!

@luis-fnogueira luis-fnogueira closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
Copy link

dosubot bot commented Dec 2, 2024

Thank you for closing the issue, luis-fnogueira! We appreciate your contribution to the Cosmos project.

@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 2, 2024
@tatiana tatiana reopened this Dec 27, 2024
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