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

Prevent panic when slicing end is higher than nodes array size #1756

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

asettouf
Copy link
Contributor

@asettouf asettouf commented Dec 6, 2020

Hi,

first time contributing on this project (which I find lovely), so let me know if there is anything I can make to improve this PR.

Solves #1487

@codecov-io
Copy link

codecov-io commented Dec 6, 2020

Codecov Report

Merging #1756 (88dcffc) into master (cfedc92) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1756      +/-   ##
==========================================
- Coverage   71.51%   71.44%   -0.08%     
==========================================
  Files         178      178              
  Lines       13775    13775              
==========================================
- Hits         9851     9841      -10     
- Misses       3312     3322      +10     
  Partials      612      612              
Flag Coverage Δ
ubuntu 71.40% <100.00%> (-0.06%) ⬇️
windows 70.01% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
js/modules/k6/html/html.go 81.95% <100.00%> (ø)
core/engine.go 90.95% <0.00%> (-2.02%) ⬇️
lib/executor/vu_handle.go 93.33% <0.00%> (-1.91%) ⬇️
js/runner.go 80.45% <0.00%> (-0.66%) ⬇️
stats/cloud/collector.go 79.81% <0.00%> (-0.64%) ⬇️

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 cfedc92...88dcffc. Read the comment docs.

Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

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

Thanks!

@na-- na-- requested review from imiric and mstoykov December 7, 2020 07:49
@asettouf
Copy link
Contributor Author

asettouf commented Dec 7, 2020

@na-- I'm just a bit surprised I'm decreasing the coverage. Should I add more tests for html.go, on the Slice function?

Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

I would've preferred a more unit-focused test to avoid testing the js.Runner for this, but it's not a big deal.

As for the Codecov report, don't worry about it. It's frequently wrong and we want to replace it with something better, but haven't gotten around to it. 😞

@na-- na-- merged commit 1443e5e into grafana:master Dec 9, 2020
@na-- na-- added this to the v0.30.0 milestone Dec 9, 2020
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.

4 participants