You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2025/08/20 22:48:41 UTC

(superset) 01/01: fix(tests): make SingleStore test_adjust_engine_params version-agnostic

This is an automated email from the ASF dual-hosted git repository.

jli pushed a commit to branch fix-hardcode-singlestore-tests
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 654f08511d78485b955d37c7f0c7b6c68f2d9d80
Author: Joe Li <jo...@preset.io>
AuthorDate: Wed Aug 20 15:48:17 2025 -0700

    fix(tests): make SingleStore test_adjust_engine_params version-agnostic
    
    The test was expecting hardcoded version strings "0.0.0-dev" but the actual
    code reads VERSION_STRING from app.config, which comes from package.json.
    
    Changed the test to dynamically read the actual VERSION_STRING value instead
    of hardcoding expectations, making it resilient to version changes.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <no...@anthropic.com>
---
 tests/unit_tests/db_engine_specs/test_singlestore.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/unit_tests/db_engine_specs/test_singlestore.py b/tests/unit_tests/db_engine_specs/test_singlestore.py
index 52ec960ada..893da583b8 100644
--- a/tests/unit_tests/db_engine_specs/test_singlestore.py
+++ b/tests/unit_tests/db_engine_specs/test_singlestore.py
@@ -95,18 +95,22 @@ def test_get_schema_from_engine_params() -> None:
 
 
 def test_adjust_engine_params() -> None:
+    from flask import current_app as app
+
     adjusted = SingleStoreSpec.adjust_engine_params(
         make_url("singlestoredb://user:password@host:5432/dev"),
         {},
         schema="pro d",
     )
+
+    expected_version = app.config.get("VERSION_STRING", "dev")
     assert adjusted == (
         make_url("singlestoredb://user:password@host:5432/pro%20d"),
         {
             "conn_attrs": {
                 "_connector_name": "SingleStore Superset Database Engine",
-                "_connector_version": "0.0.0-dev",
-                "_product_version": "0.0.0-dev",
+                "_connector_version": expected_version,
+                "_product_version": expected_version,
             }
         },
     )