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

Using $ref in YAML files to avoid duplication #3298

Open
RikdeVos opened this issue Aug 1, 2024 · 1 comment
Open

Using $ref in YAML files to avoid duplication #3298

RikdeVos opened this issue Aug 1, 2024 · 1 comment

Comments

@RikdeVos
Copy link
Contributor

RikdeVos commented Aug 1, 2024

We'd like to propose a feature to use get rid of some YAML duplication by using $ref. This syntax is also available in openapi-spec definitions, and seems to be getting more traction lately by other tooling using YAML.

Examples:

# test.artillery.yml
scenarios:
  - flow:
    - $ref: "auth.yml/#/steps/login"
    - get: 
        name: Get secure resource
        url: "/foo"
        headers:
          $ref: "auth.yml/#/headers"

# auth.yml
steps:
  login:
    - post:
        url: "/login"
        capture:
            - json: "$.accessToken"
              as: "accessToken"
headers:
  Content-Type: application/json
  Authorization: "Bearer {{ accessToken }}"
@hassy
Copy link
Member

hassy commented Aug 7, 2024

This is a great suggestion @RikdeVos, thank you! There's a few things we'd like to improve in Artillery's support for reusability of test definitions, this could be one of them.

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

No branches or pull requests

2 participants