dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.68k stars 1.61k forks source link

Fix mock in unit test after removing deprecated snowplow method #10738

Closed mikealfare closed 1 week ago

mikealfare commented 1 week ago

Problem

We removed a deprecated method, snowplow_tracker.Tracker.track_struct_event(), and replaced it with the suggested method snowplow_tracker.Tracker.track(). The former was mocked in a unit test and it was expected to be called. After the update, it did not get called as this method no longer existed.

Solution

Update the mock to reference the new method.

Checklist

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.96%. Comparing base (3e437a6) to head (a9e947d). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #10738 +/- ## ========================================== + Coverage 86.12% 88.96% +2.83% ========================================== Files 181 181 Lines 22964 22964 ========================================== + Hits 19777 20429 +652 + Misses 3187 2535 -652 ``` | [Flag](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10738/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `86.13% <ø> (+0.01%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `62.40% <ø> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10738/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | Coverage Δ | | |---|---|---| | [Unit Tests](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10738/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `62.40% <ø> (∅)` | | | [Integration Tests](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10738/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `86.13% <ø> (+0.01%)` | :arrow_up: |