Skip to content

Commit 8b5698f

Browse files
lokeshranginenitokokojeremyaryfeast-ci-botpushkarmoi
authored
fix: Changed the code the way mysql container is initialized. (#4140)
* chore: Move feast install to docker build in java it tests (#4126) * chore: Move feast install to docker build in java it tests Signed-off-by: tokoko <[email protected]> * remove commented out lines in compose file Signed-off-by: tokoko <[email protected]> * make local compose mode default Signed-off-by: tokoko <[email protected]> * limit COPY contents Signed-off-by: tokoko <[email protected]> * remove requirements.txt from java tests docker image Signed-off-by: tokoko <[email protected]> * include pyproject.toml in dockerfile Signed-off-by: tokoko <[email protected]> * change links to depends_on Signed-off-by: tokoko <[email protected]> * try updating setup-python to v5 Signed-off-by: tokoko <[email protected]> * pin macos image to macos-12 Signed-off-by: tokoko <[email protected]> * force rerun Signed-off-by: tokoko <[email protected]> --------- Signed-off-by: tokoko <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * chore: Incorporate release 0.37.1 to master (#4127) * chore(release): release 0.37.1 ## [0.37.1](v0.37.0...v0.37.1) (2024-04-17) ### Bug Fixes * Pgvector patch ([#4108](#4108)) ([1a1f0b1](1a1f0b1)) ### Reverts * Reverts "fix: Using version args to install the correct feast version" ([#4112](#4112)) ([d5ded69](d5ded69)), closes [#3953](#3953) * chore: Move feast install to docker build in java it tests (#4126) * chore: Move feast install to docker build in java it tests Signed-off-by: tokoko <[email protected]> * remove commented out lines in compose file Signed-off-by: tokoko <[email protected]> * make local compose mode default Signed-off-by: tokoko <[email protected]> * limit COPY contents Signed-off-by: tokoko <[email protected]> * remove requirements.txt from java tests docker image Signed-off-by: tokoko <[email protected]> * include pyproject.toml in dockerfile Signed-off-by: tokoko <[email protected]> * change links to depends_on Signed-off-by: tokoko <[email protected]> * try updating setup-python to v5 Signed-off-by: tokoko <[email protected]> * pin macos image to macos-12 Signed-off-by: tokoko <[email protected]> * force rerun Signed-off-by: tokoko <[email protected]> --------- Signed-off-by: tokoko <[email protected]> --------- Signed-off-by: tokoko <[email protected]> Co-authored-by: feast-ci-bot <[email protected]> Co-authored-by: Tornike Gurgenidze <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * chore: Install python dependencies with uv in workflows (#4086) * install dependencies in unit-tests with uv Signed-off-by: tokoko <[email protected]> * install dependencies in unit-tests with uv Signed-off-by: tokoko <[email protected]> * enable caching, change linter job Signed-off-by: tokoko <[email protected]> * change local integration tests to uv Signed-off-by: tokoko <[email protected]> * change all installs to uv Signed-off-by: tokoko <[email protected]> * try adding uv cache Signed-off-by: tokoko <[email protected]> * fix lambda cache step name Signed-off-by: tokoko <[email protected]> * reenable caches for uv Signed-off-by: tokoko <[email protected]> * remove dangling cache step Signed-off-by: tokoko <[email protected]> --------- Signed-off-by: tokoko <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * feat: Make arrow primary interchange for online ODFV execution (#4143) * rewrite online flow to use transform_arrow Signed-off-by: tokoko <[email protected]> * fix transformation server Signed-off-by: tokoko <[email protected]> --------- Signed-off-by: tokoko <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * feat: Feast/IKV online store documentation (#4146) * feat: Feast/IKV online store documentation Signed-off-by: Pushkar Gupta <[email protected]> * functionality matric Signed-off-by: Pushkar Gupta <[email protected]> * more changes Signed-off-by: Pushkar Gupta <[email protected]> * mount dir Signed-off-by: Pushkar Gupta <[email protected]> --------- Signed-off-by: Pushkar Gupta <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * fix: Default value is not set in Redis connection string using environment variable (#4136) Removed documentation of Redis connection string supporting default values when using environment variables as it isn't supported Fixes #3669 Signed-off-by: Theodor Mihalache <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * fix: Make sure schema is used when calling `get_table_query_string` method for Snowflake datasource (#4131) * Fix get_table_query_string method for Snowflake datasource Signed-off-by: TomSteenbergen <[email protected]> * Add quotes to table string Signed-off-by: TomSteenbergen <[email protected]> --------- Signed-off-by: TomSteenbergen <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * fix: Change checkout action back to v3 from v5 which isn't released yet (#4147) Signed-off-by: Jeremy Ary <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> * changed the code the way mysql container is initialized. Trying to fix the issue - #4128 Also going to check if this change will be resolved in the github actions as well. Signed-off-by: Lokesh Rangineni <[email protected]> * reformatted the file to resolve lint error. Signed-off-by: Lokesh Rangineni <[email protected]> * reformatted the file to resolve lint error. Signed-off-by: Lokesh Rangineni <[email protected]> --------- Signed-off-by: tokoko <[email protected]> Signed-off-by: Lokesh Rangineni <[email protected]> Signed-off-by: Pushkar Gupta <[email protected]> Signed-off-by: Theodor Mihalache <[email protected]> Signed-off-by: TomSteenbergen <[email protected]> Signed-off-by: Jeremy Ary <[email protected]> Co-authored-by: Tornike Gurgenidze <[email protected]> Co-authored-by: Jeremy Ary <[email protected]> Co-authored-by: feast-ci-bot <[email protected]> Co-authored-by: Pushkar Gupta <[email protected]> Co-authored-by: Theodor Mihalache <[email protected]> Co-authored-by: Tom Steenbergen <[email protected]>
1 parent 811d711 commit 8b5698f

1 file changed

Lines changed: 9 additions & 21 deletions

File tree

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

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pytest_lazyfixture import lazy_fixture
2222
from testcontainers.core.container import DockerContainer
2323
from testcontainers.core.waiting_utils import wait_for_logs
24+
from testcontainers.mysql import MySqlContainer
2425

2526
from feast import FileSource, RequestSource
2627
from feast.data_format import ParquetFormat
@@ -41,7 +42,6 @@
4142
POSTGRES_PASSWORD = "test"
4243
POSTGRES_DB = "test"
4344

44-
4545
logger = logging.getLogger(__name__)
4646

4747

@@ -81,32 +81,20 @@ def pg_registry():
8181

8282
@pytest.fixture(scope="session")
8383
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-
84+
container = MySqlContainer("mysql:latest")
9385
container.start()
9486

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
97-
waited = wait_for_logs(
98-
container=container,
99-
predicate=log_string_to_wait_for,
100-
timeout=60,
101-
interval=10,
87+
# testing for the database to exist and ready to connect and start testing.
88+
import sqlalchemy
89+
90+
engine = sqlalchemy.create_engine(
91+
container.get_connection_url(), pool_pre_ping=True
10292
)
103-
logger.info("Waited for %s seconds until mysql container was up", waited)
104-
container_port = container.get_exposed_port(3306)
105-
container_host = container.get_container_host_ip()
93+
engine.connect()
10694

10795
registry_config = RegistryConfig(
10896
registry_type="sql",
109-
path=f"mysql+pymysql://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{container_host}:{container_port}/{POSTGRES_DB}",
97+
path=container.get_connection_url(),
11098
sqlalchemy_config_kwargs={"echo": False, "pool_pre_ping": True},
11199
)
112100

0 commit comments

Comments
 (0)