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

Scenario Values & Reading from Response #178

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

jdietrich-tc
Copy link
Contributor

There are use scenarios that require a random value is generated and sent in the
response in one state, and the same value is returned in a future state.

To make this possible a couple of things had to happen.

  1. We need to be able to read and fill from values in the response
    - a new response filler has been created
    - {{response.body.*}}
    - {{response.cookie.*}}
    - {{response.header.*}}
  2. We need to fill the request and then reload the holders and variables
    - this is the same approach that streams uses
  3. The mock definition must add support for scenario values
  4. The scenario store must be able to store and retrieve values associated with the current scenario
  5. A scenario filler is created so that future calls can pull values out of the scenario
    - {{scenario.*}}

@BeSenuHiro
Copy link

I'm using mmock and would like to have a feature that automatically sets the scenario name from the request information, so when is this PR likely to be released?

@jdietrich-tc
Copy link
Contributor Author

I'm using mmock and would like to have a feature that automatically sets the scenario name from the request information, so when is this PR likely to be released?

This PR did not support replacement tags in the scenario name, but now it does.
As for when it will (of if it will ever) be included in the default builds, is up to @jmartin82

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 48.44961% with 133 lines in your changes missing coverage. Please review.

Project coverage is 64.27%. Comparing base (0745469) to head (aeae4a5).
Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
pkg/vars/http_entity_params.go 31.34% 82 Missing and 10 partials ⚠️
pkg/match/scenario_store.go 23.33% 23 Missing ⚠️
internal/server/dispatcher.go 0.00% 12 Missing ⚠️
pkg/vars/evaluator.go 82.85% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #178      +/-   ##
==========================================
- Coverage   66.95%   64.27%   -2.69%     
==========================================
  Files          26       30       +4     
  Lines        1153     1839     +686     
==========================================
+ Hits          772     1182     +410     
- Misses        330      587     +257     
- Partials       51       70      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants