supercharge / mongodb-github-action

Use MongoDB in GitHub Actions
MIT License
222 stars 46 forks source link

mongodb didn't start #13

Closed fayaz07 closed 4 years ago

fayaz07 commented 4 years ago

Hi, I was trying to implement CI for our repository I used mongodb action provided by you, thanks for that.

But the issue is, the mongodb is not running and the tests failed.

marcuspoehls commented 4 years ago

@fayaz07 Hey Mohammad, can you please help me to debug your situation.

How do you connect to the MongoDB instance in GitHub actions? How does your GitHub action configuration look like?

fayaz07 commented 4 years ago

@marcuspoehls Hi Marcus, thank you for your quick response. I assume this MongoDB action will setup and run the db on port 27017. But when I ran the workflow, that didn't run the db. So I tried to run MongoDB instance as daemon by this command

mongod --fork --logpath /var/log/mongod.log

I have uploaded the error screenshot here, please check it Screenshot from 2020-08-21 16-33-44

marcuspoehls commented 4 years ago

@fayaz07 This actions starts MongoDB in a docker container. MongoDB is then available on localhost:27017.

Is your app not connecting to MongoDB? What errors are you seeing using this MongoDB GitHub action?

fayaz07 commented 4 years ago

It's setting up perfectly no issue with that, but my application is unable to connect to it. It throws timeout exception as the db isn't running

marcuspoehls commented 4 years ago

@fayaz07 Can you please share more details about your application? Is it Node.js with Mongoose?

fayaz07 commented 4 years ago

Node.js rest api mongodb driver - mongoose running tests with mocha

marcuspoehls commented 4 years ago

is it related to https://github.com/supercharge/mongodb-github-action/issues/10? Are you using a replica set in your tests?

fayaz07 commented 4 years ago

no, I guess I am not using them. I can share you the workflow in sometime

fayaz07 commented 4 years ago

Unfortunately I used, replica-sets which was the reason why db didn't start, I removed the replica sets and it fixed the issue. Thanks @marcuspoehls

marcuspoehls commented 4 years ago

@fayaz07 thank you for letting me know that you solved your issue! Good work Mohammad!