feat(cli): provision server-side inbound integration bridge in integration subscribe
#1422
Workflow file for this run
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: Stress Tests | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'packages/cli/src/**' | |
| - 'scripts/stress-test-*.sh' | |
| - 'scripts/stress-test-*.mjs' | |
| - 'scripts/stress-test-*.mts' | |
| - '.github/workflows/stress-tests.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'packages/cli/src/**' | |
| - 'scripts/stress-test-*.sh' | |
| - 'scripts/stress-test-*.mjs' | |
| - 'scripts/stress-test-*.mts' | |
| - '.github/workflows/stress-tests.yml' | |
| # Allow manual trigger for on-demand stress testing | |
| workflow_dispatch: | |
| # Run weekly to catch performance regressions | |
| schedule: | |
| - cron: '0 6 * * 1' # Every Monday at 6 AM UTC | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| stress-test-orchestrator: | |
| name: Orchestrator Stress Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| node-version: [20] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run orchestrator stress tests | |
| id: orchestrator-stress | |
| run: | | |
| node scripts/stress-test-orchestrator.mjs --json > orchestrator-results.json || echo "exit_code=$?" >> $GITHUB_OUTPUT | |
| cat orchestrator-results.json | |
| continue-on-error: true | |
| - name: Upload orchestrator results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orchestrator-stress-results-${{ matrix.os }}-node${{ matrix.node-version }} | |
| path: orchestrator-results.json | |
| retention-days: 30 | |
| - name: Check orchestrator results | |
| run: | | |
| if ! node -e " | |
| const fs = require('fs'); | |
| const results = JSON.parse(fs.readFileSync('orchestrator-results.json', 'utf8')); | |
| console.log('All tests passed:', results.passed); | |
| console.log('Failures:', results.failures); | |
| process.exit(results.passed ? 0 : 1); | |
| "; then | |
| echo "::error::Orchestrator stress tests failed" | |
| exit 1 | |
| fi | |
| stress-test-orchestrator-integration: | |
| name: Orchestrator Integration Stress Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| node-version: [20] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build packages | |
| run: npm run build | |
| - name: Run orchestrator integration stress tests | |
| id: integration-stress | |
| run: | | |
| if [ ! -f packages/daemon/src/orchestrator.ts ]; then | |
| echo "packages/daemon/src/orchestrator.ts not present; skipping integration stress test for this repo layout" | |
| cat > integration-results.json << 'EOF' | |
| { | |
| "passed": true, | |
| "failures": 0, | |
| "tests": {}, | |
| "summary": { | |
| "total_tests": 0, | |
| "passed_tests": 0, | |
| "failed_tests": 0, | |
| "total_time_ms": 0 | |
| }, | |
| "skipped": true, | |
| "reason": "packages/daemon/src/orchestrator.ts not present" | |
| } | |
| EOF | |
| else | |
| npx tsx scripts/stress-test-orchestrator-integration.mts --json --output=integration-results.json || echo "exit_code=$?" >> $GITHUB_OUTPUT | |
| fi | |
| cat integration-results.json | |
| continue-on-error: true | |
| - name: Upload integration results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orchestrator-integration-results-${{ matrix.os }}-node${{ matrix.node-version }} | |
| path: integration-results.json | |
| retention-days: 30 | |
| - name: Check integration results | |
| run: | | |
| if ! node -e " | |
| const fs = require('fs'); | |
| const content = fs.readFileSync('integration-results.json', 'utf8'); | |
| let results; | |
| try { | |
| results = JSON.parse(content); | |
| } catch (e) { | |
| console.error('Failed to parse JSON. File contents:'); | |
| console.error(content.slice(0, 500)); | |
| console.error('Parse error:', e.message); | |
| process.exit(1); | |
| } | |
| console.log('All tests passed:', results.passed); | |
| console.log('Passed:', results.summary.passed_tests, '/', results.summary.total_tests); | |
| process.exit(results.passed ? 0 : 1); | |
| "; then | |
| echo "::error::Orchestrator integration stress tests failed" | |
| exit 1 | |
| fi | |
| stress-test-summary: | |
| name: Stress Test Summary | |
| needs: [stress-test-orchestrator, stress-test-orchestrator-integration] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: stress-results | |
| - name: Generate summary | |
| run: | | |
| echo "## Stress Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Orchestrator Mock Tests" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| for file in stress-results/orchestrator-stress-*/orchestrator-results.json; do | |
| if [ -f "$file" ]; then | |
| dirname=$(dirname "$file" | xargs basename) | |
| echo "#### $dirname" >> $GITHUB_STEP_SUMMARY | |
| echo '```json' >> $GITHUB_STEP_SUMMARY | |
| cat "$file" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done | |
| echo "### Orchestrator Integration Tests" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| for file in stress-results/orchestrator-integration-*/integration-results.json; do | |
| if [ -f "$file" ]; then | |
| dirname=$(dirname "$file" | xargs basename) | |
| echo "#### $dirname" >> $GITHUB_STEP_SUMMARY | |
| echo '```json' >> $GITHUB_STEP_SUMMARY | |
| cat "$file" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done | |
| - name: Check overall status | |
| if: needs.stress-test-orchestrator.result == 'failure' || needs.stress-test-orchestrator-integration.result == 'failure' | |
| run: | | |
| echo "::error::One or more stress tests failed" | |
| exit 1 |