-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Feature/504 http discard response #742
Feature/504 http discard response #742
Conversation
Codecov Report
@@ Coverage Diff @@
## master #742 +/- ##
==========================================
+ Coverage 64.14% 64.17% +0.03%
==========================================
Files 101 101
Lines 8381 8394 +13
==========================================
+ Hits 5376 5387 +11
- Misses 2650 2651 +1
- Partials 355 356 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the minor quibbles, this looks very good to me. Thanks for implementing it and the for quick pull request!
js/modules/k6/http/http_request.go
Outdated
@@ -329,6 +331,8 @@ func (h *HTTP) parseRequest(ctx context.Context, method string, reqURL URL, body | |||
result.timeout = time.Duration(params.Get(k).ToFloat() * float64(time.Millisecond)) | |||
case "throw": | |||
result.throw = params.Get(k).ToBoolean() | |||
case "discardresponsebody": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this in camelCase as well, i.e. discardResponseBody
?
@@ -367,6 +367,12 @@ func TestOptions(t *testing.T) { | |||
opts := Options{}.Apply(Options{RunTags: tags}) | |||
assert.Equal(t, tags, opts.RunTags) | |||
}) | |||
t.Run("DiscardResponseBody", func(t *testing.T) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Add #742 to the release notes and improve the noCookiesReset blurb
Discard Response Body Feature implementation
You can use it either globaly (k6 run --discard-response-body xxx.js)
... or per-request within a script:
_let params = { discardresponsebody: true }
r= http.get("http://your.test.com/url", params);