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

dont return an empty set when something goes wrong #122

Merged
merged 1 commit into from
Sep 27, 2017

Conversation

durandom
Copy link
Member

@durandom durandom requested a review from yaacov September 27, 2017 15:11
@durandom durandom added the bug label Sep 27, 2017
@durandom
Copy link
Member Author

ManageIQ/manageiq#16042 was my first attempt to address this BZ

Copy link
Member

@yaacov yaacov left a comment

Choose a reason for hiding this comment

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

LGTM

@yaacov
Copy link
Member

yaacov commented Sep 27, 2017

The fail test are exactly what we want to change :-) so we just need to change the tests to "not failing silently" instead of "fail silently"

@yaacov
Copy link
Member

yaacov commented Sep 27, 2017

^^

the lines [1] of the three fail tests:
expect(@node.perf_collect_metrics('interval_name')).to eq([{}, {}])
should be:
expect(@node.perf_collect_metrics('interval_name')).to raise_error

and the name should also change to "not silently" :-)

[1] https://github.com/ManageIQ/manageiq-providers-kubernetes/blob/master/spec/models/manageiq/providers/kubernetes/container_manager/metrics_capture_spec.rb#L30

@miq-bot
Copy link
Member

miq-bot commented Sep 27, 2017

Checked commit durandom@2d44649 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@yaacov
Copy link
Member

yaacov commented Sep 27, 2017

LGTM 👍

@yaacov
Copy link
Member

yaacov commented Sep 27, 2017

p.s.

the reason for the fail quietly was to allow our internal testing scripts we used to populate metrics to run without failing on missing metrics. so no problem to rais error here from our side.

@durandom
Copy link
Member Author

@agrare can you give a quick 👍 as well?
@simon3z can you merge afterwards?

@simon3z
Copy link
Contributor

simon3z commented Sep 27, 2017

@simon3z can you merge afterwards?

@durandom definitely. thanks!

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@agrare
Copy link
Member

agrare commented Sep 27, 2017

ping @simon3z

@simon3z simon3z merged commit 9cf161b into ManageIQ:master Sep 27, 2017
@durandom durandom deleted the perf_collect_raise branch September 28, 2017 06:37
@durandom
Copy link
Member Author

@agrare agrare added this to the Sprint 70 Ending Oct 2, 2017 milestone Oct 2, 2017
@simaishi
Copy link

Fine backport (to manageiq repo) details:

$ git log -1
commit f5c8cfb27642a8ab4dd4c3ed77d0c8f420034822
Author: Federico Simoncelli <[email protected]>
Date:   Thu Sep 28 00:05:23 2017 +0200

    Merge pull request #122 from durandom/perf_collect_raise
    
    dont return an empty set when something goes wrong
    (cherry picked from commit 9cf161bf3af9867737eaee4deb026252934d2321)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1496938

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.

6 participants