Skip to content

Commit 28a440f

Browse files
Merge branch 'master' into add-distributed-task-queue
2 parents ec4bb00 + 8688f10 commit 28a440f

File tree

5 files changed

+36
-19
lines changed

5 files changed

+36
-19
lines changed

packages/pytest-simcore/src/pytest_simcore/services_api_mocks_for_aiohttp_clients.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def create_computation_cb(url, **kwargs) -> CallbackResult:
9393
"62237c33-8d6c-4709-aa92-c3cf693dd6d2",
9494
"0bdf824f-57cb-4e38-949e-fd12c184f000",
9595
]
96-
node_states[node_id] = {"state": {"modified": True, "dependencies": []}}
96+
node_states[node_id] = {"modified": True, "dependencies": []}
9797
node_states["62237c33-8d6c-4709-aa92-c3cf693dd6d2"] = {
9898
"modified": True,
9999
"dependencies": ["2f493631-30b4-4ad8-90f2-a74e4b46fe73"],
@@ -105,10 +105,15 @@ def create_computation_cb(url, **kwargs) -> CallbackResult:
105105
"62237c33-8d6c-4709-aa92-c3cf693dd6d2",
106106
],
107107
}
108-
returned_computation = ComputationTask.model_validate(
109-
ComputationTask.model_config["json_schema_extra"]["examples"][0]
110-
).model_copy(
111-
update={
108+
109+
json_schema = ComputationTask.model_json_schema()
110+
assert isinstance(json_schema["examples"], list)
111+
assert isinstance(
112+
json_schema["examples"][0], dict
113+
)
114+
computation: dict[str, Any] = json_schema["examples"][0].copy()
115+
computation.update(
116+
{
112117
"id": f"{kwargs['json']['project_id']}",
113118
"state": state,
114119
"pipeline_details": {
@@ -118,6 +123,10 @@ def create_computation_cb(url, **kwargs) -> CallbackResult:
118123
},
119124
}
120125
)
126+
returned_computation = ComputationTask.model_validate(
127+
computation
128+
)
129+
121130
return CallbackResult(
122131
status=201,
123132
# NOTE: aioresponses uses json.dump which does NOT encode serialization of UUIDs
@@ -129,15 +138,20 @@ def get_computation_cb(url, **kwargs) -> CallbackResult:
129138
state = RunningState.NOT_STARTED
130139
pipeline: dict[str, list[str]] = FULL_PROJECT_PIPELINE_ADJACENCY
131140
node_states = FULL_PROJECT_NODE_STATES
132-
assert "json_schema_extra" in ComputationGet.model_config
133-
assert isinstance(ComputationGet.model_config["json_schema_extra"], dict)
141+
142+
json_schema = ComputationGet.model_json_schema()
134143
assert isinstance(
135-
ComputationGet.model_config["json_schema_extra"]["examples"], list
144+
json_schema["examples"], list
136145
)
137-
returned_computation = ComputationGet.model_validate(
138-
ComputationGet.model_config["json_schema_extra"]["examples"][0]
139-
).model_copy(
140-
update={
146+
assert isinstance(
147+
json_schema["examples"][0], dict
148+
)
149+
150+
computation: dict[str, Any] = json_schema[
151+
"examples"
152+
][0].copy()
153+
computation.update(
154+
{
141155
"id": Path(url.path).name,
142156
"state": state,
143157
"pipeline_details": {
@@ -147,6 +161,7 @@ def get_computation_cb(url, **kwargs) -> CallbackResult:
147161
},
148162
}
149163
)
164+
returned_computation = ComputationGet.model_validate(computation)
150165

151166
return CallbackResult(
152167
status=200,

services/static-webserver/client/source/class/osparc/desktop/credits/CreditsIndicatorButton.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ qx.Class.define("osparc.desktop.credits.CreditsIndicatorButton", {
8484
},
8585

8686
__handleOutsideEvent: function(event) {
87-
const offset = 30;
88-
if (
89-
!osparc.utils.Utils.isMouseOnElement(this.__creditsContainer, event, offset) &&
90-
!osparc.utils.Utils.isMouseOnElement(this, event, offset)
91-
) {
87+
const offset = 0;
88+
const onContainer = osparc.utils.Utils.isMouseOnElement(this.__creditsContainer, event, offset);
89+
const onButton = osparc.utils.Utils.isMouseOnElement(this, event, offset);
90+
if (!onContainer && !onButton) {
9291
this.__hideCreditsContainer();
9392
}
9493
},

services/static-webserver/client/source/class/osparc/desktop/credits/CreditsPerService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ qx.Class.define("osparc.desktop.credits.CreditsPerService", {
9090
});
9191
} else {
9292
const nothingFound = new qx.ui.basic.Label(this.tr("No usage found")).set({
93-
font: "text-14"
93+
font: "text-14",
94+
padding: 20,
9495
});
9596
this._add(nothingFound);
9697
}

services/static-webserver/client/source/class/osparc/desktop/credits/CreditsSummary.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ qx.Class.define("osparc.desktop.credits.CreditsSummary", {
2727
appearance: "floating-menu",
2828
padding: 8,
2929
maxWidth: this.self().WIDTH,
30+
minHeight: 150,
3031
zIndex: osparc.utils.Utils.FLOATING_Z_INDEX,
3132
});
3233
osparc.utils.Utils.setIdToWidget(this, "creditsSummary");

services/web/server/tests/unit/with_dbs/01/test_director_v2_handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ async def test_start_partial_computation(
5858
project_id: ProjectID,
5959
user_role: UserRole,
6060
expected: ExpectedResponse,
61+
faker: Faker,
6162
):
6263
assert client.app
6364

6465
url = client.app.router["start_computation"].url_for(project_id=f"{project_id}")
6566
rsp = await client.post(
66-
f"{url}", json={"subgraph": ["node_id1", "node_id2", "node_id498"]}
67+
f"{url}", json={"subgraph": [faker.uuid4(), faker.uuid4(), faker.uuid4()]}
6768
)
6869
data, error = await assert_status(
6970
rsp,

0 commit comments

Comments
 (0)