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 resourceType and resourceName to PortForward event #2272

Merged
merged 3 commits into from
Jun 20, 2019

Conversation

priyawadhwa
Copy link
Contributor

Adds resourceType and resourceName to the PortForward event in skaffold.proto and regenerates the proto files.
Updates current port forwarding code to pass in this information for automatically forwarded pods.

Adds resourceType and resourceName to the PortForward event in skaffold.proto and regenerates the proto files.
Updates current port forwarding code to pass in this information for automatically forwarded pods.
Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

This would be a great opportunity to introduce a test for what events are sent during portforwarding. Do you mind adding it? Otherwise this looks good.

@priyawadhwa
Copy link
Contributor Author

@balopat I added a unit test to make sure the correct number of events were sent during port forwarding -- I think making sure the port forward event itself is correct would require some sort of unit testing framework around eventing which would probably make more sense to do separately. WDYT?

@balopat
Copy link
Contributor

balopat commented Jun 19, 2019

@balopat I added a unit test to make sure the correct number of events were sent during port forwarding -- I think making sure the port forward event itself is correct would require some sort of unit testing framework around eventing which would probably make more sense to do separately. WDYT?

Hmmm...I think that we could start that mini framework small - just by setting the event.PortForwarded to a global var and in test replace it with a mock that captures the argument that we can check against then. On the long run we can implement a couple of these and then extract the functionality to a fully functional mock for the event package.

I see more benefit in checking the actual events compared to just the number of events.

@codecov
Copy link

codecov bot commented Jun 19, 2019

Codecov Report

Merging #2272 into master will decrease coverage by 0.64%.
The diff coverage is 3.64%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2272      +/-   ##
=========================================
- Coverage   60.64%     60%   -0.65%     
=========================================
  Files         186     186              
  Lines        7857    7945      +88     
=========================================
+ Hits         4765    4767       +2     
- Misses       2706    2792      +86     
  Partials      386     386
Impacted Files Coverage Δ
pkg/skaffold/server/proto/skaffold.pb.go 4.7% <0.76%> (-0.97%) ⬇️
pkg/skaffold/event/event.go 89.79% <100%> (+0.14%) ⬆️
pkg/skaffold/kubernetes/port_forward.go 47.47% <25%> (-0.45%) ⬇️
pkg/skaffold/jib/jib.go 77.41% <0%> (-1.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 355fae5...9d0083c. Read the comment docs.

@priyawadhwa priyawadhwa requested a review from balopat June 20, 2019 18:20
@balopat balopat merged commit ce51164 into GoogleContainerTools:master Jun 20, 2019
@priyawadhwa priyawadhwa deleted the proto-update branch June 20, 2019 20:45
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.

3 participants