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

pydantic2 migration made integration tests green #6719

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cdd69d9
fixed integration tests for simcore-sdk
Nov 14, 2024
cd6db0b
added missing dependency
Nov 14, 2024
10b28a7
fixed prod.txt
Nov 14, 2024
941039c
fixed library name
Nov 14, 2024
ffb95f1
fixed broken validator
Nov 14, 2024
17798cc
fixed broken tests
Nov 14, 2024
f3bf668
disable opentelementry for testing stacks
Nov 14, 2024
732d5f9
fixed conftest
Nov 14, 2024
657075c
fixed broken test
Nov 14, 2024
d0ba06a
refactor
Nov 14, 2024
71f10c5
fixed integration tests for osparc-gateway-server
Nov 14, 2024
7b3c820
refactor
Nov 14, 2024
ff307d6
Merge remote-tracking branch 'upstream/pydantic_v2_migration_do_not_s…
Nov 14, 2024
838bc84
added missing imports
Nov 14, 2024
4b8dc22
fix url
giancarloromeo Nov 14, 2024
8a22850
fixed pydanticv1 issue
Nov 14, 2024
88d43e4
fixed test
Nov 14, 2024
5c7fc53
Merge branch 'pr-osparc-pydantic2-integration-libraries2' of github.c…
Nov 14, 2024
964b515
fixed routes
Nov 14, 2024
dbc9f5b
fixed patch
Nov 14, 2024
9efe3b9
fixed union parsing
Nov 14, 2024
e283d7e
remove assert
Nov 14, 2024
06071a6
aiodocker format
Nov 14, 2024
a34dfdd
fix url type
giancarloromeo Nov 14, 2024
ba57a0e
fix urls
giancarloromeo Nov 14, 2024
1914139
deprecating legacy url
Nov 15, 2024
777b469
Merge branch 'pr-osparc-pydantic2-integration-libraries2' of github.c…
Nov 15, 2024
188f97c
removed LegacyUrl
Nov 15, 2024
a66bc5e
using newer version
Nov 15, 2024
3bcd09e
fixed broken test
Nov 15, 2024
2daf0ca
bump service version
Nov 15, 2024
d48271c
Merge remote-tracking branch 'upstream/pydantic_v2_migration_do_not_s…
Nov 15, 2024
ddaa28b
fixed typing
Nov 15, 2024
48c0058
bumped service versions
Nov 15, 2024
2558636
fixed typing warnings
Nov 15, 2024
871c27b
added missing packages
Nov 15, 2024
e2fc69b
fixed missing package
Nov 15, 2024
00f906b
attempt to avoid flaky test
Nov 15, 2024
b968a23
refactor and migrated to yarl
Nov 15, 2024
30dab5e
pylint
Nov 15, 2024
08f3c52
revert flaky test
Nov 15, 2024
3cb8af8
added missing
Nov 15, 2024
a7a3257
Merge remote-tracking branch 'upstream/pydantic_v2_migration_do_not_s…
Nov 18, 2024
8e6175d
reverting
Nov 18, 2024
6bdc21a
renaming
Nov 18, 2024
d34318d
service owner is None by default if not found
Nov 18, 2024
c30b583
fixed warnings in tests
Nov 18, 2024
8ce43ab
revert
Nov 18, 2024
0e52fdd
pylint
Nov 18, 2024
e2fe840
pylint
Nov 18, 2024
ac299de
mypy fixes adding access_rights
Nov 18, 2024
f75fb75
fixed broken tests
Nov 18, 2024
819cee6
updated description
Nov 18, 2024
c369d3e
Merge remote-tracking branch 'upstream/pydantic_v2_migration_do_not_s…
Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ class ServiceUpdate(ServiceMetaDataEditable, ServiceAccessRights):
class ServiceGet(
ServiceMetaDataPublished, ServiceAccessRights, ServiceMetaDataEditable
): # pylint: disable=too-many-ancestors
owner: LowerCaseEmailStr | None = Field(
None,
description="None when the owner email cannot be found in the database",
GitHK marked this conversation as resolved.
Show resolved Hide resolved
)
owner: LowerCaseEmailStr | None

model_config = ConfigDict(
extra="ignore",
Expand Down
4 changes: 2 additions & 2 deletions packages/pytest-simcore/src/pytest_simcore/docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def testing_environ_vars(env_devel_file: Path) -> EnvVarsDict:

# ensure OpenTelemetry is not enabled
env_devel |= {
x: "null"
for x in (
tracing_setting: "null"
for tracing_setting in (
"AGENT_TRACING",
GitHK marked this conversation as resolved.
Show resolved Hide resolved
"API_SERVER_TRACING",
"AUTOSCALING_TRACING",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Union

from fastapi.encoders import jsonable_encoder
from fastapi.exceptions import RequestValidationError
from fastapi.openapi.constants import REF_PREFIX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import warnings
from enum import Enum
from pathlib import Path
from typing import Annotated

from models_library.basic_types import BootModeEnum, PortInt
from models_library.docker import DockerPlacementConstraint
Expand Down Expand Up @@ -104,12 +105,17 @@ class DynamicSidecarSettings(BaseCustomSettings, MixinLoggingSettings):
),
description="dynamic-sidecar's service 'endpoint_spec' with {'Mode': 'dnsrr'}",
)
DYNAMIC_SIDECAR_SC_BOOT_MODE: BootModeEnum = Field(
...,
description="Boot mode used for the dynamic-sidecar services"
"By defaults, it uses the same boot mode set for the director-v2",
validation_alias=AliasChoices("DYNAMIC_SIDECAR_SC_BOOT_MODE", "SC_BOOT_MODE"),
)
DYNAMIC_SIDECAR_SC_BOOT_MODE: Annotated[
BootModeEnum,
Field(
...,
description="Boot mode used for the dynamic-sidecar services"
"By defaults, it uses the same boot mode set for the director-v2",
validation_alias=AliasChoices(
"DYNAMIC_SIDECAR_SC_BOOT_MODE", "SC_BOOT_MODE"
),
),
]

DYNAMIC_SIDECAR_LOG_LEVEL: str = Field(
"WARNING",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import datetime
from functools import cached_property
from typing import Annotated

from common_library.pydantic_validators import validate_numeric_string_as_timedelta
from models_library.basic_types import LogLevel, PortInt, VersionTag
Expand Down Expand Up @@ -194,28 +195,29 @@ class AppSettings(BaseApplicationSettings, MixinLoggingSettings):
)

# App modules settings ---------------------
DIRECTOR_V2_STORAGE: StorageSettings = Field(
json_schema_extra={"auto_default_from_env": True}
)
DIRECTOR_V2_STORAGE: Annotated[
StorageSettings, Field(json_schema_extra={"auto_default_from_env": True})
]
DIRECTOR_V2_NODE_PORTS_STORAGE_AUTH: StorageAuthSettings | None = Field(
json_schema_extra={"auto_default_from_env": True}
)

DIRECTOR_V2_CATALOG: CatalogSettings | None = Field(
json_schema_extra={"auto_default_from_env": True}
)
DIRECTOR_V2_CATALOG: Annotated[
CatalogSettings | None, Field(json_schema_extra={"auto_default_from_env": True})
]

DIRECTOR_V0: DirectorV0Settings = Field(
json_schema_extra={"auto_default_from_env": True}
)

DYNAMIC_SERVICES: DynamicServicesSettings = Field(
json_schema_extra={"auto_default_from_env": True}
)
DYNAMIC_SERVICES: Annotated[
DynamicServicesSettings,
Field(json_schema_extra={"auto_default_from_env": True}),
]

POSTGRES: PostgresSettings = Field(
json_schema_extra={"auto_default_from_env": True}
)
POSTGRES: Annotated[
PostgresSettings, Field(json_schema_extra={"auto_default_from_env": True})
]

REDIS: RedisSettings = Field(json_schema_extra={"auto_default_from_env": True})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ def create_as_initially_ok(cls) -> "Status":


class DockerContainerInspect(BaseModel):
container_state: ContainerState = Field(
..., description="current state of container"
)
container_state: Annotated[
ContainerState, Field(..., description="current state of container")
]
name: str = Field(..., description="docker name of the container")
id: str = Field(..., description="docker id of the container")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any, Final, NamedTuple, TypeAlias

from models_library.utils.specs_substitution import SubstitutionValue
from pydantic import NonNegativeInt, TypeAdapter
from pydantic import NonNegativeInt
from servicelib.utils import logged_gather

ContextDict: TypeAlias = dict[str, Any]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
from simcore_service_webserver.socketio.plugin import setup_socketio
from simcore_service_webserver.users.plugin import setup_users
from sqlalchemy import func, select
from tenacity import AsyncRetrying, stop_after_delay, wait_fixed

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -345,16 +344,9 @@ async def disconnect_user_from_socketio(
await sio.disconnect()
assert not sio.sid
await asyncio.sleep(0) # just to ensure there is a context switch

async for attempt in AsyncRetrying(
wait=wait_fixed(0.1), stop=stop_after_delay(5), reraise=True
):
with attempt:
assert not await socket_registry.find_keys(("socket_id", sio.get_sid()))
assert sid not in await socket_registry.find_resources(
resource_key, "socket_id"
)
assert not await socket_registry.find_resources(resource_key, "socket_id")
assert not await socket_registry.find_keys(("socket_id", sio.get_sid()))
assert sid not in await socket_registry.find_resources(resource_key, "socket_id")
assert not await socket_registry.find_resources(resource_key, "socket_id")


async def assert_users_count(
Expand Down Expand Up @@ -485,6 +477,7 @@ async def test_t1_while_guest_is_connected_no_resources_are_removed(
await assert_project_in_db(aiopg_engine, empty_guest_user_project)


@pytest.mark.flaky(max_runs=3)
async def test_t2_cleanup_resources_after_browser_is_closed(
disable_garbage_collector_task: None,
client: TestClient,
Expand Down
1 change: 1 addition & 0 deletions tests/environment-setup/requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
# installs this repo's packages
pytest-simcore @ ../../packages/pytest-simcore/
simcore-settings-library @ ../../packages/settings-library/
simcore-common-library @ ../../packages/common-library/
simcore-service-library @ ../../packages/service-library/
1 change: 1 addition & 0 deletions tests/environment-setup/requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
# installs this repo's packages
--editable ../../packages/pytest-simcore/
--editable ../../packages/settings-library/
--editable ../../packages/common-library/
--editable ../../packages/service-library/
Loading