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

Fix missing error handling #487

Merged
merged 2 commits into from
Jun 29, 2021
Merged

Conversation

shubham14bajpai
Copy link
Contributor

Signed-off-by: shubham [email protected]

Description

Why is this needed

The err checked in line 265 is the error from the previous function call and the error from line 264 is not being handled. The fix captures the error at the correct place.

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

jacobweinstock
jacobweinstock previously approved these changes May 4, 2021
@markjacksonfishing
Copy link
Contributor

Also, thank you for the PR and welcome to the community!

@codecov
Copy link

codecov bot commented May 4, 2021

Codecov Report

Merging #487 (ae84dbf) into master (013d202) will not change coverage.
The diff coverage is 0.00%.

❗ Current head ae84dbf differs from pull request most recent head 5ba9234. Consider uploading reports for the commit 5ba9234 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #487   +/-   ##
=======================================
  Coverage   32.70%   32.70%           
=======================================
  Files          44       44           
  Lines        3137     3137           
=======================================
  Hits         1026     1026           
  Misses       2019     2019           
  Partials       92       92           
Impacted Files Coverage Δ
cmd/tink-worker/internal/worker.go 0.00% <0.00%> (ø)

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 60a74c7...5ba9234. Read the comment docs.

@markjacksonfishing
Copy link
Contributor

@shubham14bajpai this is the test cmd/tink-worker/internal/worker.go#L264

@shubham14bajpai
Copy link
Contributor Author

@shubham14bajpai this is the test cmd/tink-worker/internal/worker.go#L264

There is no _test file for worker.go Should I add one with a test case for ProcessWorkflowActions function?

@markjacksonfishing
Copy link
Contributor

Yes please

@shubham14bajpai
Copy link
Contributor Author

Yes please

I need a little help with that. I haven't written much tests around grpc clients. Can you guide me how to mock the WorkflowServiceClient in the Worker object? Should I use gomock or is there a better way to do that?

@markjacksonfishing
Copy link
Contributor

@shubham14bajpai I have been really enjoying testify/mock. You can get a idea of the test mindset here

@gauravgahlot
Copy link
Contributor

@shubham14bajpai Could please update the branch and also fix the CI issue?

Copy link
Member

@jacobweinstock jacobweinstock left a comment

Choose a reason for hiding this comment

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

While this doesn't have tests, I feel comfortable approving.

@jacobweinstock jacobweinstock merged commit 1a02f92 into tinkerbell:master Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants