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

Allow different verbs payload #8

Merged
merged 17 commits into from
Nov 27, 2023
Merged

Conversation

nahime0
Copy link
Collaborator

@nahime0 nahime0 commented Nov 11, 2023

This PR introduces support to POST requests.

Two new options has been introduces:

  • method: can be either get or post
  • payload: the json encoded data to use for the stress test

The two options will be forwarded to k6 using the already defined options environment variable.
The run.js used by k6 has been adapted to use get or post based on the method, and to use the payload variable only if the required method is post.

@nunomaduro I haven't written any test. I don't know if you want to use a different test suite, as the default one uses the same stress object for all requests (defined in the beforeEach of Pest.php).

@nahime0 nahime0 requested a review from nunomaduro November 11, 2023 18:22
@nahime0 nahime0 linked an issue Nov 11, 2023 that may be closed by this pull request
@nunomaduro
Copy link
Member

Thanks! Currently at Laracon AU, but I will check this after.

src/Factory.php Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/Factory.php Outdated Show resolved Hide resolved
src/Plugin.php Outdated Show resolved Hide resolved
src/Plugin.php Outdated Show resolved Hide resolved
…he payload must be provided with the post argument / method
@nunomaduro nunomaduro merged commit 4e732ed into 2.x Nov 27, 2023
36 checks passed
@nunomaduro nunomaduro deleted the 5-allow-different-verbs-payload branch November 27, 2023 10:29
@nunomaduro
Copy link
Member

@nahime0 Are you able to PR the other verbs? Like put, delete, etc?

@nahime0
Copy link
Collaborator Author

nahime0 commented Dec 3, 2023

Hi @nunomaduro, Yes, of course. I'll be engaged on a test for a job position till tomorrow noon. I'll be back on this right after.

@nahime0
Copy link
Collaborator Author

nahime0 commented Dec 6, 2023

@nunomaduro Just opened a new PR #15

@SilvioDoMine
Copy link

@nunomaduro do you think is pertinent to have a option where we can stress test with a dynamic payload?

Let's say we are stress testing a payment gateway, and we want to hit the STORE payment multiple times with multiple ids. Maybe we can stress with different payload/id for each request

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.

Allow different verbs / payload
4 participants