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

Handle nil values from benchmarks in Capistrano #159

Merged
merged 3 commits into from
Oct 1, 2018
Merged

Handle nil values from benchmarks in Capistrano #159

merged 3 commits into from
Oct 1, 2018

Conversation

masci
Copy link
Contributor

@masci masci commented Oct 1, 2018

Fixes #148

Even if I couldn't find the root cause of #148, the library should not YOLO-call round on the return value of the benchmark.
This PRs adds a try/rescue around the call so that if the benchmark value can't be converted to Float it returns the string n/a.

Also added a test for the specific case.

@masci masci modified the milestones: Next, 1.31 Oct 1, 2018
@@ -13,7 +13,9 @@ def self.reporter()

def self.cap_version()
if @cap_version.nil? then
if Configuration.respond_to? :instance then
if !defined? Configuration
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Configuration is not defined at test time, library would eventually fail with an empty version but for testing is ok.

Copy link
Contributor

@zippolyte zippolyte left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants