Skip to content

Import an existing simulation and re-capturing results duplicated pairs #852

Description

@tommysitu

Description of the bug

Hoverfly in capture mode adding pairs that already exists from an imported simulation.

Steps to reproduce the issue

  1. Capture an API:
hoverctl start
hoverctl mode capture
curl --proxy localhost:8500 http://echo.jsontest.com/key/value/one/two
  1. Export the simulation: hoverctl export echo.json
  2. Re-import it: hoverctl import echo.json
  3. Do the capturing again: curl --proxy localhost:8500 http://echo.jsontest.com/key/value/one/two

Observed result

If I inspect the simulations now: http://localhost:8888/api/v2/simulation, it shows two identical request/response pairs are captured.

Expected result

Only one request/response pair should be saved, as the second request is exactly the same as the first one.

Additional relevant information

  1. Hoverfly version: v1.0.0
  2. Anything that might help us to diagnose the problem
    Debugging reveals that the request matcher structs created by importing and capturing are different. The default value for headers and query maps are nil when it's created by import, and they are empty maps when it's created by capturing. See the following screenshot.

Screenshot 2019-06-12 21 42 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions