21

Does anybody know of a framework (or methodology) to unit test stored procedures just using SQL and be able to produce a reasonable report as to what has passed and what has failed (something similar to CPPUnit)?

Drew
  • 29,895
  • 7
  • 74
  • 104
Ed Heal
  • 59,252
  • 17
  • 87
  • 127
  • 1
    One would have to assume some sort of data state or precondition, right? Good question. Hopefully, no one answers: do not use SPs. – Kris Krause Oct 05 '11 at 16:09
  • I guess any existing xUnit testing framework would work - you would just have a major setup dependency - the actual test database. – Kris Krause Oct 05 '11 at 16:12

2 Answers2

9

MyTAP will probably be what you are looking for, you can find it in Github

it describes itself as: 'a unit testing framework for MySQL 5.x written using fuctions and procedures. It includes a collection of TAP-emitting assertion functions, as well as the ability to integrate with other TAP-emitting test frameworks.'

MyTAP is now hosted at [https://github.com/hepabolu/mytap][1]

Paul Campbell
  • 1,906
  • 2
  • 12
  • 19
Kevin Burton
  • 11,676
  • 2
  • 24
  • 37
  • Two comments really. 1) the question you refer to is now closed marked off topic, 2) the link you provide to github is broken, returns 404. – pacmaninbw Jun 18 '18 at 16:24
1

Maybe you want to try STK/Unit, which is written in pure SQL and supports the ideas of Test Case and Test Suite. Also, supports expectations. http://stk.wikidot.com/stk-unit

Federico Razzoli
  • 4,901
  • 1
  • 19
  • 21