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 setting different responses per request #68

Closed
wants to merge 1 commit into from
Closed

Allow setting different responses per request #68

wants to merge 1 commit into from

Conversation

spinales
Copy link

@spinales spinales commented Oct 2, 2020

#31
I made the idea that came to mind, I don't know how good it is

@spinales
Copy link
Author

spinales commented Oct 2, 2020

You can give me a hand with CircleCi, I don't know how to handle it, but I've done tests and it works

@aperezg
Copy link
Member

aperezg commented Oct 3, 2020

Sorry but this is not that we are looking for, the idea was explain on the issue that you refer:

It could be implemented by changing the response section (within imposter) from an object to an array of objects, adding to each of them a field times (or named similar) that would allow the user to set those different responses for each request.

However, it's entirely open, so feel free to write down a comment with your point-of-view and to start the discussion.

Then we want that the user can decide the order of executions of each response, and the time that this response will be repeated, with your solution only have one part that is to execute one of the responses randomly but the user can decide the order neither the times.

On the other hand, the test are failing is for that the CircleCI is not working:

# github.com/friendsofgo/killgrave/internal/server/http [github.com/friendsofgo/killgrave/internal/server/http.test]
internal/server/http/handler_test.go:48:125: cannot use body (type string) as type []string in field value
internal/server/http/handler_test.go:93:138: cannot use "test ok" (type string) as type []string in field value

you're changing the body that by now was a string by a []string, so you will need to change this on the tests also.

Thanks!!

@aperezg aperezg linked an issue Oct 4, 2020 that may be closed by this pull request
@aperezg
Copy link
Member

aperezg commented Mar 10, 2021

close by inactivity

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 setting different responses per request (repeats)
2 participants