go-xorm / xorm

Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
BSD 3-Clause "New" or "Revised" License
6.66k stars 757 forks source link

Mocking XORM #1276

Open happilymarrieddad opened 5 years ago

happilymarrieddad commented 5 years ago

Is there a mocking library that works well with XORM. I've been trying to get gopkg.in/DATA-DOG/go-sqlmock.v1 to work but it's such a hassle to even get it running. When I try to mock complicated queries it just blows up and it's saying the sql string doesn't match despite it matching... Basically, I'm wondering what other people are doing to test without actually having to spin up a test database. That just seems wrong. Thanks!

lunny commented 5 years ago

Gitea are using xorm and use gopkg.in/testfixtures.v2 to do the unit tests. Maybe that will help you.