Hi All - When I am running Newman on Jenkins on a Linux container, I am getting newman not found. I tried to login to container and able to run newman on Linux container and it worked fine.
However only from Jenkins I am getting the issue. On the VM also its working fine.
I tried setting up the Global variable in jenkins, but it didnāt worked.
Then I tried with complete path and changing the directory to newman. But still same issue is there.
Please review and let me know if I am missing anything.
Here is the Shell script in Jenkins Build section:-
cd /usr/local/bin/node-v12.3.1-linux-x64/lib/node_modules/newman/bin
newman run SCTSTSanityTest.postman_collection.json -e StarGate.postman_environment.json -r htmlextra --reporter-htmlextra-export reports/Newman_Test_Execution_Report.html --insecure
/tmp/jenkins5182203141296605953.sh: 9: /tmp/jenkins5182203141296605953.sh: newman: not found
Hi @aaggar1 , sorry to hear youāre having some difficulties. Can you please check out these guidelines on how to ask questions here on the forum? A clear question will go a long way to getting your problem solved, even just for readabilityās sake.
Iāve also moved your post here to the Open Technologies category, as it is a request for help about open source.
To handle [/usr/bin/env: node: No such file or directory error
I updated my dockerfile with RUN ln -s /usr/local/bin/node-v12.3.1-linux-x64/bin/node /usr/bin/node to point to node to bin.
Probably a stupid suggestion, but can you try the environments as --environment instead of -e?
Also, in your dockerfile, if youāre already using a different base image, it might be difficult for you to use the newman docker image. But I just found that dockerfiles can now have multistage builds, so you can have multiple froms - Use multi-stage builds | Docker Documentation. Using the newman image directly, should definitely be cleaner
Let me know if any of this helps. Apologies for such a late response!