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

Test databases are created in an inconsistent order #255

Closed
tarkatronic opened this issue Jan 6, 2016 · 4 comments
Closed

Test databases are created in an inconsistent order #255

tarkatronic opened this issue Jan 6, 2016 · 4 comments
Labels

Comments

@tarkatronic
Copy link

With the django-nose test runner, I'm unable to specify the order that my databases are created in, causing all of my tests to randomly fail when they are created out of order, due to tables not existing. With the default Django test runner, the default database is always created first, and you are able to specify dependencies for others, as seen here: https://docs.djangoproject.com/en/1.9/topics/testing/advanced/#controlling-creation-order-for-test-databases

This is all handled by the dependency_ordered() method in django/test/runner.py (https://github.com/django/django/blob/master/django/test/runner.py#L555). Is there any chance of using this same solution in the NoseTestSuiteRunner?

@jwhitlock jwhitlock added the bug label Jan 8, 2016
@jwhitlock
Copy link
Contributor

django-nose was written back Django 1.2 days. I think there's quite a bit of work to sync our runner with the current maturity of the Django test runner.

@tarkatronic
Copy link
Author

If I were to take a stab at fixing this particular problem, would it be acceptable to just call dependency_ordered() in the Django test runner code, or should that functionality be vendored into this runner?

@jwhitlock
Copy link
Contributor

I'd try to mirror when Django calls dependency_ordered(), and look and see how that has changed across the currently supported versions. We should be mirroring the Django logic as closely as possible, and patching in nose logic where needed.

@tarkatronic
Copy link
Author

After a lot of digging, this appears to be an extreme corner case in my own setup, caused by a very specific misconfiguration of sorts.

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

No branches or pull requests

2 participants