migrate-tests.sh 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #!/bin/bash
  2. # Migration script to move existing tests to new folder structure
  3. # Run from: evals/agents/openagent/tests/
  4. set -e
  5. echo "🔄 Migrating OpenAgent tests to new folder structure..."
  6. echo ""
  7. # Function to move and rename test
  8. move_test() {
  9. local src=$1
  10. local dest=$2
  11. local new_name=$3
  12. if [ -f "$src" ]; then
  13. echo " Moving: $src"
  14. echo " → $dest/$new_name"
  15. cp "$src" "$dest/$new_name"
  16. else
  17. echo " ⚠️ Not found: $src"
  18. fi
  19. }
  20. # ============================================================
  21. # Phase 1: Critical Rules - Approval Gate
  22. # ============================================================
  23. echo "📁 01-critical-rules/approval-gate/"
  24. move_test "edge-case/no-approval-negative.yaml" \
  25. "01-critical-rules/approval-gate" \
  26. "01-skip-approval-detection.yaml"
  27. move_test "edge-case/missing-approval-negative.yaml" \
  28. "01-critical-rules/approval-gate" \
  29. "02-missing-approval-negative.yaml"
  30. move_test "business/conv-simple-001.yaml" \
  31. "01-critical-rules/approval-gate" \
  32. "03-conversational-no-approval.yaml"
  33. echo ""
  34. # ============================================================
  35. # Phase 1: Critical Rules - Context Loading
  36. # ============================================================
  37. echo "📁 01-critical-rules/context-loading/"
  38. move_test "developer/ctx-code-001.yaml" \
  39. "01-critical-rules/context-loading" \
  40. "01-code-task.yaml"
  41. move_test "developer/ctx-code-001-claude.yaml" \
  42. "01-critical-rules/context-loading" \
  43. "01-code-task-claude.yaml"
  44. move_test "developer/ctx-docs-001.yaml" \
  45. "01-critical-rules/context-loading" \
  46. "02-docs-task.yaml"
  47. move_test "developer/ctx-tests-001.yaml" \
  48. "01-critical-rules/context-loading" \
  49. "03-tests-task.yaml"
  50. move_test "developer/ctx-delegation-001.yaml" \
  51. "01-critical-rules/context-loading" \
  52. "04-delegation-task.yaml"
  53. move_test "developer/ctx-review-001.yaml" \
  54. "01-critical-rules/context-loading" \
  55. "05-review-task.yaml"
  56. move_test "context-loading/ctx-simple-coding-standards.yaml" \
  57. "01-critical-rules/context-loading" \
  58. "06-simple-coding-standards.yaml"
  59. move_test "context-loading/ctx-simple-documentation-format.yaml" \
  60. "01-critical-rules/context-loading" \
  61. "07-simple-documentation-format.yaml"
  62. move_test "context-loading/ctx-simple-testing-approach.yaml" \
  63. "01-critical-rules/context-loading" \
  64. "08-simple-testing-approach.yaml"
  65. move_test "context-loading/ctx-multi-standards-to-docs.yaml" \
  66. "01-critical-rules/context-loading" \
  67. "09-multi-standards-to-docs.yaml"
  68. move_test "context-loading/ctx-multi-error-handling-to-tests.yaml" \
  69. "01-critical-rules/context-loading" \
  70. "10-multi-error-handling-to-tests.yaml"
  71. echo ""
  72. # ============================================================
  73. # Phase 1: Critical Rules - Stop on Failure
  74. # ============================================================
  75. echo "📁 01-critical-rules/stop-on-failure/"
  76. move_test "developer/fail-stop-001.yaml" \
  77. "01-critical-rules/stop-on-failure" \
  78. "01-test-failure-stop.yaml"
  79. echo ""
  80. # ============================================================
  81. # Phase 2: Workflow Stages - Execute
  82. # ============================================================
  83. echo "📁 02-workflow-stages/execute/"
  84. move_test "developer/task-simple-001.yaml" \
  85. "02-workflow-stages/execute" \
  86. "01-simple-task.yaml"
  87. move_test "developer/create-component.yaml" \
  88. "02-workflow-stages/execute" \
  89. "02-create-component.yaml"
  90. echo ""
  91. # ============================================================
  92. # Phase 4: Execution Paths - Conversational
  93. # ============================================================
  94. echo "📁 04-execution-paths/conversational/"
  95. # Already moved conv-simple-001.yaml to approval-gate
  96. # (it tests both conversational path AND no-approval requirement)
  97. echo ""
  98. # ============================================================
  99. # Phase 4: Execution Paths - Task
  100. # ============================================================
  101. echo "📁 04-execution-paths/task/"
  102. move_test "developer/install-dependencies.yaml" \
  103. "04-execution-paths/task" \
  104. "01-install-dependencies.yaml"
  105. move_test "developer/install-dependencies-v2.yaml" \
  106. "04-execution-paths/task" \
  107. "02-install-dependencies-v2.yaml"
  108. echo ""
  109. # ============================================================
  110. # Phase 5: Edge Cases - Overrides
  111. # ============================================================
  112. echo "📁 05-edge-cases/overrides/"
  113. move_test "edge-case/just-do-it.yaml" \
  114. "05-edge-cases/overrides" \
  115. "01-just-do-it.yaml"
  116. echo ""
  117. # ============================================================
  118. # Phase 6: Integration - Medium
  119. # ============================================================
  120. echo "📁 06-integration/medium/"
  121. move_test "developer/ctx-multi-turn-001.yaml" \
  122. "06-integration/medium" \
  123. "01-multi-turn-context.yaml"
  124. move_test "business/data-analysis.yaml" \
  125. "06-integration/medium" \
  126. "02-data-analysis.yaml"
  127. echo ""
  128. echo "✅ Migration complete!"
  129. echo ""
  130. echo "📊 Summary:"
  131. echo " - Migrated tests are COPIED (originals preserved)"
  132. echo " - Review migrated tests before deleting originals"
  133. echo " - Run tests to verify: npm run eval:sdk -- --agent=openagent"
  134. echo ""
  135. echo "🗑️ To remove old folders after verification:"
  136. echo " rm -rf business/ context-loading/ developer/ edge-case/"
  137. echo ""