-
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
Open
soyuka
wants to merge
1
commit into
modelcontextprotocol:main
Choose a base branch
from
soyuka:ci-weekly-conformance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+163
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| 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? |
||
| 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'], | ||
| }); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's copy&paste mostly, but we could go with
--waitover sleep maybe?catched my eye only now => #305