Search code examples
sqloracle-databasetfscontinuous-integrationbuild-definition

Oracle/SQL Query in the TFS Build Definition


I would like to introduce CI Testing in one of my Webservice project with Newman. So once the build is ready, the cmd newman script will be executed for the validation.

My main objective here is to compare the DB values (SQL/Oracle) with the JSON Response body. Currently I am exporting the DB Query results to a CSV file and validating the same against the JSON response via Postman.

My Question is,

  1. Is there any way we can create a cmd build definition in TFS for exporting the query result to a specified folder in a CSV format. (A command to export Oracle/SQL query to csv would be fine)

  2. Can you please suggest me any other possible way to do it in an automated way to generate a CSV file from DB and add this in the build definition before the newman tool initiation. (Like VB Script file added into the build definition)

Thanks much in advance.


Solution

  • You could still use NewMan PostMan in TFS build pipeline.

    If you are working on TFS2017 and above, you could directly use this 3-rd party extension-- Newman the cli Companion for Postman

    enter image description here

    If you are working on TFS2015, it's also easy to invoke newman tool in vNext build. You only need to add two build steps: npm and Command Line:

    enter image description here

    enter image description here

    More detail steps please take a look at this blog: Postman – Continuous Integration with TFS/VNext Builds