Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

harness-pipeline-template.yaml 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # Harness CI Pipeline for Test Execution
  2. # Generated by BMad TEA Agent - Test Architect Module
  3. # Optimized for: Parallel Sharding, Burn-In Loop
  4. # Stack: {test_stack_type} | Framework: {test_framework}
  5. #
  6. # Variables to customize per project:
  7. # INSTALL_CMD - dependency install command (e.g., npm ci, pnpm install --frozen-lockfile)
  8. # TEST_CMD - main test command (e.g., npm run test:e2e, npm test, npx vitest)
  9. # LINT_CMD - lint command (e.g., npm run lint)
  10. # BROWSER_INSTALL - browser install command (frontend/fullstack only; omit for backend)
  11. # PLAYWRIGHT_IMAGE - keep in sync with your @playwright/test version (example: mcr.microsoft.com/playwright:v1.58.2-noble)
  12. pipeline:
  13. name: Test Pipeline
  14. identifier: test_pipeline
  15. projectIdentifier: default
  16. orgIdentifier: default
  17. stages:
  18. # Lint stage - Code quality checks
  19. - stage:
  20. name: Lint
  21. identifier: lint
  22. type: CI
  23. spec:
  24. cloneCodebase: true
  25. infrastructure:
  26. type: KubernetesDirect
  27. spec:
  28. connectorRef: account.harnessImage
  29. namespace: default
  30. execution:
  31. steps:
  32. - step:
  33. type: Run
  34. name: Install dependencies
  35. identifier: install
  36. spec:
  37. connectorRef: account.harnessImage
  38. image: node:24
  39. shell: Sh
  40. command: npm ci # Replace with INSTALL_CMD
  41. - step:
  42. type: Run
  43. name: Run linter
  44. identifier: lint
  45. spec:
  46. connectorRef: account.harnessImage
  47. image: node:24
  48. shell: Sh
  49. command: npm run lint # Replace with LINT_CMD
  50. # Test stage - Parallel execution with sharding
  51. - stage:
  52. name: Test
  53. identifier: test
  54. type: CI
  55. spec:
  56. cloneCodebase: true
  57. infrastructure:
  58. type: KubernetesDirect
  59. spec:
  60. connectorRef: account.harnessImage
  61. namespace: default
  62. execution:
  63. steps:
  64. - step:
  65. type: Run
  66. name: Install dependencies
  67. identifier: install
  68. spec:
  69. connectorRef: account.harnessImage
  70. image: node:24
  71. shell: Sh
  72. command: npm ci # Replace with INSTALL_CMD
  73. # Frontend/Fullstack only — remove this step for backend-only stacks
  74. - step:
  75. type: Run
  76. name: Install browsers
  77. identifier: browsers
  78. spec:
  79. connectorRef: account.harnessImage
  80. image: mcr.microsoft.com/playwright:v1.58.2-noble # Replace with PLAYWRIGHT_IMAGE
  81. shell: Sh
  82. command: npx playwright install --with-deps chromium # Replace with BROWSER_INSTALL
  83. - parallel:
  84. - step:
  85. type: Run
  86. name: Test Shard 1
  87. identifier: shard_1
  88. spec:
  89. connectorRef: account.harnessImage
  90. image: mcr.microsoft.com/playwright:v1.58.2-noble # Replace with PLAYWRIGHT_IMAGE
  91. shell: Sh
  92. command: npm run test:e2e -- --shard=1/4 # Replace with TEST_CMD + shard args
  93. - step:
  94. type: Run
  95. name: Test Shard 2
  96. identifier: shard_2
  97. spec:
  98. connectorRef: account.harnessImage
  99. image: mcr.microsoft.com/playwright:v1.58.2-noble # Replace with PLAYWRIGHT_IMAGE
  100. shell: Sh
  101. command: npm run test:e2e -- --shard=2/4 # Replace with TEST_CMD + shard args
  102. - step:
  103. type: Run
  104. name: Test Shard 3
  105. identifier: shard_3
  106. spec:
  107. connectorRef: account.harnessImage
  108. image: mcr.microsoft.com/playwright:v1.58.2-noble # Replace with PLAYWRIGHT_IMAGE
  109. shell: Sh
  110. command: npm run test:e2e -- --shard=3/4 # Replace with TEST_CMD + shard args
  111. - step:
  112. type: Run
  113. name: Test Shard 4
  114. identifier: shard_4
  115. spec:
  116. connectorRef: account.harnessImage
  117. image: mcr.microsoft.com/playwright:v1.58.2-noble # Replace with PLAYWRIGHT_IMAGE
  118. shell: Sh
  119. command: npm run test:e2e -- --shard=4/4 # Replace with TEST_CMD + shard args
  120. # Burn-in stage - Flaky test detection
  121. # Note: Burn-in targets UI flakiness. For backend-only stacks, remove this stage entirely.
  122. - stage:
  123. name: Burn-In
  124. identifier: burn_in
  125. type: CI
  126. when:
  127. condition: <+pipeline.triggerType> == "WEBHOOK" || <+pipeline.triggerType> == "SCHEDULER"
  128. spec:
  129. cloneCodebase: true
  130. infrastructure:
  131. type: KubernetesDirect
  132. spec:
  133. connectorRef: account.harnessImage
  134. namespace: default
  135. execution:
  136. steps:
  137. - step:
  138. type: Run
  139. name: Install and burn-in
  140. identifier: burn_in_loop
  141. spec:
  142. connectorRef: account.harnessImage
  143. image: mcr.microsoft.com/playwright:v1.58.2-noble # Replace with PLAYWRIGHT_IMAGE
  144. shell: Sh
  145. command: |
  146. npm ci
  147. npx playwright install --with-deps chromium
  148. echo "Starting burn-in loop - detecting flaky tests"
  149. for i in $(seq 1 10); do
  150. echo "Burn-in iteration $i/10"
  151. npm run test:e2e || exit 1
  152. done
  153. echo "Burn-in complete - no flaky tests detected"
  154. # Replace npm ci with INSTALL_CMD, npm run test:e2e with TEST_CMD