Compare commits

...

1 Commits

Author SHA1 Message Date
Joe Li
7d1497ece3 test(ci): stabilize master checks 2026-07-02 13:41:22 -07:00
4 changed files with 17 additions and 8 deletions

View File

@@ -29,6 +29,7 @@ import { waitForPost } from '../../helpers/api/intercepts';
import { expectStatusOneOf } from '../../helpers/api/assertions';
import { getDatabaseByName } from '../../helpers/api/database';
import { apiExecuteSql } from '../../helpers/api/sqllab';
import { TIMEOUT } from '../../utils/constants';
interface ExamplesSetupResult {
tableName: string;
@@ -116,7 +117,7 @@ async function dropTempTable(
// Uses test.describe only because Playwright's serial mode API requires it -
// (Deviation from "avoid describe" guideline is necessary for functional reasons)
test.describe('create dataset wizard', () => {
test.describe.configure({ mode: 'serial' });
test.describe.configure({ mode: 'serial', timeout: TIMEOUT.SLOW_TEST });
test('should create a dataset via wizard', async ({ page, testAssets }) => {
const { tableName, dbId, createDatasetPage } = await setupExamplesDataset(

View File

@@ -17,6 +17,7 @@
"""Unit tests for the MCP get_dashboard_datasets tool."""
from importlib import import_module
from unittest.mock import Mock, patch
import pytest
@@ -29,6 +30,10 @@ from superset.mcp_service.utils.sanitization import (
)
from superset.utils import json
get_dashboard_datasets_module = import_module(
"superset.mcp_service.dashboard.tool.get_dashboard_datasets"
)
def _wrapped(value: str) -> str:
return f"{LLM_CONTEXT_OPEN_DELIMITER}\n{value}\n{LLM_CONTEXT_CLOSE_DELIMITER}"
@@ -142,8 +147,8 @@ def mock_dataset_access():
@pytest.fixture(autouse=True)
def allow_data_model_metadata():
"""Keep tests in the metadata-allowed path unless a test overrides it."""
with patch(
"superset.mcp_service.dashboard.tool.get_dashboard_datasets."
with patch.object(
get_dashboard_datasets_module,
"user_can_view_data_model_metadata",
return_value=True,
) as mock_allow:

View File

@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
from datetime import datetime
from importlib import import_module
from importlib.util import find_spec
from unittest.mock import patch
@@ -26,6 +27,8 @@ from superset.utils.core import DTTM_ALIAS
from superset.utils.pandas_postprocessing import prophet
from tests.unit_tests.fixtures.dataframes import prophet_df
prophet_module = import_module("superset.utils.pandas_postprocessing.prophet")
def test_prophet_valid():
df = prophet(df=prophet_df, time_grain="P1M", periods=3, confidence_interval=0.9)
@@ -207,9 +210,7 @@ def test_prophet_fit_error():
if find_spec("prophet") is None:
pytest.skip("prophet not installed")
with patch(
"superset.utils.pandas_postprocessing.prophet._prophet_fit_and_predict"
) as mock_fit:
with patch.object(prophet_module, "_prophet_fit_and_predict") as mock_fit:
mock_fit.side_effect = InvalidPostProcessingError(
"Unable to generate forecast: Dataframe has fewer than 2 non-NaN rows."
)

View File

@@ -2983,8 +2983,9 @@ def test_coerce_integer_rejects_non_integer_float() -> None:
def test_coerce_integer_rejects_other_types() -> None:
raw: Any = [1]
with pytest.raises(ValueError, match="Invalid integer value"):
_coerce_scalar_filter_value([1], _dim(pa.int64()))
_coerce_scalar_filter_value(raw, _dim(pa.int64()))
@pytest.mark.parametrize(
@@ -3008,8 +3009,9 @@ def test_coerce_floating_invalid_string_raises() -> None:
def test_coerce_floating_rejects_other_types() -> None:
raw: Any = [1.0]
with pytest.raises(ValueError, match="Invalid numeric value"):
_coerce_scalar_filter_value([1.0], _dim(pa.float64()))
_coerce_scalar_filter_value(raw, _dim(pa.float64()))
def test_coerce_date_from_datetime() -> None: