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

js/k6/http: Fix lint errors #3566

Merged
merged 2 commits into from
Jan 29, 2024
Merged

js/k6/http: Fix lint errors #3566

merged 2 commits into from
Jan 29, 2024

Conversation

codebien
Copy link
Contributor

@codebien codebien commented Jan 24, 2024

Updates #769

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (ef1f214) 72.82% compared to head (b288ecf) 72.97%.
Report is 1 commits behind head on master.

❗ Current head b288ecf differs from pull request most recent head 69ce0bf. Consider uploading reports for the commit 69ce0bf to get more accurate results

Files Patch % Lines
js/modules/k6/http/request.go 66.66% 1 Missing and 1 partial ⚠️
js/modules/k6/http/response.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3566      +/-   ##
==========================================
+ Coverage   72.82%   72.97%   +0.14%     
==========================================
  Files         278      280       +2     
  Lines       20947    20951       +4     
==========================================
+ Hits        15254    15288      +34     
+ Misses       4715     4692      -23     
+ Partials      978      971       -7     
Flag Coverage Δ
macos 72.89% <50.00%> (?)
ubuntu 72.89% <50.00%> (?)
windows 72.82% <50.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codebien codebien marked this pull request as ready for review January 24, 2024 18:16
@codebien codebien requested a review from a team as a code owner January 24, 2024 18:16
@codebien codebien requested review from mstoykov and joanlopez and removed request for a team January 24, 2024 18:16
Comment on lines +130 to +134
b, ok := resp.Body.([]byte)
if !ok {
panic("got an unexpected type for the response body, only []byte is accepted")
}
resp.Body = c.moduleInstance.vu.Runtime().NewArrayBuffer(b)
Copy link
Contributor

Choose a reason for hiding this comment

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

There really is no way for this to happen apart from programming error on our side.

I am not against hte change - but arguably:

  1. just a nolint would've been simpler
  2. this panic should mention this is a programming error.

@mstoykov mstoykov added this to the v0.50.0 milestone Jan 25, 2024
@mstoykov mstoykov merged commit 0127098 into master Jan 29, 2024
25 checks passed
@mstoykov mstoykov deleted the fix-lint-http branch January 29, 2024 14:38
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.

4 participants