-
Notifications
You must be signed in to change notification settings - Fork 0
chore: enhance CI pipeline with e2e tests and pre-commit hooks #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4680fdb
5a88435
eac1f05
4ca7898
06c1fd1
80b459e
c1df12b
74a8181
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ jobs: | |
| npm -v | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
| run: npm install --no-fund --no-audit | ||
|
|
||
| - name: Lint | ||
| run: npm run lint | ||
|
|
@@ -37,8 +37,16 @@ jobs: | |
| - name: Unit tests | ||
| run: npm run test | ||
|
|
||
| - name: Database Schema validation | ||
| run: npx drizzle-kit check | ||
| env: | ||
| DATABASE_URL: postgresql://dummy:dummy@localhost/dummy | ||
|
|
||
| - name: Security regression tests | ||
| run: npm run test:security | ||
|
|
||
| - name: E2E Tests (Playwright) | ||
| run: npx playwright install chromium && npm run test:e2e | ||
|
Comment on lines
+40
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Inspect drizzle config to see which env vars it reads at load time.
fd -HI 'drizzle.config.*'
fd -HI 'drizzle.config.*' --exec cat {}
# See if any .env.example documents the required runtime env
fd -HI -t f '.env*'Repository: lab68dev/lab68cvbuilder Length of output: 868 🏁 Script executed: # Find and inspect playwright.config.ts
fd -HI 'playwright.config.*' --exec cat {}
# Find and inspect next.config
fd -HI 'next.config.*' --exec cat {}
# Check if there are any test environment files or setup
fd -HI -t f -e 'env.test' -o -e 'vitest.config' -o -e 'jest.config'
# Check for .env files
ls -la | grep -E '\.env'Repository: lab68dev/lab68cvbuilder Length of output: 2818 🏁 Script executed: # Examine the CI file more carefully for env configuration and line 45 whitespace
sed -n '38,50p' .github/workflows/ci.yml | cat -ARepository: lab68dev/lab68cvbuilder Length of output: 417 🏁 Script executed: # Search for DATABASE_URL usage in the codebase to understand test setup
rg "DATABASE_URL" --max-count 20 -B 2 -A 2Repository: lab68dev/lab68cvbuilder Length of output: 759 🏁 Script executed: # Check for actual runtime env dependencies in the app
rg "process\.env\." --max-count 30 -o | sort | uniq -c | sort -rn
# Look for next-auth configuration
rg "nextauth|NextAuthOptions|NextAuth" -t ts -t tsx --max-count 10
# Check for groq and cloudinary usage
rg "groq|cloudinary|GROQ|CLOUDINARY" --max-count 10
# Look for any CI test setup or environment configuration
fd -t f '.github/workflows/ci.yml' --exec cat {}Repository: lab68dev/lab68cvbuilder Length of output: 2912 🏁 Script executed: # Check if there are any test setup files or mocking
fd -HI -t f 'setup|mock|fixture' | head -20
# Look for .env.example or similar documentation
rg "^(DATABASE_URL|AUTH_SECRET|NEXTAUTH|GROQ|CLOUDINARY)" -t txtRepository: lab68dev/lab68cvbuilder Length of output: 49 🏁 Script executed: # Check auth configuration requirements
rg "NEXTAUTH|AUTH_SECRET|NEXT_PUBLIC_URL" --max-count 15
# Look for the actual E2E tests to understand what routes are tested
fd -HI -t f -path '*/e2e/*' | head -20Repository: lab68dev/lab68cvbuilder Length of output: 235 🏁 Script executed: # Check if app will even start without env vars (look for app layout or middleware)
rg "throw new Error|process\.env\." src/app/layout.tsx src/middleware.ts 2>/dev/null | head -20
# Check what routes exist and if they require auth/env
fd -HI -t f -path '*/app/\[locale\]/*' | grep -E 'route\.(ts|tsx)' | head -10Repository: lab68dev/lab68cvbuilder Length of output: 235 🏁 Script executed: # Search for auth configuration in the codebase
rg "NEXTAUTH|AUTH_SECRET|NEXT_PUBLIC" -g "*.ts" -g "*.tsx" --max-count 15
# Look for E2E test files
fd -type f "e2e" | head -20
# Find all test files
rg "describe|test\(" -l | grep -E "(e2e|test)" | head -15Repository: lab68dev/lab68cvbuilder Length of output: 1001 🏁 Script executed: # Check the CI workflow file completely to see if any env is configured
cat .github/workflows/ci.ymlRepository: lab68dev/lab68cvbuilder Length of output: 980 E2E and schema-check steps will fail in CI without environment variables.
Also recommended:
🤖 Prompt for AI Agents |
||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx lint-staged | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
|
|
||
| test.describe("CV Builder Navigation", () => { | ||
| test("User can load the login page", async ({ page }) => { | ||
| await page.goto("/en/login"); | ||
| // Check if the page loaded successfully by looking for standard initial elements | ||
| await expect(page.locator("form, button, h1, body").first()).toBeVisible({ | ||
| timeout: 10000, | ||
| }); | ||
| }); | ||
| }); | ||
|
Comment on lines
+1
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Confirm builder route shape and that no top-level /builder/page.tsx exists
fd -HI -t f 'page.tsx' src/app | rg -n 'builder'
# Look for any data-testid attributes already wired into the builder UI
rg -nP 'data-testid=' src/components/builder src/app 2>/dev/null | head -50
# Confirm the fullName input attributes
rg -nP -C2 '"fullName"|placeholder="John Doe"' src/components/builder/forms/personal-info-form.tsxRepository: lab68dev/lab68cvbuilder Length of output: 755 🏁 Script executed: #!/bin/bash
# 1. Get full context of the fullName input element
cat -n src/components/builder/forms/personal-info-form.tsx | sed -n '835,855p'
# 2. Search for all data-testid attributes in builder components
echo "=== data-testid attributes in builder ==="
rg 'data-testid=' src/components/builder src/app/\[locale\]/builder 2>/dev/null | head -30
# 3. Find the jobTitle input field
echo "=== Job Title input field ==="
rg -B3 -A3 'jobTitle|job.title' src/components/builder/forms/personal-info-form.tsx | head -50
# 4. Check for preview container references
echo "=== Preview container selectors ==="
rg -n 'preview-container|resume-preview|data-testid.*preview' src/components/builder src/app 2>/dev/null
# 5. Check if builder route requires authentication
echo "=== Builder route auth check ==="
rg -B5 -A5 'middleware|auth|redirect' src/app/\[locale\]/builder/\[id\]/page.tsx | head -30Repository: lab68dev/lab68cvbuilder Length of output: 2072 🏁 Script executed: #!/bin/bash
# Find job title / position input in the form
echo "=== Job Title/Position Input ==="
rg -n -B2 -A4 'position|Job Title' src/components/builder/forms/personal-info-form.tsx | grep -A6 'input'
# Search for job title input attribute definitions
rg -n 'name=.*title|placeholder=.*[Tt]itle' src/components/builder/forms/personal-info-form.tsx
# Search for ATS-related elements in the codebase
echo "=== ATS Button/Panel Search ==="
rg -rn 'ATS|Analyze|ats-feedback|ats-button|Score' src/components/builder src/app 2>/dev/null | grep -i 'button\|text\|locator\|aria' | head -20
# Check for ATS component or feature
echo "=== ATS Component Files ==="
fd -H -t f '.*ats.*|.*recommendation.*' src 2>/dev/null
# Check auth setup in test files
echo "=== Auth Setup in Tests ==="
rg -n 'auth|session|globalSetup|storageState' e2e 2>/dev/nullRepository: lab68dev/lab68cvbuilder Length of output: 587 🏁 Script executed: #!/bin/bash
# Get file sizes to understand scope
echo "=== File sizes ==="
wc -l src/components/builder/forms/personal-info-form.tsx src/components/builder/resume-score.tsx src/components/builder/builder-client.tsx 2>/dev/null
# Check all input elements in personal-info-form
echo "=== All input elements in personal-info-form ==="
rg -n '<input' src/components/builder/forms/personal-info-form.tsx
# Check resume-score.tsx for button structure
echo "=== resume-score.tsx button elements ==="
rg -n 'button|onClick|className.*ats' src/components/builder/resume-score.tsx | head -30
# Look for preview container in builder layout
echo "=== Preview container in builder ==="
rg -n 'preview|canvas|data-testid' src/components/builder/builder-client.tsx src/components/builder/builder-layout.tsx 2>/dev/null | head -20
# Check experience form for position/job title
echo "=== Experience form position input ==="
rg -B2 -A4 'position|positionInput' src/components/builder/forms/experience-form.tsx | head -40
# Verify e2e has no globalSetup
echo "=== E2E test setup ==="
ls -la e2e/ | grep -E 'setup|auth|config'
cat e2e/playwright.config.ts 2>/dev/null | head -40Repository: lab68dev/lab68cvbuilder Length of output: 1982 🏁 Script executed: #!/bin/bash
# Read full resume-score.tsx
echo "=== Full resume-score.tsx ==="
cat -n src/components/builder/resume-score.tsx
# Read builder-preview.tsx to check for preview container classes
echo "=== builder-preview.tsx ==="
cat -n src/components/builder/builder-preview.tsx
# Check experience-form for position input structure
echo "=== Position input in experience-form ==="
rg -n -B3 -A8 'value={exp.position}' src/components/builder/forms/experience-form.tsxRepository: lab68dev/lab68cvbuilder Length of output: 12658 🏁 Script executed: #!/bin/bash
# Check builder-client.tsx full content
echo "=== builder-client.tsx ==="
cat -n src/components/builder/builder-client.tsx
# Check for builder layout
echo "=== builder-layout.tsx ==="
cat -n src/components/builder/builder-layout.tsx 2>/dev/null || echo "Not found"
# Search for ResumeScorePanel usage
echo "=== ResumeScorePanel usage ==="
rg -rn 'ResumeScorePanel' src 2>/dev/nullRepository: lab68dev/lab68cvbuilder Length of output: 8088 This spec will not meaningfully exercise the flow it describes — multiple correctness issues. Several problems combine to make this E2E test either flaky, silently passing without doing anything, or outright failing:
Given the scope of rework, I'd recommend landing this behind a skipped 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npx drizzle-kit checkwill fail in CI unlessDATABASE_URLis provided.drizzle.config.tsthrows whenprocess.env.DATABASE_URLis missing, and this workflow doesn’t set it. SetDATABASE_URLfrom a GitHub secret (or spin up a Postgres service and pointDATABASE_URLat it) for this step.