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

feat: add ability to make all rows in a CSV payload available to each VU #1485

Merged
merged 3 commits into from
Jun 24, 2022

Conversation

hassy
Copy link
Member

@hassy hassy commented Jun 21, 2022

Setting the "name" property on a CSV payload will make all rows available to the VU, under the variable with that name. The type of the value is an array of objects, where each object has properties corresponding to the "fields" spec of the CSV payload.

Example:

config:
  target: https://www.artillery.io
  payload:
    # Load all rows from the CSV file into a "data" variable. Each element of the
    # array will have an "url" and "code" property:
    - path: ./request-response.csv
      name: data
      fields: [url, code]
  plugins:
    expect: {}
scenarios:
  - flow:
    # Loop over each element in the data variable, with loop-over
    # Each element in the "data" array can be accessed via the special
    # $loopElement variable.
    # https://artillery.io/docs/guides/guides/http-reference.html#Looping-through-an-array
    - loop:
        - get:
            url: "{{ $loopElement.url }}"
            followRedirect: false
            expect:
              statusCode: "{{ $loopElement.code }}"
      over: "data"

- Setting the "name" property on a CSV payload will make all rows available
  to the VU, under the variable with that name. The type of the value is
  an array of objects, where each object has properties corresponding to
  the "fields" spec of the CSV payload.
@hassy hassy merged commit a33ad60 into master Jun 24, 2022
@hassy hassy deleted the feat/load-entire-csv branch June 24, 2022 13:01
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.

None yet

1 participant