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

Bug: unknown option '--env-var "..."' #2581

Closed
TheSlimvReal opened this issue Jan 3, 2021 · 2 comments
Closed

Bug: unknown option '--env-var "..."' #2581

TheSlimvReal opened this issue Jan 3, 2021 · 2 comments

Comments

@TheSlimvReal
Copy link

I use newman to create an integration test with helm test
I fetch the postman/newman image and provide the path to the collection via the GitLab API.
The collection contains a reference: {{baseUrl}} which I want to define when I run newman using the --env-var option.

In my helm template:

- name: newman
  image: postman/newman
  command: [ 'newman' ]
  args: ['run', '--env-var "baseUrl={{ include "helm-test.fullname" . }}:{{ .Values.service.port }}"', '<collection_path>']

When I run helm test I get the follwing error:
error: unknown option '--env-var "baseUrl=<tempalte_name>:80"'
where <template_name> is the injected name of my template.

The fetching of the collection and injection of the variables works fine when I run it manually outside of minikube.
When I run newman run -h it also displays me the --env-var option. I don't understand why it has problems when I use it.

  1. Newman Version (can be found via newman -v): 5.2.1 (I use the postman/newman docker image)
  2. OS details (type, version, and architecture): Windows but container is run in minikube
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: Recently
  5. Expected behaviour: newman should accept the variables provided with env-var
  6. Command / script used to run Newman: newman run --env-var "baseUrl=<url>" <collection_path>
@TheSlimvReal TheSlimvReal changed the title Bug: unknown option '--env-var "..." Bug: unknown option '--env-var "..."' Jan 3, 2021
@codenirvana
Copy link
Member

@TheSlimvReal The Newman run command expects a collection path or URL followed by the run options.

I hope this will fix your issue: newman run <collection_path> --env-var "baseUrl=<url>".

@TheSlimvReal
Copy link
Author

Unfortunately, the changed order does not change anything. The same error message is displayed.

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