Skip to content

Commit 920707c

Browse files
committed
Group the conformance Rake tasks under a conformance namespace
## Motivation and Context The three conformance tasks were named `conformance`, `conformance_list`, and `conformance_server`, spelling out with underscores the grouping that Rake expresses with namespaces. They are now `conformance:test`, `conformance:list`, and `conformance:server`. The bare `conformance` task is kept as an alias for `conformance:test`. ## How Has This Been Tested? By running `rake -T` to confirm the three tasks are grouped under `conformance:` with the alias listed beside them, `rake --dry-run default` to confirm that the default task resolves `conformance:test`, and `rake conformance:list` to exercise a renamed task end to end. ## Breaking Changes None. These are development-only Rake tasks.
1 parent da4ce54 commit 920707c

4 files changed

Lines changed: 45 additions & 37 deletions

File tree

‎.github/workflows/conformance.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
- uses: actions/setup-node@v7
2727
with:
2828
node-version: '24' # Specify the latest Node.js version.
29-
- run: bundle exec rake conformance
29+
- run: bundle exec rake conformance:test

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ This is the official Ruby SDK for the Model Context Protocol (MCP), implementing
1515
- `bundle install` - Install dependencies
1616
- `rake test` - Run all tests
1717
- `rake rubocop` - Run linter
18-
- `rake` - Run tests and linting (default task)
19-
- `bundle exec rake conformance` - Run the MCP conformance suite (see conformance/README.md)
18+
- `rake` - Run linting, tests, and the conformance suite (default task)
19+
- `bundle exec rake conformance:test` - Run the MCP conformance suite (see conformance/README.md)
2020
- `bundle exec rake docs:preview` - Serve the documentation site locally at http://localhost:4000 (PORT to override)
2121
- `ruby -I lib -I test test/path/to/specific_test.rb` - Run single test file
2222
- `gem build mcp.gemspec` - Build the gem

‎Rakefile‎

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,51 @@ require "rubocop/rake_task"
1414

1515
RuboCop::RakeTask.new
1616

17-
task default: [:rubocop, :test, :conformance]
17+
task default: [:rubocop, :test, "conformance:test"]
1818

19-
desc "Run MCP conformance tests (PORT, SCENARIO, SPEC_VERSION, VERBOSE)"
20-
task :conformance do |t|
21-
next unless npx_available?(t.name)
19+
namespace :conformance do
20+
desc "Run MCP conformance tests (PORT, SCENARIO, SPEC_VERSION, VERBOSE)"
21+
task :test do |t|
22+
next unless npx_available?(t.name)
2223

23-
require_relative "conformance/server_runner"
24-
require_relative "conformance/client_runner"
24+
require_relative "conformance/server_runner"
25+
require_relative "conformance/client_runner"
2526

26-
options = {}
27-
options[:port] = Integer(ENV["PORT"]) if ENV["PORT"]
28-
options[:scenario] = ENV["SCENARIO"] if ENV["SCENARIO"]
29-
options[:spec_version] = ENV["SPEC_VERSION"] if ENV["SPEC_VERSION"]
30-
options[:verbose] = true if ENV["VERBOSE"]
27+
options = {}
28+
options[:port] = Integer(ENV["PORT"]) if ENV["PORT"]
29+
options[:scenario] = ENV["SCENARIO"] if ENV["SCENARIO"]
30+
options[:spec_version] = ENV["SPEC_VERSION"] if ENV["SPEC_VERSION"]
31+
options[:verbose] = true if ENV["VERBOSE"]
3132

32-
Conformance::ServerRunner.new(**options).run
33-
Conformance::ClientRunner.new(**options.reject { |key, _value| key == :port }).run
34-
end
33+
Conformance::ServerRunner.new(**options).run
34+
Conformance::ClientRunner.new(**options.reject { |key, _value| key == :port }).run
35+
end
3536

36-
desc "List available conformance scenarios"
37-
task :conformance_list do |t|
38-
next unless npx_available?(t.name)
37+
desc "List available conformance scenarios"
38+
task :list do |t|
39+
next unless npx_available?(t.name)
3940

40-
system("npx", "--yes", "@modelcontextprotocol/conformance", "list", "--server")
41-
system("npx", "--yes", "@modelcontextprotocol/conformance", "list", "--client")
42-
end
41+
system("npx", "--yes", "@modelcontextprotocol/conformance", "list", "--server")
42+
system("npx", "--yes", "@modelcontextprotocol/conformance", "list", "--client")
43+
end
4344

44-
desc "Start the conformance server (PORT)"
45-
task :conformance_server do
46-
require_relative "conformance/server"
45+
desc "Start the conformance server (PORT)"
46+
task :server do
47+
require_relative "conformance/server"
4748

48-
options = {}
49-
options[:port] = Integer(ENV["PORT"]) if ENV["PORT"]
49+
options = {}
50+
options[:port] = Integer(ENV["PORT"]) if ENV["PORT"]
5051

51-
Conformance::Server.new(**options).start
52+
Conformance::Server.new(**options).start
53+
end
5254
end
5355

56+
# The other two former names now fail with a "Did you mean?" suggestion, but a bare `conformance`
57+
# would match the `conformance/` directory: Rake synthesizes a file task for it and exits 0 without
58+
# running anything. This keeps the name pointing at the suite instead of at that silent no-op.
59+
desc "Alias for conformance:test"
60+
task conformance: "conformance:test"
61+
5462
namespace :docs do
5563
desc "Serve the documentation site locally at http://localhost:4000 (PORT)"
5664
task :preview do

‎conformance/README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Validates the Ruby SDK's conformance to the MCP specification using [`@modelcont
1212
### Run all scenarios
1313

1414
```bash
15-
bundle exec rake conformance
15+
bundle exec rake conformance:test
1616
```
1717

1818
Runs both server and client conformance tests in sequence. Server conformance starts the
@@ -31,20 +31,20 @@ are allowed to fail without affecting the exit code.
3131

3232
```bash
3333
# Run a single server scenario
34-
bundle exec rake conformance SCENARIO=ping
34+
bundle exec rake conformance:test SCENARIO=ping
3535

3636
# Use a different port with verbose output
37-
bundle exec rake conformance PORT=3000 VERBOSE=1
37+
bundle exec rake conformance:test PORT=3000 VERBOSE=1
3838

3939
# Start the server on a specific port
40-
bundle exec rake conformance_server PORT=3000
40+
bundle exec rake conformance:server PORT=3000
4141
```
4242

4343
### Start the server and test separately
4444

4545
```bash
4646
# Terminal 1: start the server
47-
bundle exec rake conformance_server
47+
bundle exec rake conformance:server
4848

4949
# Terminal 2: run all scenarios
5050
npx @modelcontextprotocol/conformance@alpha server --url http://localhost:9292/mcp
@@ -59,7 +59,7 @@ on a single scenario. Stop the server with Ctrl+C when done.
5959
### List available scenarios
6060

6161
```bash
62-
bundle exec rake conformance_list
62+
bundle exec rake conformance:list
6363
```
6464

6565
Prints all scenario names that can be passed to `SCENARIO`.
@@ -76,7 +76,7 @@ repository with the conformance server running:
7676

7777
```bash
7878
# Terminal 1 (this repository): start the conformance server
79-
bundle exec rake conformance_server
79+
bundle exec rake conformance:server
8080

8181
# Terminal 2 (conformance repository): run the tier audit skill as a slash command in Claude Code
8282
/mcp-sdk-tier-audit /path/to/modelcontextprotocol/ruby-sdk http://localhost:9292/mcp
@@ -102,4 +102,4 @@ conformance/
102102

103103
Known-failing scenarios are registered in `conformance/expected_failures.yml`. They are allowed to
104104
fail without affecting the exit code and are tracked to catch regressions.
105-
These are shown in the output of `bundle exec rake conformance`.
105+
These are shown in the output of `bundle exec rake conformance:test`.

0 commit comments

Comments
 (0)