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

refactor(ngrokapi): Refactor ngrokapi package to better support mocking #578

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

jonstacks
Copy link
Collaborator

What

Step 1 in beefing up our test coverage. Rather than returning clients for everything, return interfaces that behave like the actual clients. This will allow us to rely on the interfaces in the rest of the code and eventually substitute mock clients so we can test the behavior of our controllers better.

How

Make interfaces for our clients and replace the actual implementation with the interfaces.

Breaking Changes

No

@jonstacks jonstacks self-assigned this Jan 21, 2025
@jonstacks jonstacks requested a review from a team as a code owner January 21, 2025 20:26
@github-actions github-actions bot added the area/controller Issues dealing with the controller label Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 0% with 34 lines in your changes missing coverage. Please review.

Project coverage is 23.67%. Comparing base (382afff) to head (8099c2d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/ngrokapi/edge_modules_https_clientset.go 0.00% 14 Missing ⚠️
internal/ngrokapi/clientset.go 0.00% 11 Missing ⚠️
internal/ngrokapi/edge_modules_tls_clientset.go 0.00% 5 Missing ⚠️
internal/ngrokapi/edge_modules_tcp_clientset.go 0.00% 3 Missing ⚠️
...nternal/controller/ingress/httpsedge_controller.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #578   +/-   ##
=======================================
  Coverage   23.67%   23.67%           
=======================================
  Files          88       88           
  Lines       12484    12484           
=======================================
  Hits         2955     2955           
  Misses       9339     9339           
  Partials      190      190           

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

@jonstacks jonstacks added this pull request to the merge queue Jan 23, 2025
Merged via the queue into ngrok:main with commit ba5c219 Jan 23, 2025
10 checks passed
@jonstacks jonstacks deleted the mocktail branch January 23, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Issues dealing with the controller
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants