From 58a2eb465a90b4e3b2ca6e35536b24de63cca86b Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Sun, 21 Sep 2025 13:31:58 -0700 Subject: [PATCH] fix tests --- docker-compose.yml | 4 +- superset-frontend/package-lock.json | 123 ++++++++++++++----- superset/commands/report/execute_now.py | 4 +- tests/integration_tests/reports/api_tests.py | 6 + 4 files changed, 100 insertions(+), 37 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d58ed84488f..a25ddf8af0e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -184,8 +184,10 @@ services: SCARF_ANALYTICS: "${SCARF_ANALYTICS:-}" # configuring the dev-server to use the host.docker.internal to connect to the backend superset: "http://superset:8088" + WEBPACK_DEVSERVER_HOST: "${WEBPACK_DEVSERVER_HOST:-0.0.0.0}" + WEBPACK_DEVSERVER_PORT: "${WEBPACK_DEVSERVER_PORT:-9000}" ports: - - "127.0.0.1:9000:9000" # exposing the dynamic webpack dev server + - "9000:9000" # exposing the dynamic webpack dev server container_name: superset_node command: ["/app/docker/docker-frontend.sh"] env_file: diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index d4c0646fbbc..f40a8105f03 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -54,6 +54,8 @@ "@visx/scale": "^3.5.0", "@visx/tooltip": "^3.0.0", "@visx/xychart": "^3.5.1", + "ag-grid-community": "34.2.0", + "ag-grid-react": "34.2.0", "antd": "^5.24.6", "chrono-node": "^2.7.8", "classnames": "^2.2.5", @@ -64,7 +66,6 @@ "dom-to-image-more": "^3.6.0", "dom-to-pdf": "^0.3.2", "echarts": "^5.6.0", - "emotion-rgba": "0.0.12", "eslint-plugin-i18n-strings": "file:eslint-rules/eslint-plugin-i18n-strings", "fast-glob": "^3.3.2", "fs-extra": "^11.2.0", @@ -160,6 +161,7 @@ "@hot-loader/react-dom": "^17.0.2", "@istanbuljs/nyc-config-typescript": "^1.0.1", "@mihkeleidast/storybook-addon-source": "^1.0.1", + "@playwright/test": "^1.49.1", "@storybook/addon-actions": "8.1.11", "@storybook/addon-controls": "8.1.11", "@storybook/addon-essentials": "8.1.11", @@ -191,7 +193,6 @@ "@types/react-resizable": "^3.0.8", "@types/react-router-dom": "^5.3.3", "@types/react-transition-group": "^4.4.12", - "@types/react-ultimate-pagination": "^1.2.4", "@types/react-virtualized-auto-sizer": "^1.0.8", "@types/react-window": "^1.8.8", "@types/redux-localstorage": "^1.0.8", @@ -10111,6 +10112,22 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@playwright/test": { + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz", + "integrity": "sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.55.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", @@ -16078,16 +16095,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-ultimate-pagination": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/react-ultimate-pagination/-/react-ultimate-pagination-1.2.4.tgz", - "integrity": "sha512-1y9jLt3KEFGzFD+99qVpJUI/Eu4cEx48sClB957eGoepWRLVVi+r1UBj0157Mg7HYZcIF4I1/qGZYaBBQWhaqg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*" - } - }, "node_modules/@types/react-virtualized-auto-sizer": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.8.tgz", @@ -18708,27 +18715,27 @@ } }, "node_modules/ag-charts-types": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/ag-charts-types/-/ag-charts-types-12.0.2.tgz", - "integrity": "sha512-AWM1Y+XW+9VMmV3AbzdVEnreh/I2C9Pmqpc2iLmtId3Xbvmv7O56DqnuDb9EXjK5uPxmyUerTP+utL13UGcztw==", + "version": "12.2.0", + "resolved": "https://registry.npmjs.org/ag-charts-types/-/ag-charts-types-12.2.0.tgz", + "integrity": "sha512-d2qQrQirt9wP36YW5HPuOvXsiajyiFnr1CTsoCbs02bavPDz7Lk2jHp64+waM4YKgXb3GN7gafbBI9Qgk33BmQ==", "license": "MIT" }, "node_modules/ag-grid-community": { - "version": "34.0.2", - "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-34.0.2.tgz", - "integrity": "sha512-hVJp5vrmwHRB10YjfSOVni5YJkO/v+asLjT72S4YnIFSx8lAgyPmByNJgtojk1aJ5h6Up93jTEmGDJeuKiWWLA==", + "version": "34.2.0", + "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-34.2.0.tgz", + "integrity": "sha512-peS7THEMYwpIrwLQHmkRxw/TlOnddD/F5A88RqlBxf8j+WqVYRWMOOhU5TqymGcha7z2oZ8IoL9ROl3gvtdEjg==", "license": "MIT", "dependencies": { - "ag-charts-types": "12.0.2" + "ag-charts-types": "12.2.0" } }, "node_modules/ag-grid-react": { - "version": "34.0.2", - "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-34.0.2.tgz", - "integrity": "sha512-1KBXkTvwtZiYVlSuDzBkiqfHjZgsATOmpLZdAtdmsCSOOOEWai0F9zHHgBuHfyciAE4nrbQWfojkx8IdnwsKFw==", + "version": "34.2.0", + "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-34.2.0.tgz", + "integrity": "sha512-dLKFw6hz75S0HLuZvtcwjm+gyiI4gXVzHEu7lWNafWAX0mb8DhogEOP5wbzAlsN6iCfi7bK/cgZImZFjenlqwg==", "license": "MIT", "dependencies": { - "ag-grid-community": "34.0.2", + "ag-grid-community": "34.2.0", "prop-types": "^15.8.1" }, "peerDependencies": { @@ -24477,12 +24484,6 @@ "node": ">= 4" } }, - "node_modules/emotion-rgba": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/emotion-rgba/-/emotion-rgba-0.0.12.tgz", - "integrity": "sha512-lvtZ52BWisYDtis+HctQMkxcHwmFbzTiZhgMJGFfWXLsBYEzthfKE7nlysOiUwmmAdTM/8YBAPfwQ4MEDwiaWw==", - "license": "MIT" - }, "node_modules/encodable": { "version": "0.7.8", "resolved": "https://registry.npmjs.org/encodable/-/encodable-0.7.8.tgz", @@ -45535,6 +45536,53 @@ "dev": true, "license": "MIT" }, + "node_modules/playwright": { + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.0.tgz", + "integrity": "sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.55.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.55.0.tgz", + "integrity": "sha512-GvZs4vU3U5ro2nZpeiwyb0zuFaqb9sUiAJuyrWpcGouD8y9/HLgGbNRjIph7zU9D3hnPaisMl9zG9CgFi/biIg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/png-async": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/png-async/-/png-async-0.9.4.tgz", @@ -60642,7 +60690,7 @@ }, "packages/superset-core": { "name": "@apache-superset/core", - "version": "0.0.1-rc3", + "version": "0.0.1-rc4", "license": "ISC", "devDependencies": { "@babel/cli": "^7.26.4", @@ -63339,10 +63387,10 @@ "version": "0.20.3", "license": "Apache-2.0", "dependencies": { + "@apache-superset/core": "*", "@react-icons/all-files": "^4.1.0", "@types/react": "*", - "lodash": "^4.17.21", - "prop-types": "^15.8.1" + "lodash": "^4.17.21" }, "peerDependencies": { "@ant-design/icons": "^5.2.6", @@ -63367,14 +63415,15 @@ "license": "Apache-2.0", "dependencies": { "@ant-design/icons": "^5.2.6", + "@apache-superset/core": "*", "@babel/runtime": "^7.28.2", "@fontsource/fira-code": "^5.2.6", "@fontsource/inter": "^5.2.6", "@types/json-bigint": "^1.0.4", "@visx/responsive": "^3.12.0", "ace-builds": "^1.43.1", - "ag-grid-community": "^34.0.2", - "ag-grid-react": "34.0.2", + "ag-grid-community": "34.2.0", + "ag-grid-react": "34.2.0", "brace": "^0.11.1", "classnames": "^2.2.5", "core-js": "^3.38.1", @@ -65245,6 +65294,8 @@ "d3-array": "^1.2.4", "d3-color": "^1.4.1", "d3-scale": "^3.0.0", + "dayjs": "^1.11.13", + "handlebars": "^4.7.8", "lodash": "^4.17.21", "mousetrap": "^1.6.5", "ngeohash": "^0.6.3", @@ -65411,6 +65462,7 @@ }, "peerDependencies": { "@ant-design/icons": "^5.2.6", + "@apache-superset/core": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", "@testing-library/dom": "^8.20.1", @@ -65462,6 +65514,7 @@ "lodash": "^4.17.21" }, "peerDependencies": { + "@apache-superset/core": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", "echarts": "*", @@ -66639,6 +66692,7 @@ }, "peerDependencies": { "@ant-design/icons": "^5.2.6", + "@apache-superset/core": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", "lodash": "^4.17.11", @@ -67770,6 +67824,7 @@ }, "peerDependencies": { "@ant-design/icons": "^5.2.6", + "@apache-superset/core": "*", "@superset-ui/chart-controls": "*", "@superset-ui/core": "*", "@testing-library/dom": "^8.20.1", diff --git a/superset/commands/report/execute_now.py b/superset/commands/report/execute_now.py index 9491e96f48f..cc3b43a915e 100644 --- a/superset/commands/report/execute_now.py +++ b/superset/commands/report/execute_now.py @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. import logging -from typing import Optional +from typing import Any, Optional from uuid import uuid4 from flask import current_app @@ -83,7 +83,7 @@ class ExecuteReportScheduleNowCommand(BaseCommand): from superset.tasks.scheduler import execute # Set async options similar to scheduler but for immediate execution - async_options = {"task_id": execution_id} + async_options: dict[str, Any] = {"task_id": execution_id} if self._model.working_timeout is not None and current_app.config.get( "ALERT_REPORTS_WORKING_TIME_OUT_KILL", True ): diff --git a/tests/integration_tests/reports/api_tests.py b/tests/integration_tests/reports/api_tests.py index 2b337628575..203c7d129a7 100644 --- a/tests/integration_tests/reports/api_tests.py +++ b/tests/integration_tests/reports/api_tests.py @@ -2073,6 +2073,12 @@ class TestReportSchedulesApi(SupersetTestCase): # Verify the task was called mock_execute.assert_called_once() + # Verify that the task was called with the correct report_schedule_id and eta + call_args = mock_execute.call_args + assert call_args[0][0] == (report_schedule.id,) + # Check that eta was set for manual execution + assert "eta" in call_args[1] + assert call_args[1]["eta"] is not None @pytest.mark.usefixtures("create_report_schedules") def test_execute_report_schedule_not_found(self):