Postman CLI - Bitbucket pipeline sadness

Hello!
I’ve been trying to get Postman CLI to work in a bitbucket pipeline all day. It is working so much as running the tests and summarising at the end but it looks like it is failing to fail or timing out i think contacting postman CLI cloud at the end.
Has anyone else had any experience with this?

Thank you in advance

2 Likes

What do you exactly mean by this?


  • Can you see the cmd output?
  • Are the tests actually running?
  • Could it be that he’s stuck on a specific endpoint, which has an open connection?
  • Is there an infinite loop in your script by any chance?
  • There isn’t a massive sleep in your script right? XD

Besides those questions, BitBucket often had issues with timeouts or long-lasting pipelines.
=> https://jira.atlassian.com/browse/BCLOUD-13491

I just had a build run 2x for 120 minutes when I know it was hung after 10 minutes and should have failed the build then. I run deploy scripts that interact with the servers I deploy to. Sometimes issues happen and the build hangs. I can’t spend 2 hours waiting to find out that a build is in a bad state.

1 Like

I’m gonna try and run it locally to see if I get any actual errors.
Yes the tests are running it has a summary box at the end and its just continuing to run after that when it should have finished.
As I said I think its timing out/taking a really long time to contact Postman CLI as some have actually worked and there is a little output at the end to say something about Postman CLI cloud and I can see them in the run in postman on the specific collection but there are lots of gaps between build numbers which also suggests that is probably where it is failing.

My script is pretty much a straight copy from the output the Run collection > Automate runs via CLI >Run on CI/CD> configure command outputs:
mage: atlassian/default-image:3

pipelines:
default:
- step:
name: Setup Postman CLI & Run Collection
script:
# Install Postman CLI
- curl -o- “https://dl-cli.pstmn.io/install/linux64.sh” | sh
# Login using your API Key
- postman login --with-api-key $POSTMAN_API_KEY
# Run your collection using Postman CLI
- postman collection run “Idgoeshere” -e “idgoeshereremovedcossecretshh”

Thanks for the time out thing that looks like it will be useful. I think i’ll try that next.
Do you think I should raise a bug to postman?

1 Like

Wanted to say thank you. I added the timeout you linked and it is working properly now! thank you so much for your help <3

2 Likes

This topic was automatically closed after 730 days. New replies are no longer allowed.