Skip to content

Commit 001a2a3

Browse files
changed the code the way mysql container is initialized. Trying to fix the issue - feast-dev#4128
Also going to check if this change will be resolved in the github actions as well. Signed-off-by: Lokesh Rangineni <[email protected]>
1 parent 0c30e96 commit 001a2a3

1 file changed

Lines changed: 3 additions & 39 deletions

File tree

‎sdk/python/tests/unit/test_sql_registry.py‎

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from feast.types import Array, Bytes, Float32, Int32, Int64, String
3737
from feast.value_type import ValueType
3838
from tests.integration.feature_repos.universal.entities import driver
39+
from testcontainers.mysql import MySqlContainer
3940

4041
POSTGRES_USER = "test"
4142
POSTGRES_PASSWORD = "test"
@@ -81,19 +82,10 @@ def pg_registry():
8182

8283
@pytest.fixture(scope="session")
8384
def mysql_registry():
84-
container = (
85-
DockerContainer("mysql:latest")
86-
.with_exposed_ports(3306)
87-
.with_env("MYSQL_RANDOM_ROOT_PASSWORD", "true")
88-
.with_env("MYSQL_USER", POSTGRES_USER)
89-
.with_env("MYSQL_PASSWORD", POSTGRES_PASSWORD)
90-
.with_env("MYSQL_DATABASE", POSTGRES_DB)
91-
)
92-
85+
container = MySqlContainer("mysql:latest")
9386
container.start()
9487

95-
# The log string uses '8.0.*' since the version might be changed as new Docker images are pushed.
96-
log_string_to_wait_for = "/usr/sbin/mysqld: ready for connections. Version: '(\\d+(\\.\\d+){1,2})' socket: '/var/run/mysqld/mysqld.sock' port: 3306" # noqa: W605
88+
log_string_to_wait_for = "ready for connections. Version: '8.2.0' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL" # noqa: W605
9789
waited = wait_for_logs(
9890
container=container,
9991
predicate=log_string_to_wait_for,
@@ -125,10 +117,6 @@ def sqlite_registry():
125117
yield SqlRegistry(registry_config, "project", None)
126118

127119

128-
@pytest.mark.skipif(
129-
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
130-
reason="does not run on mac github actions",
131-
)
132120
@pytest.mark.parametrize(
133121
"sql_registry",
134122
[
@@ -192,10 +180,6 @@ def assert_project_uuid(project, project_uuid, sql_registry):
192180
assert project_metadata[0].project_uuid == project_uuid
193181

194182

195-
@pytest.mark.skipif(
196-
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
197-
reason="does not run on mac github actions",
198-
)
199183
@pytest.mark.parametrize(
200184
"sql_registry",
201185
[
@@ -286,10 +270,6 @@ def test_apply_feature_view_success(sql_registry):
286270
sql_registry.teardown()
287271

288272

289-
@pytest.mark.skipif(
290-
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
291-
reason="does not run on mac github actions",
292-
)
293273
@pytest.mark.parametrize(
294274
"sql_registry",
295275
[
@@ -375,10 +355,6 @@ def location_features_from_push(inputs: pd.DataFrame) -> pd.DataFrame:
375355
sql_registry.teardown()
376356

377357

378-
@pytest.mark.skipif(
379-
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
380-
reason="does not run on mac github actions",
381-
)
382358
@pytest.mark.parametrize(
383359
"sql_registry",
384360
[
@@ -505,10 +481,6 @@ def odfv1(feature_df: pd.DataFrame) -> pd.DataFrame:
505481
sql_registry.teardown()
506482

507483

508-
@pytest.mark.skipif(
509-
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
510-
reason="does not run on mac github actions",
511-
)
512484
@pytest.mark.parametrize(
513485
"sql_registry",
514486
[
@@ -575,10 +547,6 @@ def test_apply_data_source(sql_registry):
575547
sql_registry.teardown()
576548

577549

578-
@pytest.mark.skipif(
579-
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
580-
reason="does not run on mac github actions",
581-
)
582550
@pytest.mark.parametrize(
583551
"sql_registry",
584552
[
@@ -646,10 +614,6 @@ def test_registry_cache(sql_registry):
646614
sql_registry.teardown()
647615

648616

649-
@pytest.mark.skipif(
650-
sys.platform == "darwin" and "GITHUB_REF" in os.environ,
651-
reason="does not run on mac github actions",
652-
)
653617
@pytest.mark.parametrize(
654618
"sql_registry",
655619
[

0 commit comments

Comments
 (0)