diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3c31281..fc6e053 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -38,7 +38,7 @@ jobs:
run: npm ci
- name: Run unit and integration tests
- run: npm test -- --run --reporter=verbose
+ run: npm test -- --run --reporter=verbose --pool=threads --poolOptions.threads.maxThreads=4
env:
CI: true
@@ -71,9 +71,27 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Detect Playwright version
+ id: playwright-version
+ run: |
+ PLAYWRIGHT_VERSION=$(node -p "require('./package.json').devDependencies?.playwright || require('./package.json').dependencies?.playwright || ''")
+ echo "version=${PLAYWRIGHT_VERSION}" >> $GITHUB_OUTPUT
+
+ - name: Cache Playwright browsers
+ uses: actions/cache@v4
+ id: playwright-cache
+ with:
+ path: ~/.cache/ms-playwright
+ key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}-${{ hashFiles('**/package-lock.json') }}
+
- name: Install Playwright browsers
+ if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
+ - name: Install Playwright deps only (if cached)
+ if: steps.playwright-cache.outputs.cache-hit == 'true'
+ run: npx playwright install-deps chromium
+
- name: Start dev server
run: |
npm run dev &
@@ -93,7 +111,7 @@ jobs:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
- name: Run Playwright tests
- run: npx playwright test --project=chromium
+ run: npx playwright test --project=chromium --workers=2
env:
CI: true
# Add any required env variables for e2e tests
diff --git a/.gitignore b/.gitignore
index 7bb9f3e..f6ab581 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,9 @@ supabase/migrations/
# Documentation (internal notes)
documents/
+
+# Playwright
+/test-results/
+/playwright-report/
+/playwright/.auth/
+tests/playwright/.auth/
diff --git a/playwright.config.ts b/playwright.config.ts
index cf44dae..e0036f3 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -11,8 +11,8 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
- /* Opt out of parallel tests on CI. */
- workers: process.env.CI ? 1 : undefined,
+ /* Use multiple workers for faster CI - GitHub runners have 2 cores */
+ workers: process.env.CI ? 2 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
@@ -20,9 +20,9 @@ export default defineConfig({
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:8080',
- /* Slow down actions for debugging (set to 0 for normal speed) */
+ /* Slow down actions for debugging locally (disabled in CI for speed) */
launchOptions: {
- slowMo: 500, // 500ms delay between actions - remove or set to 0 for fast tests
+ slowMo: process.env.CI ? 0 : 500, // 500ms delay locally for debugging, 0 in CI for speed
},
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
diff --git a/src/components/ProgressRadar.tsx b/src/components/ProgressRadar.tsx
index 42757ed..fcc6034 100644
--- a/src/components/ProgressRadar.tsx
+++ b/src/components/ProgressRadar.tsx
@@ -13,11 +13,22 @@ const ProgressRadar = () => {
useEffect(() => {
const fetchTotals = async () => {
- const { count, error } = await supabase
+ // Fetch all problems with their categories to filter out non-algorithm problems
+ const { data, error } = await supabase
.from("problems")
- .select("id", { count: "exact", head: true });
- if (!error && typeof count === "number") {
- setTotalProblems(count);
+ .select("id, categories!inner(name)");
+
+ if (!error && data) {
+ // Filter out System Design and Data Structure Implementations (same logic as technical interview)
+ const algorithmProblems = data.filter((problem) => {
+ const categoryName = (problem.categories as { name?: string })?.name || "";
+ return (
+ categoryName !== "System Design" &&
+ categoryName !== "Data Structure Implementations" &&
+ !problem.id.startsWith("sd_")
+ );
+ });
+ setTotalProblems(algorithmProblems.length);
}
};
fetchTotals();
diff --git a/src/components/coaching/overlay/CorrectCodeDialog.tsx b/src/components/coaching/overlay/CorrectCodeDialog.tsx
index e7c8170..474c1a3 100644
--- a/src/components/coaching/overlay/CorrectCodeDialog.tsx
+++ b/src/components/coaching/overlay/CorrectCodeDialog.tsx
@@ -32,8 +32,13 @@ export const CorrectCodeDialog: React.FC