Skip to content

Commit d7c3fd0

Browse files
committed
fix: ci fix
1 parent 5ca3dee commit d7c3fd0

File tree

2 files changed

+69
-6
lines changed

2 files changed

+69
-6
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,34 @@ jobs:
2626
- name: Install dependencies
2727
run: npm ci
2828

29-
- name: Build extension
29+
- name: Build all packages and extension
3030
run: |
31+
echo "🔧 Building all packages..."
32+
npm run compile
33+
npm run bundle
34+
echo "🔧 Building VS Code extension..."
3135
cd packages/apex-lsp-vscode-extension
3236
npm run build
37+
echo "✅ Build completed"
38+
ls -la dist/
39+
40+
- name: Verify extension build
41+
run: |
42+
echo "🔍 Verifying extension build artifacts..."
43+
cd packages/apex-lsp-vscode-extension
44+
if [ ! -f "dist/package.json" ]; then
45+
echo "❌ package.json not found in dist"
46+
exit 1
47+
fi
48+
if [ ! -f "dist/extension.js" ]; then
49+
echo "❌ extension.js not found in dist"
50+
exit 1
51+
fi
52+
if [ ! -f "dist/extension.web.js" ]; then
53+
echo "❌ extension.web.js not found in dist"
54+
exit 1
55+
fi
56+
echo "✅ All required extension files present"
3357
3458
- name: Install Playwright browsers
3559
run: npx playwright install --with-deps chromium
@@ -38,6 +62,7 @@ jobs:
3862
run: npm run test:e2e
3963
env:
4064
CI: true
65+
DEBUG: pw:webserver
4166

4267
- name: Upload test results
4368
if: always()
@@ -53,4 +78,4 @@ jobs:
5378
with:
5479
name: playwright-screenshots
5580
path: e2e-tests/test-results/
56-
retention-days: 30
81+
retention-days: 30

e2e-tests/test-server.js

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,52 @@ async function startTestServer() {
2727
);
2828
}
2929

30-
if (!fs.existsSync(workspacePath)) {
31-
console.log('📁 Creating test workspace directory...');
32-
fs.mkdirSync(workspacePath, { recursive: true });
30+
// Verify extension is built (check for critical files)
31+
const distPath = path.join(extensionDevelopmentPath, 'dist');
32+
const packageJsonPath = path.join(distPath, 'package.json');
33+
const extensionJsPath = path.join(distPath, 'extension.js');
34+
const extensionWebJsPath = path.join(distPath, 'extension.web.js');
35+
36+
if (!fs.existsSync(distPath)) {
37+
throw new Error(
38+
`Extension dist directory not found: ${distPath}. Run 'npm run build' in the extension directory first.`,
39+
);
40+
}
41+
42+
if (!fs.existsSync(packageJsonPath)) {
43+
throw new Error(
44+
`Extension package.json not found in dist: ${packageJsonPath}. Extension build may be incomplete.`,
45+
);
46+
}
47+
48+
if (!fs.existsSync(extensionJsPath)) {
49+
throw new Error(
50+
`Extension main file not found: ${extensionJsPath}. Extension build may be incomplete.`,
51+
);
52+
}
53+
54+
if (!fs.existsSync(extensionWebJsPath)) {
55+
console.warn(
56+
`⚠️ Extension web file not found: ${extensionWebJsPath}. Web functionality may be limited.`,
57+
);
3358
}
59+
fs.mkdirSync(workspacePath, { recursive: true });
3460

3561
console.log('🌐 Starting VS Code Web Test Server...');
3662
console.log(`📁 Extension path: ${extensionDevelopmentPath}`);
3763
console.log(`📂 Workspace path: ${workspacePath}`);
64+
console.log(`🔍 CI environment: ${process.env.CI ? 'Yes' : 'No'}`);
65+
66+
// Log extension files for debugging
67+
console.log('📋 Extension files:');
68+
const distFiles = fs.readdirSync(distPath);
69+
distFiles.forEach((file) => {
70+
const filePath = path.join(distPath, file);
71+
const stats = fs.statSync(filePath);
72+
console.log(
73+
` ${file} (${stats.isDirectory() ? 'dir' : stats.size + ' bytes'})`,
74+
);
75+
});
3876

3977
// Start the web server (this will keep running)
4078
await runTests({
@@ -77,4 +115,4 @@ process.on('SIGTERM', () => {
77115

78116
if (require.main === module) {
79117
startTestServer();
80-
}
118+
}

0 commit comments

Comments
 (0)