feat(agent-system): Days 1-6 complete - Enterprise multi-agent coordi… #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Agent System Tests | ||
|
Check failure on line 1 in .github/workflows/agent-system-tests.yml
|
||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| pull_request: | ||
| branches: [main, develop] | ||
| env: | ||
| NODE_VERSION: "20" | ||
| BUN_VERSION: "1.2.0" | ||
| jobs: | ||
| agent-system-tests: | ||
| name: Agent System CI/CD Pipeline | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| test-suite: ["unit-tests", "integration-tests", "performance-tests", "e2e-tests"] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
| - name: Install dependencies | ||
| run: | | ||
| bun install | ||
| - name: Cache Bun modules | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: ~/.bun/install/cache | ||
| key: ${{ runner.os }}-bun-${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }} | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: "npm" | ||
| - name: Run TypeScript check | ||
| run: | | ||
| bun run typecheck | ||
| - name: Run linting | ||
| run: | | ||
| bun run lint | ||
| - name: Run unit tests | ||
| if: matrix.test-suite == 'unit-tests' | ||
| run: | | ||
| bun test packages/opencode/src/agent/subagent/__tests__/*.test.ts --reporter=verbose | ||
| env: | ||
| NODE_ENV: test | ||
| - name: Run integration tests | ||
| if: matrix.test-suite == 'integration-tests' | ||
| run: | | ||
| bun test packages/opencode/src/agent/subagent/__tests__/integration.test.ts --reporter=verbose | ||
| env: | ||
| NODE_ENV: test | ||
| - name: Run performance benchmarks | ||
| if: matrix.test-suite == 'performance-tests' | ||
| run: | | ||
| bun test packages/opencode/src/agent/subagent/__tests__/performance.test.ts --reporter=verbose | ||
| env: | ||
| NODE_ENV: test | ||
| PERFORMANCE_TESTING: "true" | ||
| - name: Run end-to-end tests | ||
| if: matrix.test-suite == 'e2e-tests' | ||
| run: | | ||
| bun test packages/opencode/src/agent/subagent/__tests__/e2e.test.ts --reporter=verbose | ||
| env: | ||
| NODE_ENV: test | ||
| E2E_TESTING: "true" | ||
| - name: Generate test coverage | ||
| if: success() && matrix.test-suite == 'unit-tests' | ||
| run: | | ||
| bun test --coverage | ||
| - name: Upload coverage reports | ||
| if: success() && matrix.test-suite == 'unit-tests' | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| flags: agent-system-tests | ||
| files: | | ||
| ./coverage/lcov.info | ||
| ./coverage/cobertura.xml | ||
| - name: Performance regression analysis | ||
| if: matrix.test-suite == 'performance-tests' | ||
| run: | | ||
| node packages/opencode/scripts/performance-analysis.js | ||
| continue-on-error: true | ||
| - name: Upload test artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-results-${{ matrix.test-suite }} | ||
| path: | | ||
| test-results/ | ||
| coverage/ | ||
| retention-days: 30 | ||
| - name: Test suite summary | ||
| if: always() | ||
| run: | | ||
| echo "Test suite: ${{ matrix.test-suite }}" | ||
| echo "Status: ${{ job.status }}" | ||
| echo "Timestamp: $(date -u)" | ||
| agent-system-integration: | ||
| name: Agent System Full Integration | ||
| runs-on: ubuntu-latest | ||
| needs: [agent-system-tests] | ||
| if: github.event_name == 'pull_request' | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
| - name: Install dependencies | ||
| run: bun install | ||
| - name: Run complete agent system test suite | ||
| run: | | ||
| bun test packages/opencode/src/agent/subagent/__tests__/ --reporter=verbose --timeout=300000 | ||
| env: | ||
| NODE_ENV: test | ||
| INTEGRATION_TESTING: "true" | ||
| - name: Generate integration report | ||
| run: | | ||
| node packages/opencode/scripts/integration-report.js | ||
| continue-on-error: true | ||
| - name: Performance baseline comparison | ||
| run: | | ||
| node packages/opencode/scripts/baseline-comparison.js | ||
| continue-on-error: true | ||
| - name: Upload integration artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: integration-report | ||
| path: | | ||
| integration-reports/ | ||
| retention-days: 30 | ||
| - name: Create performance comment | ||
| if: always() && github.event_name == 'pull_request' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| let comment = '## Agent System Test Results\n\n'; | ||
| try { | ||
| const reportPath = path.join(process.cwd(), 'integration-reports', 'performance-report.json'); | ||
| if (fs.existsSync(reportPath)) { | ||
| const report = JSON.parse(fs.readFileSync(reportPath, 'utf8')); | ||
| comment += `### Performance Analysis\n`; | ||
| comment += `- Average Response Time: ${report.averageResponseTime}ms\n`; | ||
| comment += `- Memory Usage: ${report.memoryUsage.peak}MB\n`; | ||
| comment += `- Throughput: ${report.throughput.messagesPerSecond} msgs/sec\n`; | ||
| comment += `- Success Rate: ${report.successRate}%\n\n`; | ||
| } | ||
| } catch (error) { | ||
| comment += '### Performance Analysis\n_Report not available_\n\n'; | ||
| } | ||
| try { | ||
| const coveragePath = path.join(process.cwd(), 'coverage', 'summary.json'); | ||
| if (fs.existsSync(coveragePath)) { | ||
| const coverage = JSON.parse(fs.readFileSync(coveragePath, 'utf8')); | ||
| comment += `### Code Coverage\n`; | ||
| comment += `- Statements: ${coverage.statements.pct}%\n`; | ||
| comment += `- Branches: ${coverage.branches.pct}%\n`; | ||
| comment += `- Functions: ${coverage.functions.pct}%\n`; | ||
| comment += `- Lines: ${coverage.lines.pct}%\n\n`; | ||
| } | ||
| } catch (error) { | ||
| comment += '### Code Coverage\n_Report not available_\n\n'; | ||
| } | ||
| comment += '### Test Summary\n'; | ||
| comment += `- **Status**: ${{ job.status == 'success' ? '✅ Passed' : '❌ Failed' }}\n`; | ||
| comment += `- **Test Suite**: Agent System Integration\n`; | ||
| comment += `- **Timestamp**: ${new Date().toISOString()}\n`; | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: comment | ||
| }); | ||
| agent-system-deployment: | ||
| name: Agent System Deployment Verification | ||
| runs-on: ubuntu-latest | ||
| needs: [agent-system-integration] | ||
| if: github.ref == 'refs/heads/main' | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
| - name: Install dependencies | ||
| run: bun install | ||
| - name: Build agent system | ||
| run: | | ||
| bun run build:agent-system | ||
| - name: Deploy to staging | ||
| run: | | ||
| echo "Deploying agent system to staging environment" | ||
| # Add deployment commands here | ||
| - name: Run deployment smoke tests | ||
| run: | | ||
| node packages/opencode/scripts/deployment-smoke-tests.js | ||
| continue-on-error: true | ||
| - name: Verify deployment | ||
| run: | | ||
| echo "Verifying agent system deployment" | ||
| # Add verification commands here | ||
| - name: Create deployment report | ||
| run: | | ||
| node packages/opencode/scripts/deployment-report.js | ||
| continue-on-error: true | ||
| - name: Upload deployment artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: deployment-report | ||
| path: | | ||
| deployment-reports/ | ||
| retention-days: 90 | ||