The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Emb 1450 simplify sdk e2e test commands and docs (#71168)
Nicolò Pretto94be4bfae39c
diff --git a/enterprise/frontend/src/embedding-sdk-package/dev.md b/enterprise/frontend/src/embedding-sdk-package/dev.mdindex 2294e4ee303..0cdacf96968 100644--- a/enterprise/frontend/src/embedding-sdk-package/dev.md+++ b/enterprise/frontend/src/embedding-sdk-package/dev.md@@ -9,18 +9,10 @@ Code in this directory should carefully reference external code, including code## BuildYou can build the SDK NPM package with `bun run build-embedding-sdk-package`.-You can build the SDK bundle with `bun run build-release:embedding-sdk-bundle`-#### embedding-sdk:dev+The SDK bundle is built with the core app frontend and served by the core app, so you'll probably want to have `build-hot` (with `MB_EDITION=ee`) running.-The `embedding-sdk:dev` command builds both SDK NPM package and SDK bundle in the `watch` mode.--It runs a local dev server that serves compiled files; the server is used by `Cypress`.--It uses `tsc --incremental` to generate the dts files and fixes them automatically by running the fixup script on watch.--The `tsc` command will output a lot of errors, to keep the terminal output under control you may want to run the three different `embedding-sdk:dev:*` commands on different terminals.-There is a VS code task named `Run embedding sdk dev commands` that does that+If you have `SKIP_EMBEDDING_SDK`, you'll have to unset it for the sdk bundle to be built.## Storybook@@ -57,16 +49,14 @@ MB_PRO_SELF_HOSTED_TOKEN=${usual token from password manager}```Cypress will use the built package, so you'll have to build the sdk first (see above).-We recommend running either the dev or the watch command to have shorter a feedback loop.+Make sure `build-hot` is running (with `MB_EDITION=ee`) — it builds the SDK bundle that the package loads at runtime.-To start the cypress for the e2e tests:+To start cypress for the e2e tests:```bashCYPRESS_TESTING_TYPE="component" bun run test-cypress```-Then in a separate terminal run `bun run embedding-sdk:dev` to build SDK NPM package and SDK bundle in the `watch` mode.-### Sample Apps compatibility with Embedding SDK testsIn order to check compatibility between Sample Apps and Embedding SDK, we have a special test suite for each sample app that pulls this Sample App, starts it and runs its Cypress tests against the local `metabase.jar` and local `@metabase/embedding-sdk-react` package.diff --git a/package.json b/package.jsonindex 05361ebf812..a3d3b5bdb17 100644--- a/package.json+++ b/package.json@@ -492,10 +492,6 @@"embedding-sdk:docs-snippets:type-check": "./bin/embedding-sdk/type-check-embedding-sdk-docs-snippets.sh","embedding-sdk:clean:dist": "rm -rf resources/embedding-sdk/dist","embedding-sdk:clean:tsbuildinfo": "rm -rf resources/embedding-sdk/.tsbuildinfo",- "embedding-sdk:dev": "EMBEDDING_SDK_BUNDLE_HOST=http://localhost:3100 concurrently -n 'serve-resources,tsc,webpack,fix-types' -c 'red,blue,green,yellow' 'bun run serve-resources' 'npm:embedding-sdk:dev:dts' 'npm:embedding-sdk:dev:webpack' 'npm:embedding-sdk:dev:fixup'",- "embedding-sdk:dev:webpack": "bun run embedding-sdk:generate-package && bun run embedding-sdk:generate-package-support-files && WEBPACK_BUNDLE=development concurrently -n 'embedding-sdk-package,embedding-sdk-bundle' 'rspack --config rspack.embedding-sdk-package.config.js --watch' 'rspack --config rspack.embedding-sdk-bundle.config.js --watch'",- "embedding-sdk:dev:dts": "tsc --project tsconfig.sdk.json --watch --preserveWatchOutput",- "embedding-sdk:dev:fixup": "bun run embedding-sdk:dts:fixup --watch","eslint-fix": "bun run lint-eslint --fix","find-never-defined-css-variables": "tsx bin/find-never-defined-css-variables/find-never-defined-css-variables.ts","generate-cypress-html-report": "mochawesome-merge cypress/reports/mochareports/*.json > cypress/reports/cypress-test-report.json && marge cypress/reports/cypress-test-report.json -o cypress/reports --inline",@@ -516,7 +512,6 @@"prepare": "husky","prettier": "prettier --write --cache '{frontend,enterprise/frontend,e2e}/**/*.{js,jsx,ts,tsx,css}'","remove-webpack-cache": "rm -rf ./node_modules/.cache",- "serve-resources": "http-server resources/frontend_client -p 3100 -c-1","storybook": "bun run build:cljs && storybook dev -p 6006","storybook-pure": "storybook dev -p 6006","storybook-embedding-sdk": "IS_EMBEDDING_SDK=true storybook dev -c frontend/src/embedding-sdk-shared/.storybook -p 6006",