-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ preparing TasksManager's interface to be extracted into a common interface
#7884
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
Merged
mergify
merged 45 commits into
ITISFoundation:master
from
GitHK:pr-osparc-long-running-refactor-4
Jul 18, 2025
Merged
Changes from 34 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
52f3e66
moved start_task to TasksManager
9df9acd
refactored to remove job_name and merge unique in task_id
08d397e
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
d8365e8
fixed test
92eb372
reduce log level
835c2a9
refactor
910b47c
fixed issue
e6cbe66
fixed test
c3ab232
fixed warnings
b33189a
using dots as sperators
a4aa0d3
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
d9be27a
fixed specs
77855dd
updated note
01c58db
refactor to use registered task
5ca6450
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
a3a35b5
wired task_start via common interface
216c93a
refactor
0ed5b07
renamed module
6c9cae3
bring back task_name
1d81ced
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
69697c9
fixed broken tests
46b2ff3
updated specs
55bf414
hid internals
cd38439
refactor
bba46c8
refactor
d6885b2
refactor
d61ba00
fixed broken job name
888e10f
fixed validator
c3e7129
fixed broken
53d5791
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
479165b
revert change
1a40721
fixed
8544ee8
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
b916bbc
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
6a38a8b
feedback
cdfe157
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
4ba3509
fixed merge
07c905f
updated specs
c1adab9
Merge remote-tracking branch 'upstream/master' into pr-osparc-long-ru…
d2b21f8
mege conflict edits
066db30
using previous message
ee599ab
Merge branch 'master' into pr-osparc-long-running-refactor-4
mergify[bot] a688579
merge branch 'pr-osparc-long-running-refactor-4' of github.com:GitHK/…
2a76198
updated specs
ca4949d
Merge branch 'master' into pr-osparc-long-running-refactor-4
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
56 changes: 56 additions & 0 deletions
56
packages/models-library/tests/test_api_schemas_long_running_tasks_tasks.py
This file contains hidden or 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,56 @@ | ||
| import pytest | ||
| from models_library.api_schemas_long_running_tasks.tasks import TaskGet | ||
| from pydantic import TypeAdapter | ||
|
|
||
|
|
||
| def _get_data_withut_task_name(task_id: str) -> dict: | ||
GitHK marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return { | ||
| "task_id": task_id, | ||
| "status_href": "", | ||
| "result_href": "", | ||
| "abort_href": "", | ||
| } | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "data, expected_task_name", | ||
| [ | ||
| (_get_data_withut_task_name("a.b.c.d"), "b"), | ||
| (_get_data_withut_task_name("a.b.c"), "b"), | ||
| (_get_data_withut_task_name("a.b"), "b"), | ||
| (_get_data_withut_task_name("a"), ""), | ||
| ], | ||
| ) | ||
| def test_try_extract_task_name(data: dict, expected_task_name: str) -> None: | ||
| task_get = TaskGet(**data) | ||
| assert task_get.task_name == expected_task_name | ||
|
|
||
| task_get = TypeAdapter(TaskGet).validate_python(data) | ||
| assert task_get.task_name == expected_task_name | ||
|
|
||
|
|
||
| def _get_data_with_task_name(task_id: str, task_name: str) -> dict: | ||
| return { | ||
| "task_id": task_id, | ||
| "task_name": task_name, | ||
| "status_href": "", | ||
| "result_href": "", | ||
| "abort_href": "", | ||
| } | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "data, expected_task_name", | ||
| [ | ||
| (_get_data_with_task_name("a.b.c.d", "a_name"), "a_name"), | ||
| (_get_data_with_task_name("a.b.c", "a_name"), "a_name"), | ||
| (_get_data_with_task_name("a.b", "a_name"), "a_name"), | ||
| (_get_data_with_task_name("a", "a_name"), "a_name"), | ||
| ], | ||
| ) | ||
| def test_task_name_is_provided(data: dict, expected_task_name: str) -> None: | ||
| task_get = TaskGet(**data) | ||
| assert task_get.task_name == expected_task_name | ||
|
|
||
| task_get = TypeAdapter(TaskGet).validate_python(data) | ||
| assert task_get.task_name == expected_task_name | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
41 changes: 0 additions & 41 deletions
41
packages/service-library/src/servicelib/long_running_tasks/http_endpoint_responses.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.