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

Fix #9608: Unit test path outputs #9793

Merged
merged 8 commits into from
Mar 27, 2024
Merged

Fix #9608: Unit test path outputs #9793

merged 8 commits into from
Mar 27, 2024

Conversation

aranke
Copy link
Member

@aranke aranke commented Mar 22, 2024

resolves #9608

Problem

  1. Unit test failure should include the actual compiled path of the unit test query
  2. Unit test fixtures should not overwrite the compiled path for the input models

Solution

This PR makes the following changes:

  1. Move input SQL fixture to target/compiled/my_model.yml/model_a.sql to prevent overwriting model at target/compiled/model_a.sql.
  2. Create a RunResult out of UnitTestNode instead of UnitTestDefinition since the latter doesn't have path information.
  3. Modify test TestUnitTestDuplicateTestNamesAcrossModels to check for unique_ids instead of model names in results

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

@cla-bot cla-bot bot added the cla:yes label Mar 22, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.04%. Comparing base (e46eae1) to head (f2e0b0d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9793      +/-   ##
==========================================
- Coverage   88.07%   88.04%   -0.04%     
==========================================
  Files         178      178              
  Lines       22461    22457       -4     
==========================================
- Hits        19783    19772      -11     
- Misses       2678     2685       +7     
Flag Coverage Δ
integration 85.42% <100.00%> (-0.11%) ⬇️
unit 61.72% <25.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aranke aranke changed the title Fix #9608: Unit test fixture compilation Fix #9608: Unit test path outputs Mar 22, 2024
@aranke aranke marked this pull request as ready for review March 26, 2024 01:46
@aranke aranke requested a review from a team as a code owner March 26, 2024 01:46
Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup in the unit test parser. Looks good.

@aranke aranke merged commit f683e36 into main Mar 27, 2024
62 checks passed
@aranke aranke deleted the fix_9608 branch March 27, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants