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

create new dist option 'loadgroup' #637

Closed

Conversation

dohyeop-sub
Copy link
Contributor

@dohyeop-sub dohyeop-sub commented Mar 15, 2021

Intro

There are currently several options for distributing tests,
but there is still no suitable option for the following cases:

Case 1

In this case, it is efficient to divide all tests into different sessions.

@pytest.mark.parametrize('param', [A, B, C, D])
def test_something_heavy(param):
    do_something_heavy_test

Case 2

In this case, it is efficient to run all tests in the same session.

def test_something_light_1(heavy_fixture_cannot_filelock):
    do_something_light_test

def test_something_light_2(heavy_fixture_cannot_filelock):
    do_something_light_test

def test_something_light_3(heavy_fixture_cannot_filelock):
    do_something_light_test

Limit

If you use the loadscope option, all tests in Case 1 are performed in same session,
If the load option is used, all tests of Case 2 may be performed in different sessions.

Suggestion

Use the following xgroup mark and specify the name through the parameter.
Then, tests with the same name are executed in the same session.

@pytest.mark.xgroup(name="same_session")
def test_something_light_1(heavy_fixture_cannot_filelock):
    do_something_light_test

@pytest.mark.xgroup(name="same_session")
def test_something_light_2(heavy_fixture_cannot_filelock):
    do_something_light_test

@pytest.mark.xgroup(name="same_session")
def test_something_light_3(heavy_fixture_cannot_filelock):
    do_something_light_test

Comment

This PR is to make sure that the addition of a feature does not conflict with other features,
If you are okay with adding features, related tests will be implemented.

@dohyeop-sub dohyeop-sub force-pushed the feature/dist_loadgroup branch 4 times, most recently from a072a72 to 17e0ec2 Compare March 20, 2021 15:31
@dohyeop-sub dohyeop-sub force-pushed the feature/dist_loadgroup branch from 17e0ec2 to 7cd702f Compare March 20, 2021 15:34
@nicoddemus
Copy link
Member

Hi @dohyeop-sub,

Sorry seems I have missed this PR completely!

The feature is certainly interesting, and the PR seems actually near complete; you mention "If you are okay with adding features, related tests will be implemented", but seems like tests have been added already.

Would you like to finish it up?

@dohyeop-sub
Copy link
Contributor Author

Hi @dohyeop-sub,

Sorry seems I have missed this PR completely!

The feature is certainly interesting, and the PR seems actually near complete; you mention "If you are okay with adding features, related tests will be implemented", but seems like tests have been added already.

Would you like to finish it up?

I'll finish it. I will be using a different account, so I will post a new PR with that account.

@dohyeop-sub
Copy link
Contributor Author

Hi @nicoddemus, I created a new PR. #733.
Thank you.

@nicoddemus
Copy link
Member

Closing in favor of #733.

@nicoddemus nicoddemus closed this Nov 28, 2021
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.

2 participants