Use MongoDB in Azure DevOps Pipeline CI

MongoDB is installed but must be started manually:

systemctl status mongod yields

● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://docs.mongodb.org/manual

Add a sudo systemctl start mongod step before the tests:

- script: mongod --version
- script: sudo systemctl start mongod
- script: test command (e.g. pytest, tox...)

MongoDB is then available, running on default port.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top