Skip to content

Retain input ordering in loadscope (Rebase code for #1098) #1217

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

darwintree
Copy link

@darwintree darwintree commented Jun 12, 2025

This is a pull request coming from #1098 to enable the possibility to merge.
This pull request rebase the original changes to the latest master branch commit.

I'm not the original author but would be willing to help improve the code if there is any comments

Closes #1098


Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Make sure to include reasonable tests for your change if necessary

  • We use towncrier for changelog management, so please add a news file into the changelog folder following these guidelines:

    • Name it $issue_id.$type for example 588.bugfix;

    • If you don't have an issue_id change it to the PR id after creating it

    • Ensure type is one of removal, feature, bugfix, vendor, doc or trivial

    • Make sure to use full sentences with correct case and punctuation, for example:

      Fix issue with non-ascii contents in doctest text files.
      

Toad2186 and others added 2 commits June 12, 2025 17:44
* Optionally retain input ordering in loadscope for tests where relative
  ordering matters. i.e. guarantee that, given [input_1, input_2],
  input_2 never runs before input_1. On any given worker, either input_
  has ran before input_2, or input_1 has never and will never run on
  this worker.
@darwintree darwintree changed the title Toan/loadscope retain ordering Retain input ordering in loadscope (Rebase code for #1098) Jun 12, 2025
@darwintree
Copy link
Author

@RonnyPfannschmidt

@@ -127,6 +127,17 @@ def pytest_addoption(parser: pytest.Parser) -> None:
"(default) no: Run tests inprocess, don't distribute."
),
)
group.addoption(
"--no-loadscope-reorder",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If particularly find negative options like this confusing. How about we change it to --loadscope-reorder and default it to True?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original specification might be more canonical.
I found some discussions on the flag name: https://stackoverflow.com/a/15008806/14223776.
However the dest variable naming could be improved. Will modify later

@@ -0,0 +1 @@
With `--no-loadscope-reorder`, retain input ordering in loadscope for tests where relative ordering matters. i.e. guarantee that, given [input_1, input_2],input_2 never runs before input_1. On any given worker, either input_1 has ran before input_2, or input_1 has never and will never run on this worker. This only applies when using `loadscope`.
Copy link
Member

@nicoddemus nicoddemus Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entry attempts to explain the feature in detail, which is great, however I find the explanation confusing: what are input_1 and input_2 exactly? Note that using multiple paragraphs is OK.

Also, it should use double backticks to denote code (this is RST).

While the change is simple, it is a new feature (it adds a new command-line flag), so it should be renamed to 1083.improvement.rst. 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@RonnyPfannschmidt
Copy link
Member

Im not quite sure how to take this

I haven't been able to review the original pr which is part of why the original pr hasn't been rebased

I won't magically be able to review a rebase

@nicoddemus
Copy link
Member

@RonnyPfannschmidt, that's a fair point.

From my perspective, the PR is relatively small. Do you have any concerns about the functionality or implementation that make you want to take more time to evaluate it further?

@RonnyPfannschmidt
Copy link
Member

Im perhaps paranoid about order details

The code is dealing with the wrong id types

@darwintree
Copy link
Author

Im perhaps paranoid about order details

The code is dealing with the wrong id types

Would you specify what does "wrong id types" mean? Would be glad to resolve the issue

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.

4 participants