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

Add EventMonitor Test Class, Migrate Example Test #10481

Closed
wants to merge 1 commit into from

Conversation

peterallenwebb
Copy link
Contributor

@peterallenwebb peterallenwebb commented Jul 23, 2024

Resolves CORE-318

Problem

There was no simple/consistent way to ensure that dbt fired expected events under test.

Solution

Add a new EventMonitor class that can be handed to dbtRunner as an event callback. It takes a list of expected events and can be used to assert that they all fired.

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 or 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.

@peterallenwebb peterallenwebb requested a review from a team as a code owner July 23, 2024 20:07
@cla-bot cla-bot bot added the cla:yes label Jul 23, 2024
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.79%. Comparing base (79ad0a3) to head (7b6013d).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10481      +/-   ##
==========================================
- Coverage   88.85%   88.79%   -0.07%     
==========================================
  Files         180      180              
  Lines       22573    22573              
==========================================
- Hits        20058    20043      -15     
- Misses       2515     2530      +15     
Flag Coverage Δ
integration 86.00% <ø> (-0.14%) ⬇️
unit 62.22% <ø> (ø)

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

Components Coverage Δ
Unit Tests 62.22% <ø> (ø)
Integration Tests 86.00% <ø> (-0.14%) ⬇️

@QMalcolm
Copy link
Contributor

QMalcolm commented Aug 5, 2024

@peterallenwebb Are we still figuring out how we want to move on this, or have we decided in favor of the existing EventCatcher class with the improvements made to it in #10482 and can now close this?

@peterallenwebb
Copy link
Contributor Author

@QMalcolm I've decided to shelve this for now. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants