You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all. I want to thank you for all the hard work that has been put into this tool. We're excited to use it and it has sped up our development.
Last week, something changed. When sending the same exact request, every other response is matched incorrectly. Here are some details to help with debugging:
Here's the dockerfile used with Drakov:
FROM node:boron
RUN npm install -g drakov
EXPOSE 80
WORKDIR /app
COPY . .
CMD ["drakov", "--config", "config.js"]
The request is a simple get request to an endpoint with an Authorization header.
Here are the logs. The only difference I can see in the logs is the order in which the MATCHING occurs and the final DRAKOV response. Again, the request is identical.
Failing response or incorrect matching:
mock_identity_1 | [LOG] GET /identity/sessions
mock_identity_1 | [MATCHING] by url pattern: /identity/sessions/refresh NOT_MATCHED
mock_identity_1 | [MATCHING] by url pattern: /identity/users/:id NOT_MATCHED
mock_identity_1 | [MATCHING] by url pattern: /identity/user_groups/:id NOT_MATCHED
mock_identity_1 | [MATCHING] by url pattern: /identity/sessions MATCHED
mock_identity_1 | [MATCHING] by request header accept-version = v1 MATCHED
mock_identity_1 | [MATCHING] by request header accept-version = v1 MATCHED
mock_identity_1 | [MATCHING] by request header authorization = Bearer invalid.bearer.token NOT_MATCHED
mock_identity_1 | [MATCHING] by request header accept-version = v1 MATCHED
mock_identity_1 | [MATCHING] by request header authorization = Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxWU01aW1hRWFuNTlHVmJJQzZ0QnE2IiwianRpIjoic29tZV9qdGkifQ._WwA_3cesbxS2IpXGWe81UzJymUZfPupSErjSEAEVik MATCHED
mock_identity_1 | [MATCHING] by request content type: actual: MATCHED
mock_identity_1 | [MATCHING] by request content type: actual: MATCHED
mock_identity_1 | [MATCHING] by request body content MATCHED
mock_identity_1 | [MATCHING] by request body content MATCHED
mock_identity_1 | [DRAKOV] GET /identity/sessions Request with missing token
Correct response and matching:
mock_identity_1 | [LOG] GET /identity/sessions
mock_identity_1 | [MATCHING] by url pattern: /identity/sessions/refresh NOT_MATCHED
mock_identity_1 | [MATCHING] by url pattern: /identity/users/:id NOT_MATCHED
mock_identity_1 | [MATCHING] by url pattern: /identity/user_groups/:id NOT_MATCHED
mock_identity_1 | [MATCHING] by url pattern: /identity/sessions MATCHED
mock_identity_1 | [MATCHING] by request header accept-version = v1 MATCHED
mock_identity_1 | [MATCHING] by request header authorization = Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxWU01aW1hRWFuNTlHVmJJQzZ0QnE2IiwianRpIjoic29tZV9qdGkifQ._WwA_3cesbxS2IpXGWe81UzJymUZfPupSErjSEAEVik MATCHED
mock_identity_1 | [MATCHING] by request header accept-version = v1 MATCHED
mock_identity_1 | [MATCHING] by request header authorization = Bearer invalid.bearer.token NOT_MATCHED
mock_identity_1 | [MATCHING] by request header accept-version = v1 MATCHED
mock_identity_1 | [MATCHING] by request content type: actual: MATCHED
mock_identity_1 | [MATCHING] by request content type: actual: MATCHED
mock_identity_1 | [MATCHING] by request body content MATCHED
mock_identity_1 | [MATCHING] by request body content MATCHED
mock_identity_1 | [DRAKOV] GET /identity/sessions Get Session
Every time I make this identical request, it toggles back and forth between the two responses.
In my .apib file, the first two examples have an 'Authorization' header, the third does not. My guess is that every other request, this third example is matched, even though the header is present in the request, and should have matched the first example which has the same header.
If I remove the third example, the problem goes away. Thing is, I need that example for Dredd contract testing. Any help in resolving this would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
On closer look (thanks for the better log messages!), the endpoint in question has three examples. Looks like each time, the order they are processed flips. (1,2,3) on the first run. (3,2,1) on the second run. It would be nice if the behavior was always (1,2,3) so that you can put more explicit endpoint first, and more generic (catch all) endpoints later, with predictable results.
This becomes more important when using Dredd for contract testing, wanting to cover more request / response scenarios.
bwinterling
changed the title
Every other response fails.
Every other response fails - Endpoint examples matching order flip flops each run.
Feb 14, 2017
First of all. I want to thank you for all the hard work that has been put into this tool. We're excited to use it and it has sped up our development.
Last week, something changed. When sending the same exact request, every other response is matched incorrectly. Here are some details to help with debugging:
Here's the dockerfile used with Drakov:
Here's the config.js
The request is a simple get request to an endpoint with an Authorization header.
Here are the logs. The only difference I can see in the logs is the order in which the
MATCHING
occurs and the finalDRAKOV
response. Again, the request is identical.Failing response or incorrect matching:
Correct response and matching:
Every time I make this identical request, it toggles back and forth between the two responses.
In my .apib file, the first two examples have an 'Authorization' header, the third does not. My guess is that every other request, this third example is matched, even though the header is present in the request, and should have matched the first example which has the same header.
First example in .apib:
Third example in .apib:
If I remove the third example, the problem goes away. Thing is, I need that example for Dredd contract testing. Any help in resolving this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: