jpignata/temping

Automate multi-database testing

gregnavis opened this issue · 2 comments

Problem

Currently the test suite uses an in-memory SQLite database. However, the library should be tested against multiple database adapters. The adapters are not functionally equivalent. For instance, while implementing #20, I run into issue where ActiveRecord::ConnectionAdapters::SQLite3Adapter#tables does not list temporary tables while the corresponding methods of the MySQL and PostgreSQL adapters do. That can cause the tests pass for some databases and fail for others.

Solution

We need a way of:

  • setting up the database
  • running the test suite for each adapter
  • running the test suite with a single specified adapter

@kitop, @jpignata what are your thoughts on this?

kitop commented

@grn love the idea.

I think it could be possible to do something based on environment variables, so it's easy to run locally and in the CI server (we're using Travis now).
Maybe we can take some ideas from here: http://docs.travis-ci.com/user/languages/ruby/#Testing-against-multiple-versions-of-dependencies-(Ruby-on-Rails%2C-EventMachine%2C-etc)

What do you think?

I've added multi database testing in Github Actions in the scope of #62 so closing this issue as fixed.