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

Feature/504 http discard response #742

Merged
merged 5 commits into from
Aug 17, 2018

Conversation

ofauchon
Copy link
Contributor

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);

@CLAassistant
Copy link

CLAassistant commented Aug 14, 2018

CLA assistant check
All committers have signed the CLA.

@codecov-io
Copy link

codecov-io commented Aug 14, 2018

Codecov Report

Merging #742 into master will increase coverage by 0.03%.
The diff coverage is 84%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
cmd/options.go 62.26% <100%> (+0.72%) ⬆️
lib/options.go 78.98% <100%> (+0.27%) ⬆️
js/modules/k6/http/http_request.go 79.95% <80.95%> (-0.05%) ⬇️

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 d4152d2...92e7aad. 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.

Besides the minor quibbles, this looks very good to me. Thanks for implementing it and the for quick pull request!

@@ -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":
Copy link
Member

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.

@na-- na-- requested a review from luizbafilho August 14, 2018 08:05
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.

LGTM, thanks!

@na-- na-- merged commit 9128c7e into grafana:master Aug 17, 2018
na-- added a commit that referenced this pull request Aug 17, 2018
Add #742 to the release notes and improve the noCookiesReset blurb
@na-- na-- mentioned this pull request Aug 17, 2018
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