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

document local environment variables injection in CLI #2994

Open
mathnogueira opened this issue Jul 27, 2023 · 1 comment
Open

document local environment variables injection in CLI #2994

mathnogueira opened this issue Jul 27, 2023 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@mathnogueira
Copy link
Contributor

mathnogueira commented Jul 27, 2023

Describe the enhancement you'd like to see
Our CLI is able to replace values into the definition file when you run tracetest run test. For example:

type: Test
spec:
  name: POST import pokemon
  description: Import a pokemon using its ID
  trigger:
    type: http
    httpRequest:
      url: http://pokemon-demo.tracetest.io/pokemon/import
      method: POST
      headers:
      - key: Content-Type
        value: application/json
      authentication:
        type: apiKey
        apiKey:
          key: X-Key
          # This is a reference to a local environment variable
          # This is different than when we reference environments 
          # (soon-to-be variablesets), which we prefix with `env:`
          value: ${POKEMON_APP_API_KEY}
          in: header
      body: '{ "id": 52 }'

Our CLI will detect the placeholder ${VAR_NAME} and replace the string ${VAR_NAME} with the content
of the environment variable with the same name.

This is useful if you have to set the value of a variable based on your local machine or create variable sets using local env variables.

@mathnogueira mathnogueira added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 27, 2023
@adnanrahic adnanrahic self-assigned this Aug 14, 2023
@xoscar xoscar assigned mathnogueira and unassigned adnanrahic Jan 23, 2024
@xoscar
Copy link
Contributor

xoscar commented Jan 23, 2024

@mathnogueira could you take a look at this to see if this is needed?

CC: @schoren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants