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

Generate run_results.json even when no nodes are selected #3313

Closed
panasenco opened this issue May 3, 2021 · 1 comment · Fixed by #3315
Closed

Generate run_results.json even when no nodes are selected #3313

panasenco opened this issue May 3, 2021 · 1 comment · Fixed by #3315
Labels
artifacts enhancement New feature or request

Comments

@panasenco
Copy link
Contributor

Describe the feature

I'd like the file target/run_results.json to be generated with an empty results list even when the selector selected no nodes. The current behavior is to not generate a new run_results.json when the selector returned no nodes.

A test run with no nodes selected is a legitimate occurence when using the state:modified selector.

Describe alternatives you've considered

Parsing dbt test output for the string WARNING: Nothing to do. Try checking your model configs and model specification args. This is a bit hacky and unreliable though.

Additional context

Using dbt test with the state:modified selector in my CI pipeline. I parse run_results,json to get the test outcome, but that file doesn't get generated when there are no model differences between the branch and PROD. However, the absence of run_results.json could also mean the test process somehow failed...

Who will this benefit?

Anyone who depends on run_results.json - for example CI pipeline devs.

Are you interested in contributing this feature?

I'll browse the source code and give it a shot, but no promises.

@jtcohen6
Copy link
Contributor

jtcohen6 commented May 6, 2021

@panasenco I buy it! Thanks so much for opening the issue, and for laying out your rationale so clearly. It looks like this was a super simple change, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifacts enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants