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

test run command is ignoring environment variables file defined by the argument -e #2481

Closed
danielbdias opened this issue May 3, 2023 · 1 comment
Labels
bug Something isn't working triage requires triage

Comments

@danielbdias
Copy link
Contributor

Describe the bug

When running a test using tracetest run test command, when can pass a -e argument with an environment definition file. Today, on the version 0.11.6 the Tracetest CLI is ignoring this file and is not providing any output about that:

image

Example of test and environment file:

type: Test
spec:
  name: Add product to the cart
  description: Add a selected product to user shopping cart
  trigger:
    type: http
    httpRequest:
      url: ${env:CART_API_URL}
      method: POST
      headers:
      - key: Content-Type
        value: application/json
      body: '{"item":{"productId":"${env:PRODUCT_ID}","quantity":1},"userId":"${env:USER_ID}"}'
  specs:
  - selector: span[tracetest.span.type="http" name="hipstershop.CartService/AddItem"]
    name: "Checking if the correct ProductID was sent"
    assertions:
    - attr:app.product.id = "${env:PRODUCT_ID}"
  - selector: span[tracetest.span.type="database" name="HMSET" db.system="redis" db.redis.database_index="0"]
    name: "Checking if the product was persisted correctly on the shopping cart"
    assertions:
    - attr:tracetest.selected_spans.count >= 1

Env file:

type: Environment
spec:
  id: user-buying-products-env
  name: User buying Products - Env
  description: Environment for the process - "User buying products"
  values:
  - key: CART_API_URL
    value: http://frontend:8080/api/cart
  - key: CHECKOUT_API_URL
    value: http://frontend:8080/api/checkout
  - key: PRODUCT_ID
    value: OLJCESPC7Z
  - key: USER_ID
    value: 2491f868-88f1-4345-8836-d5d8511a9f83
@danielbdias danielbdias added bug Something isn't working triage requires triage labels May 3, 2023
@danielbdias
Copy link
Contributor Author

Solved on 0.11.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage requires triage
Projects
None yet
Development

No branches or pull requests

1 participant