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

xdist disable suffix #98

Closed
wants to merge 5 commits into from
Closed

Conversation

lestatcheb
Copy link

need if we want to use only one database for xdist

@lestatcheb
Copy link
Author

any news for this pull request?

@pelme
Copy link
Member

pelme commented Jun 18, 2014

Can you explain why this is needed? It seems to be that this will use the same database name for all xdist-processes - how would that be useful?

I am a bit skeptical about putting it in the Django settings, I think it would be better to have a pytest command line option or setting in pytest.ini for it.

@pelme
Copy link
Member

pelme commented Jun 18, 2014

Also: Before merging this there needs to be a test for it in https://github.com/pelme/pytest_django/blob/master/tests/test_db_setup.py.

@lestatcheb
Copy link
Author

It useful when you want use pytest-django with some external database (which use other people) and only with reuse-db option.
We use this for integration tests (instead of selenium) which go to network (instead of fixtures) and create some new data always in one external database.

I rewrote code to command line option and added test for 'gw' prefix.
lestatcheb@fa4b6e9

Review please

@lestatcheb
Copy link
Author

Any news, guys?

@pelme
Copy link
Member

pelme commented Jul 10, 2014

@lestatcheb Thanks for the effort you have put into this.

However, I would like to finalize my work in the fixturefix branch. It will make configuration of the test database name trivial in any project, by just providing a custom fixture that does the database mangling. In this case that fixture would not really do anything, so it should be very straightforward. This issue will certainly be an example in the documentation.

See my comment in #128 for some more details about my plans. There will be more updates on this development after EuroPython.

To understand what you are trying to achieve a bit more: Are you having a single database and only do read only queries against it for all tests? What you are doing is probably not working 100 % reliable if you have any write queries unless there is something that I miss.

Again, thanks for working on this!

@lestatcheb
Copy link
Author

Ok, thanks you for great project :)
I'll wait for fixturefix branch.

No, we have a single database with read and write queries.
Ok, I tell more details.
We have dev environment, which contains:

  1. One postgresql database
  2. Many dev servers for testing new branches.
    Each dev server use one database which I mentioned above.
    Each server have gunicorns, nginx, etc.

We have some api which used by other services in dev.
Also we need to test some external api which we use by own.

So, if we need to test all these api we must use one database with reuse-db.
External api tests are very long (each test about 1-3 minutes), so we need to parallel them.
Here we need to run all our tests with xdist plugin, but we want use the same postgresql database for all tests.
These tests are like integration tests for testing all services we use.
We don't want to use selenium tests with browser, it is enough just to test api.

@blueyed
Copy link
Contributor

blueyed commented Jun 17, 2016

Should this be closed in favor of #336?

pelme added a commit to pelme/pytest-django that referenced this pull request Jul 3, 2016
@pelme
Copy link
Member

pelme commented Nov 6, 2016

this is fixed in pytest 3.0, see the documentation and raise new issues/PRs if needed!

@pelme pelme closed this Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants