-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1061 from bluetech/scheduling-proto
Add a Scheduling Protocol
- Loading branch information
Showing
6 changed files
with
72 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Protocol | ||
from typing import Sequence | ||
|
||
from xdist.workermanage import WorkerController | ||
|
||
|
||
class Scheduling(Protocol): | ||
@property | ||
def nodes(self) -> list[WorkerController]: ... | ||
|
||
@property | ||
def collection_is_completed(self) -> bool: ... | ||
|
||
@property | ||
def tests_finished(self) -> bool: ... | ||
|
||
@property | ||
def has_pending(self) -> bool: ... | ||
|
||
def add_node(self, node: WorkerController) -> None: ... | ||
|
||
def add_node_collection( | ||
self, | ||
node: WorkerController, | ||
collection: Sequence[str], | ||
) -> None: ... | ||
|
||
def mark_test_complete( | ||
self, | ||
node: WorkerController, | ||
item_index: int, | ||
duration: float = 0, | ||
) -> None: ... | ||
|
||
def mark_test_pending(self, item: str) -> None: ... | ||
|
||
def remove_pending_tests_from_node( | ||
self, | ||
node: WorkerController, | ||
indices: Sequence[int], | ||
) -> None: ... | ||
|
||
def remove_node(self, node: WorkerController) -> str | None: ... | ||
|
||
def schedule(self) -> None: ... |