From a4a4fc13fed6b05cb929253020dc2ed925a8546b Mon Sep 17 00:00:00 2001 From: Melvin Kannan Date: Mon, 12 Jan 2026 17:13:57 +0530 Subject: [PATCH 1/2] feat: add integration tests to CI workflow Closes #216 - Add new integration-tests job that runs after build - Setup Python 3.11 with xvfb for headless VS Code - Use existing create-venv-for-tests composite action - Upload test artifacts (screenshots, logs) on failure - Allow skipping with [skip-integration] in commit message --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53d6a1f50..d34b57861 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,6 +135,81 @@ jobs: - name: Check licenses run: npm run check-licenses + integration-tests: + name: Integration Tests + runs-on: ubuntu-latest + timeout-minutes: 60 + needs: [build] + if: "!contains(github.event.head_commit.message, '[skip-integration]')" + steps: + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + + - name: Setup Node.js + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6 + with: + cache: 'npm' + node-version-file: '.nvmrc' + + - name: Setup Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install npm dependencies + run: | + npm ci --prefer-offline --no-audit + # Verify Tailwind CSS native modules are installed for Linux + node -e "try { require('lightningcss'); } catch { process.exit(1); }" 2>/dev/null || npm install lightningcss-linux-x64-gnu + node -e "try { require('@tailwindcss/oxide'); } catch { process.exit(1); }" 2>/dev/null || npm install @tailwindcss/oxide-linux-x64-gnu + + - name: Compile TypeScript + run: npm run compile + + - name: Create test virtual environments + uses: ./.github/actions/create-venv-for-tests + with: + IPyWidgetVersion: '8' + + - name: Set Python path for tests + uses: ./.github/actions/set-python + + - name: Install xvfb for headless VS Code + run: | + sudo apt-get update + sudo apt-get install -y xvfb libxkbfile1 libsecret-1-0 libgbm1 libnss3 libatk-bridge2.0-0 libgtk-3-0 + + - name: Run integration tests + run: xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" npm run test:integration + env: + VSC_JUPYTER_CI_TEST: '1' + TEST_FILES_SUFFIX: '*.vscode.test,*.vscode.common.test' + CODE_TESTS_WORKSPACE: 'src/test/datascience' + DISPLAY: ':99' + + - name: Upload test results on failure + if: failure() + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 + with: + name: integration-test-results + path: | + test-results.xml + logs/ + **/*.png + retention-days: 7 + + - name: Upload screenshots on failure + if: failure() + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 + with: + name: integration-test-screenshots + path: | + **/*screenshot*.png + **/*Screen*.png + retention-days: 7 + if-no-files-found: ignore + check_licenses: name: Check Licenses runs-on: ubuntu-latest From 427ce170e6bb6e7b16f64a9edbb7efa6a1ef66c7 Mon Sep 17 00:00:00 2001 From: Melvin Kannan Date: Mon, 12 Jan 2026 17:51:57 +0530 Subject: [PATCH 2/2] fix: address PR review feedback - Fix skip condition for PR events - Remove redundant env vars (handled by npm script) - Consolidate artifact uploads - Add npm issue reference --- .github/workflows/ci.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d34b57861..507529578 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 needs: [build] - if: "!contains(github.event.head_commit.message, '[skip-integration]')" + # Run on all PRs and main branch pushes + # Can be disabled by adding [skip-integration] to PR title or commit message + if: "!contains(github.event.pull_request.title || github.event.head_commit.message || '', '[skip-integration]')" steps: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 @@ -160,7 +162,8 @@ jobs: - name: Install npm dependencies run: | npm ci --prefer-offline --no-audit - # Verify Tailwind CSS native modules are installed for Linux + # Verify Tailwind CSS native modules are installed for Linux (npm optional deps bug) + # See: https://github.com/npm/cli/issues/4828 node -e "try { require('lightningcss'); } catch { process.exit(1); }" 2>/dev/null || npm install lightningcss-linux-x64-gnu node -e "try { require('@tailwindcss/oxide'); } catch { process.exit(1); }" 2>/dev/null || npm install @tailwindcss/oxide-linux-x64-gnu @@ -184,11 +187,8 @@ jobs: run: xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" npm run test:integration env: VSC_JUPYTER_CI_TEST: '1' - TEST_FILES_SUFFIX: '*.vscode.test,*.vscode.common.test' - CODE_TESTS_WORKSPACE: 'src/test/datascience' - DISPLAY: ':99' - - name: Upload test results on failure + - name: Upload test artifacts on failure if: failure() uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 with: @@ -198,16 +198,6 @@ jobs: logs/ **/*.png retention-days: 7 - - - name: Upload screenshots on failure - if: failure() - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 - with: - name: integration-test-screenshots - path: | - **/*screenshot*.png - **/*Screen*.png - retention-days: 7 if-no-files-found: ignore check_licenses: