postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.83k stars 1.15k forks source link

Option "--global-var" unknown when running newman as a Docker container #3249

Open nicolasduminil opened 2 months ago

nicolasduminil commented 2 months ago
  1. Newman Version (can be found via newman -v): postman/newman:latest
  2. OS details (type, version, and architecture): Ubuntu 22.04.4 LTS
  3. Are you using Newman as a library, or via the CLI? As a docker image
  4. Did you encounter this recently, or has this bug always been there: recently
  5. Expected behavior:

    For e2e testing, I'm running a postman/newman:latest image with testcontainers. When I execute the test with JUnit, the container doesn't start and raises the following exception:

    2024-07-09 18:54:01,718 ERROR [tc.postman/newman:latest] (main) Log output from the failed container: error: unknown option '--global-var base_uri=localhost:8081'

What seems to happen is that the option "--global-var" isn't recognized as valid. Running the same command as the one in JUnit but using command line (docker run), works as expected.

Steps to reproduce the problem:

  1. $ git clone https://github.com/nicolasduminil/quarkus-test-case.git
  2. $ cd quarkus-test-case
  3. $ mvn verify
  4. ./run.sh

Three test are executed by mvn verify: an unit, an integration and an e2e one. The first two works as expected, the third one fails with the mentioned exception. The script run.sh executes exactly the same command as the e2e test but using the docker run shell command and, this time, everything works as expected.

So, my conclusion is that the same newman command works when executed via the shell but fails while executed via postman/newman image in testcontainers.

Could anyone please help to fix this issue ?

Many thank in advance.

nicolasduminil commented 1 month ago

Is there anyone concerned down there ?