-
Notifications
You must be signed in to change notification settings - Fork 138
[CI] Add weekly conformance run against latest upstream release #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| name: conformance-weekly | ||
|
|
||
| # Runs the MCP conformance suite on a weekly schedule against the | ||
| # latest @modelcontextprotocol/conformance release. The on:pull_request | ||
| # pipeline already pins to the version of the conformance package | ||
| # available at PR time; this schedule catches upstream releases that | ||
| # add new scenarios between PRs and would otherwise stay invisible. | ||
| on: | ||
| schedule: | ||
| # Mondays 06:00 UTC | ||
| - cron: '0 6 * * 1' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
|
|
||
| jobs: | ||
| conformance-server: | ||
| name: conformance / server (latest) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Install Composer | ||
| uses: "ramsey/composer-install@v4" | ||
|
|
||
| - name: Show conformance version | ||
| run: npx --yes @modelcontextprotocol/conformance@latest --version | ||
|
|
||
| - name: Start conformance server | ||
| run: | | ||
| mkdir -p tests/Conformance/sessions tests/Conformance/logs | ||
| chmod -R 777 tests/Conformance/sessions tests/Conformance/logs | ||
| docker compose -f tests/Conformance/Fixtures/docker-compose.yml up -d | ||
| sleep 5 | ||
|
|
||
| - name: Run conformance tests | ||
| working-directory: ./tests/Conformance | ||
| run: npx --yes @modelcontextprotocol/conformance@latest server --url http://localhost:8000/ --expected-failures conformance-baseline.yml | ||
|
|
||
| - name: Show logs on failure | ||
| if: failure() | ||
| run: | | ||
| echo "=== Docker Compose Logs ===" | ||
| docker compose -f tests/Conformance/Fixtures/docker-compose.yml logs | ||
| echo "" | ||
| echo "=== Conformance Log ===" | ||
| cat tests/Conformance/logs/conformance.log 2>/dev/null || echo "No conformance log found" | ||
| echo "" | ||
| echo "=== Test Results (first failed test) ===" | ||
| find tests/Conformance/results -name "checks.json" 2>/dev/null | head -3 | while read f; do | ||
| echo "--- $f ---" | ||
| cat "$f" | ||
| echo "" | ||
| done || echo "No results found" | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: docker compose -f tests/Conformance/Fixtures/docker-compose.yml down | ||
|
|
||
| conformance-client: | ||
| name: conformance / client (latest) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.4' | ||
| coverage: "none" | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Install Composer | ||
| uses: "ramsey/composer-install@v4" | ||
|
|
||
| - name: Show conformance version | ||
| run: npx --yes @modelcontextprotocol/conformance@latest --version | ||
|
|
||
| - name: Create log directory | ||
| run: mkdir -p tests/Conformance/logs | ||
|
|
||
| - name: Run client conformance tests | ||
| working-directory: ./tests/Conformance | ||
| run: npx --yes @modelcontextprotocol/conformance@latest client --command "php ${{ github.workspace }}/tests/Conformance/client.php" --suite all --expected-failures conformance-baseline.yml | ||
|
|
||
| - name: Show logs on failure | ||
| if: failure() | ||
| run: | | ||
| echo "=== Client Conformance Log ===" | ||
| cat tests/Conformance/logs/client-conformance.log 2>/dev/null || echo "No client conformance log found" | ||
| echo "" | ||
| echo "=== Test Results ===" | ||
| find tests/Conformance/results -name "checks.json" 2>/dev/null | head -3 | while read f; do | ||
| echo "--- $f ---" | ||
| cat "$f" | ||
| echo "" | ||
| done || echo "No results found" | ||
|
|
||
| notify: | ||
| name: Open issue on failure | ||
| runs-on: ubuntu-latest | ||
| needs: [conformance-server, conformance-client] | ||
| if: failure() && github.event_name == 'schedule' | ||
| steps: | ||
| - name: File or update tracking issue | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const marker = '<!-- conformance-weekly-failure -->'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure we really need this notify section, what do you think about running this weekly?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm in favor for giving it a go - if we don't act on it and things just pile up, we can kill it easily again |
||
| const title = '[conformance] Weekly conformance run failed'; | ||
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | ||
| const body = [ | ||
| marker, | ||
| `The weekly conformance workflow against the latest \`@modelcontextprotocol/conformance\` release failed.`, | ||
| ``, | ||
| `- Workflow run: ${runUrl}`, | ||
| `- Triggered: ${context.eventName} on ${new Date().toISOString()}`, | ||
| ``, | ||
| `This usually means upstream published a new conformance release whose scenarios the SDK does not satisfy. Inspect the run logs and either:`, | ||
| ``, | ||
| `1. Fix the SDK to satisfy the new scenarios,`, | ||
| `2. Update \`tests/Conformance/server.php\` / \`tests/Conformance/client.php\` fixtures, or`, | ||
| `3. Add the new expected failure to \`tests/Conformance/conformance-baseline.yml\` with justification.`, | ||
| ].join('\n'); | ||
|
|
||
| const existing = await github.rest.issues.listForRepo({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'open', | ||
| labels: 'conformance-weekly', | ||
| per_page: 50, | ||
| }); | ||
| const match = existing.data.find(i => (i.body || '').includes(marker)); | ||
|
|
||
| if (match) { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: match.number, | ||
| body: `New failure on ${new Date().toISOString()}: ${runUrl}`, | ||
| }); | ||
| } else { | ||
| await github.rest.issues.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| title, | ||
| body, | ||
| labels: ['conformance-weekly'], | ||
| }); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.