tag1consulting / goose

Load testing framework, inspired by Locust
https://tag1.com/goose
Apache License 2.0
759 stars 69 forks source link

HTML report doesn't include correct method and path when creating request using builder #511

Closed heyrutvik closed 2 years ago

heyrutvik commented 2 years ago

First all of thank you for making this tool. :pray:

version: 0.16.4-dev

I need to include header in POST request so I'm following standard practice of creating a request using builder. The mechanism is working fine but the final report doesn't capture it correctly. Here is the screenshot and code snippet,

let req_builder = user
    .get_request_builder(&GooseMethod::Post, "/payments")?
    .header("API-KEY", "test")
    .json(&payload);

let request = GooseRequest::builder().set_request_builder(req_builder).build();

Screenshot from 2022-08-15 16-01-11

I looked into the code and figured that GooseRequestBuilder sets GET to method by default. And since I'm using request_builder to set header, path and method information, it doesn't reflect in GooseRequest value. So after setting a request builder, I'm setting method and path (redundant) as following,

let req_builder = user
    .get_request_builder(&GooseMethod::Post, "/payments")?
    .header("API-KEY", "test")
    .json(&payload);

let request = GooseRequest::builder()
    .set_request_builder(req_builder)
    .path("/payments")
    .method(GooseMethod::Post)
    .build();

Screenshot from 2022-08-15 16-10-16

I think there should be no need to set those values again once we specified in builder, and while calling set_request_builder respective state should get updated as per provided argument. As of now, I couldn't find a way to get those information out of request builder. Please guide me if I'm doing anything wrong, or let me know if I can help you to fix this. Thanks!

heyrutvik commented 2 years ago

@jeremyandrews is there a developer channel to get into discussions and for folks who want to help out? I tried to look for one but couldn't find any. I'm seeing we are moving from taskset/task to scenario/transaction terminology, and with some really useful features. Let me know if I can help you to get it release any faster! :slightly_smiling_face:

jeremyandrews commented 2 years ago

@heyrutvik at this time there's no real-time medium. Instead, it's preferred that you help out through github issues and pull requests in a more asynchronous fashion.

Thanks for the bug report -- definitely sounds like an issue that needs to be fixed. I'll aim to review shortly.

heyrutvik commented 2 years ago

@jeremyandrews @slashrsm Thank you!