Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Use an actual database in our processors tests #526

Closed
vitorbaptista opened this issue Oct 25, 2016 · 1 comment
Closed

Use an actual database in our processors tests #526

vitorbaptista opened this issue Oct 25, 2016 · 1 comment
Assignees
Labels

Comments

@vitorbaptista
Copy link
Contributor

In some places we're mocking the DB (https://github.com/opentrials/processors/blob/917a231e5b6e55c59418ad254102d78a63449cb2/tests/processors/base/writers/test_source.py#L50-L55), in others we're using an in-memory SQLite db (https://github.com/opentrials/processors/blob/917a231e5b6e55c59418ad254102d78a63449cb2/tests/processors/base/writers/test_document.py#L139-L162). Neither is ideal, and it hurts our ability to write proper tests. There're a few challenges to fix it, though.

The processors depend on the API database and the warehouse database, both of which aren't defined in the processors repository, so we don't have access to their migrations. We can merge the collectors and processors in a single repository to make it more manageable, but we would still have to deal with the API database (and we can't merge that).

As an initial step, we could extract a schema dump of both DBs to the processors and use that to generate our test DB.

@georgiana-b georgiana-b self-assigned this Nov 9, 2016
vitorbaptista pushed a commit to opentrials/processors that referenced this issue Dec 6, 2016
* [#526] Create PostgreSQL connection for tests

opentrials/opentrials#526

* Small fix in file writer

* [#526] Dump, keep and restore databases schema

opentrials/opentrials#526

* [#526] Refactor tests for the new setup and add some more

opentrials/opentrials#526

* [#526] Make Travis restore databases before running tests

opentrials/opentrials#526

* [#526] Add test databases configuration to travis yaml

opentrials/opentrials#526
@georgiana-b
Copy link
Contributor

Closed via opentrials/processors#87

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants