Skip to content

Commit 2657992

Browse files
committed
refactor: move test scripts to examples directory
将测试脚本从项目根目录移至 examples 文件夹,并更新相应的导入路径。 这样改进了项目结构,使测试示例更有组织性,同时保持了主目录的整洁。 删除了未使用的 README.md 文件。
1 parent 8ef02e6 commit 2657992

File tree

3 files changed

+18
-218
lines changed

3 files changed

+18
-218
lines changed

packages/remote-agent/bin/README.md

Lines changed: 0 additions & 200 deletions
This file was deleted.

packages/remote-agent/quick-test-agent.js renamed to packages/remote-agent/examples/quick-test-agent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ async function quickTest (issueConfig) {
3030

3131
// Check if agent is built
3232
try {
33-
const { AIAgent } = require('./dist/agent.js')
34-
const { IssueAnalysisPlaybook } = require('./dist/playbooks/index.js')
33+
const { AIAgent } = require('../dist/agent.js')
34+
const { IssueAnalysisPlaybook } = require('../dist/playbooks')
3535
console.log('✅ Agent module loaded successfully')
3636

3737
// Check environment

packages/remote-agent/test-feature-request.js renamed to packages/remote-agent/examples/test-feature-request.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ async function testFeatureRequestImplementation(issueConfig) {
3333
console.log(`📝 Description: ${issueConfig.description}`)
3434

3535
try {
36-
const { AIAgent } = require('./dist/agent.js')
37-
const { FeatureRequestPlaybook } = require('./dist/playbooks/index.js')
36+
const { AIAgent } = require('../dist/agent.js')
37+
const { FeatureRequestPlaybook } = require('../dist/playbooks')
3838
console.log('✅ FeatureRequestPlaybook loaded successfully')
3939

4040
// Check environment
@@ -119,7 +119,7 @@ async function testFeatureRequestImplementation(issueConfig) {
119119
const status = result.success ? '✅' : '❌'
120120
const toolName = result.functionCall.name
121121
console.log(` ${i + 1}. ${toolName} - ${status}`)
122-
122+
123123
// Show details for important tools
124124
if (toolName === 'str-replace-editor' && result.success) {
125125
const params = result.functionCall.parameters
@@ -130,10 +130,10 @@ async function testFeatureRequestImplementation(issueConfig) {
130130
}
131131

132132
// Check code modification tools
133-
const codeModificationTools = response.toolResults.filter(r =>
133+
const codeModificationTools = response.toolResults.filter(r =>
134134
r.functionCall.name === 'str-replace-editor' && r.success
135135
)
136-
136+
137137
console.log(`\n💻 Code Modifications: ${codeModificationTools.length} file(s) changed`)
138138
if (codeModificationTools.length > 0) {
139139
console.log('📝 Modified files:')
@@ -160,13 +160,13 @@ async function testFeatureRequestImplementation(issueConfig) {
160160
}
161161

162162
// Analyze implementation content
163-
const hasRequirements = response.text.toLowerCase().includes('requirement') ||
163+
const hasRequirements = response.text.toLowerCase().includes('requirement') ||
164164
response.text.toLowerCase().includes('feature')
165-
const hasTechnicalAnalysis = response.text.toLowerCase().includes('technical') ||
165+
const hasTechnicalAnalysis = response.text.toLowerCase().includes('technical') ||
166166
response.text.toLowerCase().includes('implementation')
167-
const hasImplementationPlan = response.text.toLowerCase().includes('plan') ||
167+
const hasImplementationPlan = response.text.toLowerCase().includes('plan') ||
168168
response.text.toLowerCase().includes('roadmap')
169-
const hasCodeChanges = response.text.toLowerCase().includes('code') ||
169+
const hasCodeChanges = response.text.toLowerCase().includes('code') ||
170170
response.text.toLowerCase().includes('implementation')
171171

172172
console.log(`\n📋 Implementation Analysis:`)
@@ -195,16 +195,16 @@ async function testFeatureRequestImplementation(issueConfig) {
195195
console.log('='.repeat(80))
196196

197197
// Determine test success
198-
const testSuccess = response.success &&
199-
response.totalRounds >= 2 &&
198+
const testSuccess = response.success &&
199+
response.totalRounds >= 2 &&
200200
response.toolResults.length >= 4 &&
201-
hasRequirements &&
201+
hasRequirements &&
202202
hasTechnicalAnalysis &&
203203
hasImplementationPlan &&
204204
(issueConfig.validateCodeChanges ? codeModificationTools.length > 0 : true)
205205

206206
console.log(`\n${testSuccess ? '🎉 TEST PASSED' : '❌ TEST FAILED'}`)
207-
207+
208208
return {
209209
success: testSuccess,
210210
codeModifications: codeModificationTools.length,
@@ -356,7 +356,7 @@ if (require.main === module) {
356356

357357
const passedCount = results.filter(r => r.success).length
358358
const totalModifications = results.reduce((sum, r) => sum + (r.codeModifications || 0), 0)
359-
359+
360360
console.log(`\n📊 Overall Results:`)
361361
console.log(` Tests: ${passedCount}/${results.length} passed`)
362362
console.log(` Code modifications: ${totalModifications} file(s) total`)
@@ -370,8 +370,8 @@ if (require.main === module) {
370370
}
371371

372372
// Export for use in other tests
373-
module.exports = {
374-
testFeatureRequestImplementation,
373+
module.exports = {
374+
testFeatureRequestImplementation,
375375
featureRequestIssues,
376376
getRoundDescription,
377377
extractImplementationSections

0 commit comments

Comments
 (0)