I'm struggling to get my integration tests running...
# seed
s
I'm struggling to get my integration tests running in the after_deploy hook with Seed. I keep getting error
ERROR: /bin/sh: 1: newman: not found
- I'm trying to navigate to my integration test file path and then run newman command. I have newman as dev dependancy and I've tried installing in a hook as well. What's the recommended way to trigger integration tests in after_deploy hook for seed?
Copy code
after_deploy:
  - cd backend/test/integration/collections
  - newman run test.postman_collection.json
f
Hey @Sam Frampton, do you have
newman
installed? Can you try this:
Copy code
after_deploy:
  - npm install -g newman
  - cd backend/test/integration/collections
  - newman run test.postman_collection.json
s
Hey @Frank thanks for your reply - I think I'm missing something from syntax as I've echo out file path and I'm still at route after attempting to cd into sub folders.
f
ah each command runs in it’s own shell environment, so you’d need to chain the cd and the command, like this:
Copy code
after_deploy:
  - npm install -g newman
  - cd backend/test/integration/collections && newman run test.postman_collection.json
s
Ah nice! That did the job 🙏
Thanks @Frank