Skip to content

Commit c5dfdf9

Browse files
author
Kyle Walker
committed
feat: testing CI changes
1 parent c10fe78 commit c5dfdf9

File tree

3 files changed

+60
-18
lines changed

3 files changed

+60
-18
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,34 @@ jobs:
6666
echo " RUNNER_TEMP: $RUNNER_TEMP"
6767
echo " TMPDIR: $TMPDIR"
6868
echo " PWD: $PWD"
69-
echo "Checking test workspace setup..."
70-
ls -la e2e-tests/
71-
echo "Running Playwright tests from root directory..."
72-
cd e2e-tests && npx playwright test --reporter=line
69+
echo "Test workspace path: $RUNNER_TEMP/apex-e2e-workspace"
70+
echo "Running Playwright tests with proper CI configuration..."
71+
cd e2e-tests && npx playwright test
7372
env:
7473
CI: true
7574
DEBUG: pw:webserver
7675

77-
- name: Upload test results
76+
- name: Upload test results and artifacts
7877
if: always()
7978
uses: actions/upload-artifact@v4
8079
with:
81-
name: playwright-report
82-
path: e2e-tests/playwright-report/
80+
name: playwright-results-${{ github.run_number }}
81+
path: |
82+
e2e-tests/playwright-report/
83+
e2e-tests/test-results/
8384
retention-days: 30
85+
if-no-files-found: warn
8486

85-
- name: Upload test screenshots
86-
if: failure()
87-
uses: actions/upload-artifact@v4
88-
with:
89-
name: playwright-screenshots
90-
path: e2e-tests/test-results/
91-
retention-days: 30
87+
- name: Debug artifact directories
88+
if: always()
89+
run: |
90+
echo "🔍 Debugging artifact directories..."
91+
echo "Current working directory: $(pwd)"
92+
echo "e2e-tests directory contents:"
93+
ls -la e2e-tests/ || echo "e2e-tests directory not found"
94+
echo "playwright-report directory:"
95+
ls -la e2e-tests/playwright-report/ || echo "playwright-report directory not found"
96+
echo "test-results directory:"
97+
ls -la e2e-tests/test-results/ || echo "test-results directory not found"
98+
echo "Searching for any Playwright artifacts..."
99+
find . -name "*.png" -o -name "*.webm" -o -name "*.html" | head -20

e2e-tests/playwright.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ export default defineConfig({
2020
forbidOnly: !!process.env.CI,
2121
retries: process.env.CI ? 2 : 0,
2222
workers: process.env.CI || process.env.DEBUG_MODE ? 1 : undefined,
23-
reporter: 'html',
23+
reporter: process.env.CI
24+
? [['html'], ['line'], ['junit', { outputFile: 'test-results/junit.xml' }]]
25+
: 'html',
2426

2527
use: {
2628
baseURL: 'http://localhost:3000',
27-
trace: 'on-first-retry',
28-
screenshot: 'only-on-failure',
29-
video: 'retain-on-failure',
29+
trace: process.env.CI ? 'retain-on-failure' : 'on-first-retry',
30+
screenshot: process.env.CI ? 'on' : 'only-on-failure',
31+
video: process.env.CI ? 'on' : 'retain-on-failure',
3032
actionTimeout: 15000,
3133
},
3234

e2e-tests/test-server.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,27 @@ async function startTestServer() {
6262

6363
fs.mkdirSync(workspacePath, { recursive: true });
6464

65+
// Copy test workspace files in CI environment
66+
if (process.env.CI) {
67+
const sourceWorkspace = path.resolve(__dirname, './test-workspace');
68+
if (fs.existsSync(sourceWorkspace)) {
69+
console.log(
70+
`📋 Copying test workspace from ${sourceWorkspace} to ${workspacePath}`,
71+
);
72+
const files = fs.readdirSync(sourceWorkspace);
73+
files.forEach((file) => {
74+
const src = path.join(sourceWorkspace, file);
75+
const dest = path.join(workspacePath, file);
76+
fs.copyFileSync(src, dest);
77+
});
78+
console.log('✅ Test workspace files copied successfully');
79+
} else {
80+
console.warn(
81+
'⚠️ Source test workspace not found, creating empty workspace',
82+
);
83+
}
84+
}
85+
6586
console.log('🌐 Starting VS Code Web Test Server...');
6687
console.log(`📁 Extension path: ${extensionDevelopmentPath}`);
6788
console.log(`📂 Workspace path: ${workspacePath}`);
@@ -78,6 +99,17 @@ async function startTestServer() {
7899
);
79100
});
80101

102+
// Log workspace files for debugging
103+
console.log('📋 Workspace files:');
104+
const workspaceFiles = fs.readdirSync(workspacePath);
105+
workspaceFiles.forEach((file) => {
106+
const filePath = path.join(workspacePath, file);
107+
const stats = fs.statSync(filePath);
108+
console.log(
109+
` ${file} (${stats.isDirectory() ? 'dir' : stats.size + ' bytes'})`,
110+
);
111+
});
112+
81113
// Start the web server (this will keep running)
82114
await runTests({
83115
extensionDevelopmentPath,

0 commit comments

Comments
 (0)