You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2024/06/04 18:14:28 UTC

(superset) branch cypress_when_needed created (now 2b1b524e55)

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

maximebeauchemin pushed a change to branch cypress_when_needed
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 2b1b524e55 touch a file to trigger CI

This branch includes the following new commits:

     new 1bf3e4e0fb chore: only use cypress.io when triggered manually
     new 2b1b524e55 touch a file to trigger CI

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 02/02: touch a file to trigger CI

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch cypress_when_needed
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 2b1b524e55c299a05698b8050f4d229bf85e6f9a
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Tue Jun 4 11:13:55 2024 -0700

    touch a file to trigger CI
---
 superset/__init__.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/superset/__init__.py b/superset/__init__.py
index e68f60ac6a..d82ba96009 100644
--- a/superset/__init__.py
+++ b/superset/__init__.py
@@ -33,10 +33,10 @@ from superset.extensions import (
 )
 from superset.security import SupersetSecurityManager  # noqa: F401
 
-#  All of the fields located here should be considered legacy. The correct way
-#  to declare "global" dependencies is to define it in extensions.py,
-#  then initialize it in app.create_app(). These fields will be removed
-#  in subsequent PRs as things are migrated towards the factory pattern
+# All of the fields located here should be considered legacy. The correct way
+# to declare "global" dependencies is to define it in extensions.py,
+# then initialize it in app.create_app(). These fields will be removed
+# in subsequent PRs as things are migrated towards the factory pattern
 app: Flask = current_app
 cache = cache_manager.cache
 conf = LocalProxy(lambda: current_app.config)


(superset) 01/02: chore: only use cypress.io when triggered manually

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch cypress_when_needed
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 1bf3e4e0fb880104a6c3992b980d7c30cba4564b
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Tue Jun 4 11:10:02 2024 -0700

    chore: only use cypress.io when triggered manually
---
 .github/workflows/bashlib.sh       | 22 +++++++++++++---------
 .github/workflows/superset-e2e.yml |  9 ++++++++-
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/bashlib.sh b/.github/workflows/bashlib.sh
index c35caa7dc4..66b5dbfe99 100644
--- a/.github/workflows/bashlib.sh
+++ b/.github/workflows/bashlib.sh
@@ -129,7 +129,6 @@ cypress-install() {
   cache-save cypress
 }
 
-# Run Cypress and upload coverage reports
 cypress-run() {
   cd "$GITHUB_WORKSPACE/superset-frontend/cypress-base"
 
@@ -137,27 +136,33 @@ cypress-run() {
   local group=${2:-Default}
   local cypress="./node_modules/.bin/cypress run"
   local browser=${CYPRESS_BROWSER:-chrome}
+  local use_dashboard=$3
 
   export TERM="xterm"
   export ELECTRON_DISABLE_GPU=true # Attempt to disable GPU for Electron-based Cypress
 
   say "::group::Run Cypress for [$page]"
-  if [[ -z $CYPRESS_KEY ]]; then
-    xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x24' $cypress --spec "cypress/e2e/$page" --browser "$browser"
-  else
+  if [[ "$use_dashboard" == "true" && -n $CYPRESS_KEY ]]; then
+
     export CYPRESS_RECORD_KEY=$(echo $CYPRESS_KEY | base64 --decode)
+    echo "Running using the paid Cypress service and API key"
     # additional flags for Cypress dashboard recording
     xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x24' $cypress --spec "cypress/e2e/$page" --browser "$browser" \
       --record --group "$group" --tag "${GITHUB_REPOSITORY},${GITHUB_EVENT_NAME}" \
       --parallel --ci-build-id "${GITHUB_SHA:0:8}-${NONCE}"
-
+  else
+    echo "Running locally"
+    unset CYPRESS_KEY
+    xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x24' $cypress --spec "cypress/e2e/$page" --browser "$browser" \
+      --parallel --group "$group"
   fi
 
-  # don't add quotes to $record because we do want word splitting
   say "::endgroup::"
 }
 
 cypress-run-all() {
+  local use_dashboard=$1
+
   # Start Flask and run it in background
   # --no-debugger means disable the interactive debugger on the 500 page
   # so errors can print to stderr.
@@ -168,7 +173,7 @@ cypress-run-all() {
   nohup flask run --no-debugger -p $port >"$flasklog" 2>&1 </dev/null &
   local flaskProcessId=$!
 
-  cypress-run "*/**/*"
+  cypress-run "*/**/*" "Default" "$use_dashboard"
 
   # After job is done, print out Flask log for debugging
   say "::group::Flask log for default run"
@@ -183,7 +188,7 @@ cypress-run-all() {
   nohup flask run --no-debugger -p $port >"$flasklog" 2>&1 </dev/null &
   local flaskProcessId=$!
 
-  cypress-run "sqllab/*" "Backend persist"
+  cypress-run "sqllab/*" "Backend persist" "$use_dashboard"
 
   say "::group::Flask log for backend persist"
   cat "$flasklog"
@@ -192,7 +197,6 @@ cypress-run-all() {
   # make sure the program exits
   kill $flaskProcessId
 }
-
 eyes-storybook-dependencies() {
   say "::group::install eyes-storyook dependencies"
   sudo apt-get update -y && sudo apt-get -y install gconf-service ca-certificates libxshmfence-dev fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libglib2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libnss3 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst [...]
diff --git a/.github/workflows/superset-e2e.yml b/.github/workflows/superset-e2e.yml
index 8781ad65ae..22be1d9a88 100644
--- a/.github/workflows/superset-e2e.yml
+++ b/.github/workflows/superset-e2e.yml
@@ -7,6 +7,12 @@ on:
       - "[0-9].[0-9]"
   pull_request:
     types: [synchronize, opened, reopened, ready_for_review]
+  workflow_dispatch:
+    inputs:
+      use_dashboard:
+        description: 'Use Cypress Dashboard (true/false) [paid service - trigger manually when needed]'
+        required: false
+        default: 'false'
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
@@ -34,6 +40,7 @@ jobs:
       PYTHONPATH: ${{ github.workspace }}
       REDIS_PORT: 16379
       GITHUB_TOKEN: ${{ github.token }}
+      USE_DASHBOARD: ${{ github.event.inputs.use_dashboard || 'false' }}
     services:
       postgres:
         image: postgres:15-alpine
@@ -105,7 +112,7 @@ jobs:
           CYPRESS_BROWSER: ${{ matrix.browser }}
           CYPRESS_KEY: YjljODE2MzAtODcwOC00NTA3LWE4NmMtMTU3YmFmMjIzOTRhCg==
         with:
-          run: cypress-run-all
+          run: cypress-run-all ${{ env.USE_DASHBOARD }}
       - name: Upload Artifacts
         uses: actions/upload-artifact@v4
         if: steps.check.outputs.python || steps.check.outputs.frontend