2 ms·
This is super nice! I have seen similar solutions for Python in the past, but having an easy API + Docker makes this generic and language agnostics. Have you l
by miohtama 6y ago
This is super nice! I have seen similar solutions for Python in the past, but having an easy API + Docker makes this generic and language agnostics.
Have you looked to tweak PSQL parameters to make it faster for test runs e.g. by disabling disk writes?
- majodev 6y agoYep, disabling fsync, synchronous_commit and full_page_writes ONLY for this PostgreSQL integration testing strategy gives us an additional boost of ~35% in overall testing speed. https://github.com/allaboutapps/go-starter/blob/master/docker-compose.yml#L69 https://github.com/allaboutapps/go-starter/blob/master/docke... Regarding being language agnostic: YES, clients for languages other than go are very welcome. The integresql server actually provides a trivial RESTful JSON api and should be fairly easy to integrate with any language. This is our second iteration regarding this PostgreSQL test strategy, the last version came embedded with our legacy Node.js backend stack and wasn't able to handle tests in parallel, which became an additional hard requirement for us. See our go-starter project for infos on how we are using integresql, e.g. our WithTestDatabase/WithTestServer utility function we use in all tests to "inject" the specific database: https://github.com/allaboutapps/go-starter/blob/master/internal/test/testing.go#L39 https://github.com/allaboutapps/go-starter/blob/master/inter...