-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathaction.yml
More file actions
97 lines (87 loc) · 2.96 KB
/
action.yml
File metadata and controls
97 lines (87 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: 'MCP Conformance Tests'
description: 'Run MCP conformance tests against a server or client implementation'
inputs:
mode:
description: 'Test mode: "server" or "client"'
required: true
url:
description: 'Server URL to test against (required for server mode)'
required: false
command:
description: 'Command to run the client under test (required for client mode)'
required: false
expected-failures:
description: 'Path to YAML file listing expected failures (baseline)'
required: false
suite:
description: 'Test suite to run (server: "active"|"all"|"pending", client: "all"|"auth"|"metadata"|"sep-835")'
required: false
scenario:
description: 'Run a single scenario by name'
required: false
timeout:
description: 'Timeout in milliseconds for client tests (default: 30000)'
required: false
default: '30000'
verbose:
description: 'Show verbose output (default: false)'
required: false
default: 'false'
node-version:
description: 'Node.js version to use (default: 22)'
required: false
default: '22'
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Build conformance tests
shell: bash
run: |
cd "${{ github.action_path }}"
npm ci
npm run build
- name: Run conformance tests
shell: bash
run: |
CONFORMANCE="${{ github.action_path }}/dist/index.js"
# Build the command arguments
ARGS="${{ inputs.mode }}"
# Mode-specific required options
if [ "${{ inputs.mode }}" = "server" ]; then
if [ -z "${{ inputs.url }}" ]; then
echo "::error::The 'url' input is required for server mode"
exit 1
fi
ARGS="${ARGS} --url ${{ inputs.url }}"
elif [ "${{ inputs.mode }}" = "client" ]; then
if [ -z "${{ inputs.command }}" ]; then
echo "::error::The 'command' input is required for client mode"
exit 1
fi
ARGS="${ARGS} --command '${{ inputs.command }}'"
else
echo "::error::Invalid mode '${{ inputs.mode }}'. Must be 'server' or 'client'."
exit 1
fi
# Optional arguments
if [ -n "${{ inputs.expected-failures }}" ]; then
ARGS="${ARGS} --expected-failures ${{ inputs.expected-failures }}"
fi
if [ -n "${{ inputs.suite }}" ]; then
ARGS="${ARGS} --suite ${{ inputs.suite }}"
fi
if [ -n "${{ inputs.scenario }}" ]; then
ARGS="${ARGS} --scenario ${{ inputs.scenario }}"
fi
if [ "${{ inputs.mode }}" = "client" ]; then
ARGS="${ARGS} --timeout ${{ inputs.timeout }}"
fi
if [ "${{ inputs.verbose }}" = "true" ]; then
ARGS="${ARGS} --verbose"
fi
echo "Running: node ${CONFORMANCE} ${ARGS}"
eval "node ${CONFORMANCE} ${ARGS}"