O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing the database

Now that we have this procedure we probably want to test it, just like we test our other code. Next to testing whether your SQL is in order, you can also test whether your schema is in order (does table product exist and does it have a price column, for example). This is something that is completely different from MongoDB as it did not have a schema. Testing databases can be a bit difficult. You need test data, maybe, inserted with some seed function, maybe, already present. You do not want to mess up your test data by making changes in your application. You probably need to set up database connections and transactions. It can be a hassle. However, there are some tools that make it a bit easier. pgTap is one of those ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required