From 2978b34b7b29d5fd7a5ec4e2c7a03829f20009b0 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Wed, 30 Apr 2025 15:32:37 -0400 Subject: [PATCH] Skip TAB-disabled tests locally by default (#6601) --- .github/ci-cd-scripts/playwright-electron.sh | 12 ++++++------ e2e/playwright/lib/api-reporter.ts | 3 --- package.json | 11 ++--------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/ci-cd-scripts/playwright-electron.sh b/.github/ci-cd-scripts/playwright-electron.sh index d8f66898e..e3c62b693 100755 --- a/.github/ci-cd-scripts/playwright-electron.sh +++ b/.github/ci-cd-scripts/playwright-electron.sh @@ -7,11 +7,11 @@ if [[ ! -f "test-results/.last-run.json" ]]; then # If no last run artifact, than run Playwright normally echo "run playwright normally" if [[ "$3" == *ubuntu* ]]; then - xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --shard=$1/$2 || true + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --shard=$1/$2 || true elif [[ "$3" == *windows* ]]; then - npm run test:playwright:electron:windows -- --shard=$1/$2 || true + npm run test:playwright:electron -- --grep=@windows --shard=$1/$2 || true elif [[ "$3" == *macos* ]]; then - npm run test:playwright:electron:macos -- --shard=$1/$2 || true + npm run test:playwright:electron -- --grep=@macos --shard=$1/$2 || true else echo "Do not run Playwright. Unable to detect os runtime." exit 1 @@ -31,11 +31,11 @@ while [[ $retry -le $max_retries ]]; do echo "retried=true" >>$GITHUB_OUTPUT echo "run playwright with last failed tests and retry $retry" if [[ "$3" == *ubuntu* ]]; then - xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron:ubuntu -- --last-failed || true + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --last-failed || true elif [[ "$3" == *windows* ]]; then - npm run test:playwright:electron:windows -- --last-failed || true + npm run test:playwright:electron -- --grep=@windows --last-failed || true elif [[ "$3" == *macos* ]]; then - npm run test:playwright:electron:macos -- --last-failed || true + npm run test:playwright:electron -- --grep=@macos --last-failed || true else echo "Do not run playwright. Unable to detect os runtime." exit 1 diff --git a/e2e/playwright/lib/api-reporter.ts b/e2e/playwright/lib/api-reporter.ts index 1a1e91981..871aa39f0 100644 --- a/e2e/playwright/lib/api-reporter.ts +++ b/e2e/playwright/lib/api-reporter.ts @@ -14,9 +14,6 @@ class MyAPIReporter implements Reporter { await Promise.all(this.pendingRequests) if (this.allResults.length === 0) { - if (!process.env.CI) { - console.error('TAB API - No results to process') - } return } diff --git a/package.json b/package.json index 19bd83d05..ae3098221 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,6 @@ "files:invalidate-bucket": "./scripts/invalidate-files-bucket.sh", "files:invalidate-bucket:nightly": "./scripts/invalidate-files-bucket.sh --nightly", "postinstall": "electron-rebuild", - "make:dev": "make dev", "generate:machine-api": "npx openapi-typescript ./openapi/machine-api.json -o src/lib/machine-api.d.ts", "generate:samples-manifest": "cd public/kcl-samples && node generate-manifest.js", "tron:start": "electron-forge start", @@ -139,14 +138,8 @@ "test:unit": "vitest run --mode development --exclude **/kclSamples.test.ts", "test:unit:kcl-samples": "vitest run --mode development ./src/lang/kclSamples.test.ts", "test:playwright:electron": "playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot", - "test:playwright:electron:windows": "playwright test --config=playwright.electron.config.ts --grep=@windows --quiet", - "test:playwright:electron:macos": "playwright test --config=playwright.electron.config.ts --grep=@macos --quiet", - "test:playwright:electron:ubuntu": "playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot --quiet", - "test:playwright:electron:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot", - "test:playwright:electron:windows:local": "npm run tronb:vite:dev && set NODE_ENV='development' && playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot", - "test:playwright:electron:macos:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot", - "test:playwright:electron:ubuntu:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot", - "test:playwright:electron:ubuntu:engine:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot|@skipLocalEngine'", + "test:playwright:electron:local": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert=@snapshot --grep-invert=\"$(curl --silent https://test-analysis-bot.hawk-dinosaur.ts.net/projects/KittyCAD/modeling-app/tests/disabled/regex)\"", + "test:playwright:electron:local-engine": "npm run tronb:vite:dev && NODE_ENV=development playwright test --config=playwright.electron.config.ts --grep-invert='@snapshot|@skipLocalEngine' --grep-invert=\"$(curl --silent https://test-analysis-bot.hawk-dinosaur.ts.net/projects/KittyCAD/modeling-app/tests/disabled/regex)\"", "test:unit:local": "npm run simpleserver:bg && npm run test:unit; kill-port 3000", "test:unit:kcl-samples:local": "npm run simpleserver:bg && npm run test:unit:kcl-samples; kill-port 3000" },