Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Re-enable Shoppy sample app e2e (#82061)

Timofey Kachalov6ca683c0421b
diff --git a/.github/actions/prepare-shoppy-e2e/action.yml b/.github/actions/prepare-shoppy-e2e/action.yml
index e36fa764e7b..d2f7fb644b9 100644
--- a/.github/actions/prepare-shoppy-e2e/action.yml
+++ b/.github/actions/prepare-shoppy-e2e/action.yml
@@ -14,21 +14,6 @@ inputs:
staging-mb-all-features-token:
description: "Staging MB all features token"
required: true
- shoppy-iam-role:
- description: "Shoppy IAM role for AWS credentials"
- required: true
- shoppy-metabase-app-db-s3-bucket:
- description: "S3 bucket for Shoppy app DB dump"
- required: true
- shoppy-metabase-app-db-s3-key:
- description: "S3 key for Shoppy app DB dump"
- required: true
- shoppy-metabase-app-db-user:
- description: "Shoppy Metabase app DB user"
- required: true
- shoppy-metabase-app-db-database:
- description: "Shoppy Metabase app DB database"
- required: true
metastore-dev-server-url:
description: "Metastore dev server URL"
required: true
@@ -93,20 +78,6 @@ runs:
echo "sample_app_branch_exists=false" >> "$GITHUB_OUTPUT"
fi
- - name: Configure AWS credentials
- if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' }}
- uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885
- with:
- role-to-assume: ${{ inputs.shoppy-iam-role }}
- role-session-name: GitHub_to_AWS_via_FederatedOIDC
- aws-region: us-east-1
-
- - name: Download Shoppy's App DB PostgreSQL dump from S3
- if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' }}
- shell: bash
- run: |
- aws s3 cp s3://${{ inputs.shoppy-metabase-app-db-s3-bucket }}/${{ inputs.shoppy-metabase-app-db-s3-key }} ./e2e/tmp/db_dumps/shoppy_metabase_app_db_dump.sql
-
- name: Prepare and launch Shoppy containers
if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' }}
shell: bash
@@ -115,8 +86,6 @@ runs:
SAMPLE_APP_ENVIRONMENT: ${{ inputs.sample-app-environment }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ inputs.staging-mb-all-features-token }}
METASTORE_DEV_SERVER_URL: ${{ inputs.metastore-dev-server-url }}
- METABASE_APP_DB_USER: ${{ inputs.shoppy-metabase-app-db-user }}
- METABASE_APP_DB: ${{ inputs.shoppy-metabase-app-db-database }}
SHOPPY_DATADOG_APPLICATION_ID: ${{ inputs.shoppy-datadog-application-id }}
SHOPPY_DATADOG_CLIENT_TOKEN: ${{ inputs.shoppy-datadog-client-token }}
SHOPPY_DATADOG_SITE: "us5.datadoghq.com"
diff --git a/.github/workflows/embedding-sdk-host-sample-apps-tests.yml b/.github/workflows/embedding-sdk-host-sample-apps-tests.yml
index c0031ab33cb..f21f10256a7 100644
--- a/.github/workflows/embedding-sdk-host-sample-apps-tests.yml
+++ b/.github/workflows/embedding-sdk-host-sample-apps-tests.yml
@@ -203,9 +203,7 @@ jobs:
fail-fast: false
matrix:
environment: ["production", "development"]
- # TEMPORARILY DISABLED: re-enable by removing the `false &&` below.
if: |
- false &&
!cancelled() && needs.get-sample-apps-data.result == 'success' &&
(github.ref == 'refs/heads/master' || github.base_ref == 'master')
runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
@@ -235,11 +233,6 @@ jobs:
sample-app-branch-name: ${{ needs.get-sample-apps-data.outputs.branch_name }}
sample-app-environment: ${{ matrix.environment }}
staging-mb-all-features-token: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
- shoppy-iam-role: ${{ secrets.SHOPPY_IAM_ROLE }}
- shoppy-metabase-app-db-s3-bucket: ${{ secrets.SHOPPY_METABASE_APP_DB_S3_BUCKET }}
- shoppy-metabase-app-db-s3-key: ${{ secrets.SHOPPY_METABASE_APP_DB_S3_KEY }}
- shoppy-metabase-app-db-user: ${{ secrets.SHOPPY_METABASE_APP_DB_USER }}
- shoppy-metabase-app-db-database: ${{ secrets.SHOPPY_METABASE_APP_DB_DATABASE }}
metastore-dev-server-url: ${{ secrets.METASTORE_DEV_SERVER_URL }}
shoppy-datadog-application-id: ${{ secrets.SHOPPY_METABASE_APP_DATADOG_APPLICATION_ID }}
shoppy-datadog-client-token: ${{ secrets.SHOPPY_METABASE_APP_DATADOG_CLIENT_TOKEN }}
@@ -272,9 +265,7 @@ jobs:
# They use the shoppy production environment and include performance measurement tests.
e2e-shoppy-synthetic-tests:
needs: [get-sample-apps-data]
- # TEMPORARILY DISABLED: re-enable by removing the `false &&` below.
if: |
- false &&
!cancelled() && needs.get-sample-apps-data.result == 'success' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master'
@@ -305,11 +296,6 @@ jobs:
sample-app-branch-name: ${{ needs.get-sample-apps-data.outputs.branch_name }}
sample-app-environment: production
staging-mb-all-features-token: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
- shoppy-iam-role: ${{ secrets.SHOPPY_IAM_ROLE }}
- shoppy-metabase-app-db-s3-bucket: ${{ secrets.SHOPPY_METABASE_APP_DB_S3_BUCKET }}
- shoppy-metabase-app-db-s3-key: ${{ secrets.SHOPPY_METABASE_APP_DB_S3_KEY }}
- shoppy-metabase-app-db-user: ${{ secrets.SHOPPY_METABASE_APP_DB_USER }}
- shoppy-metabase-app-db-database: ${{ secrets.SHOPPY_METABASE_APP_DB_DATABASE }}
metastore-dev-server-url: ${{ secrets.METASTORE_DEV_SERVER_URL }}
shoppy-datadog-application-id: ${{ secrets.SHOPPY_METABASE_APP_DATADOG_APPLICATION_ID }}
shoppy-datadog-client-token: ${{ secrets.SHOPPY_METABASE_APP_DATADOG_CLIENT_TOKEN }}
diff --git a/e2e/runner/embedding-sdk/sample-apps/helpers/copy-shoppy-metabase-app-db-dump.ts b/e2e/runner/embedding-sdk/sample-apps/helpers/copy-shoppy-metabase-app-db-dump.ts
deleted file mode 100644
index ce7b430b9cd..00000000000
--- a/e2e/runner/embedding-sdk/sample-apps/helpers/copy-shoppy-metabase-app-db-dump.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import fs from "fs";
-import * as path from "path";
-
-import { E2E_TMP_FOLDER_PATH } from "../constants/e2e-tmp-folder-path";
-
-const METABASE_FOLDER_PATH = "./metabase";
-
-// See `docs/developers-guide/e2e-tests.md` for more info
-export function copyShoppyMetabaseAppDBDump(rootPath: string) {
- const sourcePath = path.join(
- E2E_TMP_FOLDER_PATH,
- "db_dumps/shoppy_metabase_app_db_dump.sql",
- );
-
- // The dump must be copied to the Shoppy's `metabase` directory.
- // After that it will be used by the Shoppy's Docker container when it is built and started.
- const destinationPath = path.join(
- rootPath,
- METABASE_FOLDER_PATH,
- "metabase_dump.sql",
- );
-
- fs.cpSync(sourcePath, destinationPath);
-}
diff --git a/e2e/runner/embedding-sdk/sample-apps/helpers/start-containers.ts b/e2e/runner/embedding-sdk/sample-apps/helpers/start-containers.ts
index c535a957c0c..f37b12f0a01 100644
--- a/e2e/runner/embedding-sdk/sample-apps/helpers/start-containers.ts
+++ b/e2e/runner/embedding-sdk/sample-apps/helpers/start-containers.ts
@@ -12,7 +12,7 @@ export async function startContainers({
healthcheckPorts,
}: {
cwd: string;
- env: Record<string, string | number>;
+ env: Record<string, string | number | undefined>;
appName: string;
dockerUpCommand: string;
dockerDownCommand: string;
diff --git a/e2e/runner/embedding-sdk/sample-apps/start-sample-app-containers.ts b/e2e/runner/embedding-sdk/sample-apps/start-sample-app-containers.ts
index 279786a9c17..71310d68cb1 100644
--- a/e2e/runner/embedding-sdk/sample-apps/start-sample-app-containers.ts
+++ b/e2e/runner/embedding-sdk/sample-apps/start-sample-app-containers.ts
@@ -3,7 +3,6 @@ import { printBold } from "../../cypress-runner-utils";
import { setupAppCleanup } from "../shared/helpers/setup-app-cleanup";
import { SAMPLE_APP_SETUP_CONFIGS } from "./constants/sample-app-setup-configs";
-import { copyShoppyMetabaseAppDBDump } from "./helpers/copy-shoppy-metabase-app-db-dump";
import { fetchApp } from "./helpers/fetch-app";
import {
copyExampleEnvFile,
@@ -65,10 +64,6 @@ export async function startSampleAppContainers(
copyLocalEmbeddingSdkPackage(rootPath);
}
- if (testSuite === "shoppy-e2e") {
- copyShoppyMetabaseAppDBDump(rootPath);
- }
-
await startContainers({
cwd: rootPath,
env,
diff --git a/e2e/runner/embedding-sdk/shared/helpers/setup-app-cleanup.ts b/e2e/runner/embedding-sdk/shared/helpers/setup-app-cleanup.ts
index 3ebd759f2a8..47b8286a657 100644
--- a/e2e/runner/embedding-sdk/shared/helpers/setup-app-cleanup.ts
+++ b/e2e/runner/embedding-sdk/shared/helpers/setup-app-cleanup.ts
@@ -9,7 +9,7 @@ export function setupAppCleanup({
cleanupAppDir,
}: {
rootPath: string;
- env: Record<string, string | number>;
+ env: Record<string, string | number | undefined>;
appDownCommand: string;
cleanupAppDir: boolean;
}) {
diff --git a/enterprise/frontend/src/embedding-sdk-package/dev.md b/enterprise/frontend/src/embedding-sdk-package/dev.md
index 0cdacf96968..4be93f6305d 100644
--- a/enterprise/frontend/src/embedding-sdk-package/dev.md
+++ b/enterprise/frontend/src/embedding-sdk-package/dev.md
@@ -77,16 +77,6 @@ For example for the `metabase-nodejs-react-sdk-embedding-sample`, run:
SDK_TEST_SUITE=metabase-nodejs-react-sdk-embedding-sample-e2e bun run test-cypress-host-sample-apps
```
-##### :warning: Obtaining the Shoppy's Metabase App DB Dump locally
-
-For the Shoppy's Sample App Tests (`SDK_TEST_SUITE=shoppy-e2e`) locally, a proper App DB dump of the Shoppy's Metabase instance must be placed to the `./e2e/tmp/db_dumps/shoppy_metabase_app_db_dump.sql`
-
-You can get it by:
-
-- Enabling the `Tailscale` and logging in using your work email address.
-- Running `pg_dump "postgres://{{ username }}:{{ password }}@{{ host }}:{{ port }}/{{ database }}" > ./e2e/tmp/db_dumps/shoppy_metabase_app_db_dump.sql` command.
- - See the `Shoppy Coredev Appdb` record in `1password` for credentials.
-
#### CI runs
On our CI, test failures do not block the merging of a pull request (PR). However, if a test fails, it’s most likely due to one of the following reasons: