Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements in the DatabaseCleaner #1246

Merged
merged 2 commits into from Jan 17, 2017
Merged

Conversation

Ana06
Copy link
Member

@Ana06 Ana06 commented Jan 12, 2017

Move all what is related to the DatabaseCleaner to the database_cleaner.rb file. Load the seeds only when they have been deleted and not before every test.

Move all what is related to the DatabaseCleaner to the
database_cleaner.rb file. Load the seeds only when they have been
deleted and not before every test.
@ChrisBr
Copy link
Member

ChrisBr commented Jan 17, 2017

LGTM

@ChrisBr ChrisBr merged commit 4a75546 into openSUSE:master Jan 17, 2017
@hennevogel
Copy link
Member

truncation != transaction

@Ana06
Copy link
Member Author

Ana06 commented Jan 17, 2017

@hennevogel I know it, but it happens something strange, after truncating the database and loading the seeds and before the first test is executed some data is introduced in the database. I have no idea of where this data comes from.

So this strange data keeps there until a truncation is executed (after a feature). If a test query the information in the tables where strange data is introduced (for example User and Conference) before they are truncated it fails.

I added some puts here that illustrate what happens:

https://travis-ci.org/Ana06/osem/builds/191338450

This only happens in Travis, locally it works.

So the second commit (to truncate the database before each test) is just a quick solution until we find out why is this happening. Because otherwise merging the opened PR seems no to be much safe.

@Ana06 Ana06 deleted the db_cleaning branch April 1, 2019 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants