-
Notifications
You must be signed in to change notification settings - Fork 208
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
Importing multiple simulation files initializes only the last sequence #839
Comments
I think you'll find Hoverfly only has the last simulation loaded. Hoverfly doesn't support the import of more than simulation (it would have to know how you want to merge them in case of identical requests). See #552 Currently if you want to import two simulations you need to merge them offline or capture everything in one go, or load two separate Hoverfly instances (assuming the simulations are distinct). |
Have you tried pulling the latest docker image:
The latest one should be v1.0.0: https://hub.docker.com/r/spectolabs/hoverfly/tags |
I believe that restriction applies only when importing via the API. You can clearly see from my error message that the simulation is loaded:
it did not match because the sequence was not initialized |
I am indeed using the correct image:
I think the version bit is a non-issue, it was reporting the version of my local hoverfly instance instead of the one running in the docker container |
@denisrosca, when you use either If you merge them offline, and import it once:
you should get both states initialized:
|
Unlikely. In general, at least where there's an interface, Hoverfly development has been API first. |
I know I am arguing against people that know more about hoverfly than me 😄 but it is obvious not all records are overriden. You can clearly see in the error message that hoverfly knows about the records from the first imported file. Otherwise the error message wouldn't mention it. I think the "override" part is only applied to states which is why the current behavior is confusing. |
You're right @denisrosca. I wasn't looking the error message carefully. I looked into the simulation that is loaded into hoverfly when you do We need to fix this inconsistency and initialize all sequences that are loaded in. |
Well, you could knock me over with a feather! I am pleasantly surprised. Thanks @denisrosca for ignoring me. It also appears Hoverfly will discard duplicate request/response pairs (assuming you use load the simulations in the same order) which should ensure that they are dealt with consistently. |
This is now fixed in v1.0.1 |
It is useful to have multiple simulation files loaded, any updates about this? |
@Amr1977 , loading multiple simulation is supported: https://hoverfly.readthedocs.io/en/latest/pages/tutorials/basic/importingsimulations/importingsimulations.html |
Description of the bug
Importing multiple simulation files initializes only the sequences from the last imported file.
Note: I'm using docker for this
Steps to reproduce the issue
1.json
and
2.json
:-webserver -import 1.json -import 2.json
GET /1
Observed result
Hoverfly error messages seen (If none, say none)
Expected result
Request matches and returns correct result.
Additional relevant information
P.S. Note that I'm using the latest docker image available on docker hub and I was expecting the hoverfly version to be
1.0.0
instead of1.0.0-rc2
.The text was updated successfully, but these errors were encountered: