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

test: Use gomock instead of implement interfaces manually #530

Merged
merged 3 commits into from
Apr 12, 2023

Conversation

helayoty
Copy link
Member

@helayoty helayoty commented Apr 12, 2023

Using gomock would be much easier than implementing interfaces manually in the network and auth cases.

Steps to re-generate the mock (no need to rerun it as long as interfaces are not changed):

go install github.com/golang/mock/mockgen@v1.6.0

cd pkg/network
mockgen -source=aci_network.go -destination=mock_aci_network_test.go -package=network

cd ../auth
mockgen -source=auth_config.go -destination=mock_auth_config_test.go -package=auth

Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
@helayoty helayoty requested a review from Fei-Guo as a code owner April 12, 2023 14:07
@helayoty helayoty temporarily deployed to test April 12, 2023 14:08 — with GitHub Actions Inactive
@helayoty helayoty temporarily deployed to test April 12, 2023 14:08 — with GitHub Actions Inactive
@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2023

Codecov Report

Merging #530 (86842ab) into master (59fd228) will increase coverage by 0.78%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #530      +/-   ##
==========================================
+ Coverage   60.99%   61.78%   +0.78%     
==========================================
  Files          17       15       -2     
  Lines        2505     2473      -32     
==========================================
  Hits         1528     1528              
+ Misses        865      833      -32     
  Partials      112      112              

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@helayoty helayoty temporarily deployed to test April 12, 2023 15:53 — with GitHub Actions Inactive
@helayoty helayoty temporarily deployed to test April 12, 2023 15:53 — with GitHub Actions Inactive
@helayoty helayoty temporarily deployed to test April 12, 2023 15:56 — with GitHub Actions Inactive
@helayoty helayoty temporarily deployed to test April 12, 2023 15:56 — with GitHub Actions Inactive
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
@helayoty helayoty temporarily deployed to test April 12, 2023 16:00 — with GitHub Actions Inactive
@helayoty helayoty temporarily deployed to test April 12, 2023 16:00 — with GitHub Actions Inactive
@helayoty helayoty merged commit 9573d41 into virtual-kubelet:master Apr 12, 2023
@helayoty helayoty deleted the gomock-use branch April 12, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants