Skip to content

Commit 2d9ed90

Browse files
committed
Fix aicode-agent test: Update to match new workflow structure
- Add test for aicode-preprocess.yml workflow (triggers on aicode) - Update test for aicode-agent.yml workflow (triggers on aicode-enhanced) - All 241 tests now passing
1 parent b6e3593 commit 2d9ed90

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

test/aicode-agent.test.mjs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@ describe('AI Code Agent Integration', function() {
2525
});
2626

2727
describe('GitHub Actions Workflow', function() {
28+
it('should have aicode-preprocess.yml workflow file', function() {
29+
const workflowPath = path.join(process.cwd(), '.github', 'workflows', 'aicode-preprocess.yml');
30+
31+
// Verify file exists
32+
if (!fs.existsSync(workflowPath)) {
33+
throw new Error(`Preprocess workflow file not found at: ${workflowPath}\nCurrent directory: ${process.cwd()}\nFiles in .github/workflows: ${fs.readdirSync(path.join(process.cwd(), '.github', 'workflows')).join(', ')}`);
34+
}
35+
36+
const content = fs.readFileSync(workflowPath, 'utf8');
37+
38+
// Verify it's actually a YAML file, not a JavaScript file
39+
if (content.includes('#!/usr/bin/env node') || content.includes('import fs from')) {
40+
throw new Error(`Wrong file read! Expected YAML workflow file but got JavaScript.\nPath: ${workflowPath}\nFirst 200 chars: ${content.substring(0, 200)}`);
41+
}
42+
43+
// Check it's triggered by repository_dispatch with aicode
44+
expect(content).to.include('repository_dispatch:');
45+
expect(content).to.include('types: [aicode]');
46+
47+
// Check it runs the preprocessing script
48+
expect(content).to.include('preprocess-task.mjs');
49+
50+
// Check it dispatches enhanced event
51+
expect(content).to.include('aicode-enhanced');
52+
});
53+
2854
it('should have aicode-agent.yml workflow file', function() {
2955
const workflowPath = path.join(process.cwd(), '.github', 'workflows', 'aicode-agent.yml');
3056

@@ -40,9 +66,9 @@ describe('AI Code Agent Integration', function() {
4066
throw new Error(`Wrong file read! Expected YAML workflow file but got JavaScript.\nPath: ${workflowPath}\nFirst 200 chars: ${content.substring(0, 200)}`);
4167
}
4268

43-
// Check it's triggered by repository_dispatch
69+
// Check it's triggered by repository_dispatch with aicode-enhanced (after preprocessing)
4470
expect(content).to.include('repository_dispatch:');
45-
expect(content).to.include('types: [aicode]');
71+
expect(content).to.include('types: [aicode-enhanced]');
4672

4773
// Check it runs the agent (supports multiple providers now)
4874
expect(content).to.include('node .github/agent/agent.mjs');
@@ -103,4 +129,3 @@ describe('AI Code Agent Integration', function() {
103129
});
104130
});
105131
});
106-

0 commit comments

Comments
 (0)