coatepec 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/CHANGELOG.md +111 -0
- data/README.md +107 -31
- data/ROADMAP.md +28 -62
- data/lib/coatepec/introspection/bounded_options.rb +22 -0
- data/lib/coatepec/introspection/controller.rb +19 -28
- data/lib/coatepec/introspection/model.rb +33 -43
- data/lib/coatepec/introspection/model_resolver.rb +32 -0
- data/lib/coatepec/introspection/route_entries.rb +77 -0
- data/lib/coatepec/introspection/routes.rb +70 -20
- data/lib/coatepec/mcp/response.rb +16 -9
- data/lib/coatepec/mcp/tools.rb +85 -90
- data/lib/coatepec/mcp.rb +2 -2
- data/lib/coatepec/project.rb +11 -1
- data/lib/coatepec/spec/failure_collapser.rb +111 -0
- data/lib/coatepec/spec/flaky_checker.rb +3 -1
- data/lib/coatepec/spec/fork_strategy.rb +3 -12
- data/lib/coatepec/spec/guarded_fork_strategy.rb +11 -10
- data/lib/coatepec/spec/path_policy.rb +45 -12
- data/lib/coatepec/spec/process_strategy.rb +22 -17
- data/lib/coatepec/spec/result.rb +61 -19
- data/lib/coatepec/spec/rspec_adapter.rb +58 -0
- data/lib/coatepec/spec/runner.rb +22 -24
- data/lib/coatepec/spec/spawn_strategy.rb +7 -8
- data/lib/coatepec/test_unit/adapter.rb +132 -0
- data/lib/coatepec/test_unit/child_entry.rb +33 -0
- data/lib/coatepec/test_unit/json_reporter.rb +107 -0
- data/lib/coatepec/test_unit/line_filtering.rb +46 -0
- data/lib/coatepec/version.rb +1 -1
- data/lib/coatepec/worker/server.rb +2 -1
- data/lib/coatepec/worker_manager.rb +8 -6
- data/lib/coatepec.rb +5 -0
- metadata +16 -5
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Coatepec
|
|
4
|
+
module TestUnit
|
|
5
|
+
# Makes `file:LINE` selectors work regardless of the target app's Rails/
|
|
6
|
+
# Minitest pairing. Rails installs its own Rails::LineFiltering only via
|
|
7
|
+
# Rails::TestUnitRailtie, which an app generated with --skip-test never
|
|
8
|
+
# loads; and Rails 7.1's version overrides `run`, a method Minitest 6 no
|
|
9
|
+
# longer calls (it dispatches through `run_suite` and reads
|
|
10
|
+
# options[:include], not options[:filter]). So the child always extends
|
|
11
|
+
# ActiveSupport::TestCase with the one method the *running* Minitest
|
|
12
|
+
# actually calls, composing Rails::TestUnit::Runner's recorded line
|
|
13
|
+
# filters through Rails' public compose_filter. Stacking on top of
|
|
14
|
+
# Rails' own module is idempotent: CompositeFilter#derive_named_filter
|
|
15
|
+
# unwraps an existing composite via #named_filter.
|
|
16
|
+
#
|
|
17
|
+
# Exactly one method per module, never both: on Minitest 6 a class-level
|
|
18
|
+
# `run` override intercepts an unrelated 3-argument call and raises.
|
|
19
|
+
module LineFiltering
|
|
20
|
+
MT6 = Module.new do
|
|
21
|
+
def run_suite(reporter, options = {})
|
|
22
|
+
options = options.merge(include: ::Rails::TestUnit::Runner.compose_filter(self, options[:include]))
|
|
23
|
+
super(reporter, options)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
MT5 = Module.new do
|
|
28
|
+
def run(reporter, options = {})
|
|
29
|
+
options = options.merge(filter: ::Rails::TestUnit::Runner.compose_filter(self, options[:filter]))
|
|
30
|
+
super(reporter, options)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.module_for(minitest_version)
|
|
35
|
+
minitest_version.start_with?("6") ? MT6 : MT5
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Ruby ignores a second `extend` of a module already in the singleton
|
|
39
|
+
# ancestors, so calling this more than once per process is harmless.
|
|
40
|
+
def self.install!
|
|
41
|
+
require "rails/test_unit/runner"
|
|
42
|
+
::ActiveSupport::TestCase.extend(module_for(::Minitest::VERSION))
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/lib/coatepec/version.rb
CHANGED
|
@@ -64,7 +64,8 @@ module Coatepec
|
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
def handle_model(args)
|
|
67
|
-
|
|
67
|
+
a = args.transform_keys(&:to_sym)
|
|
68
|
+
Introspection::Model.new(a[:name], fields: a[:fields]).call
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
def handle_controller(args)
|
|
@@ -20,10 +20,12 @@ module Coatepec
|
|
|
20
20
|
dispatch("status", {}, timeout: 30)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def run_spec(paths:, example:, seed:, fail_fast:, timeout_seconds:
|
|
23
|
+
def run_spec(paths:, example:, seed:, fail_fast:, timeout_seconds:, include_passing: false,
|
|
24
|
+
include_stdout: "failures")
|
|
24
25
|
dispatch(
|
|
25
26
|
"spec_run",
|
|
26
|
-
{ paths: paths, example: example, seed: seed, fail_fast: fail_fast, timeout_seconds: timeout_seconds
|
|
27
|
+
{ paths: paths, example: example, seed: seed, fail_fast: fail_fast, timeout_seconds: timeout_seconds,
|
|
28
|
+
include_passing: include_passing, include_stdout: include_stdout },
|
|
27
29
|
timeout: timeout_seconds + 10
|
|
28
30
|
)
|
|
29
31
|
end
|
|
@@ -40,12 +42,12 @@ module Coatepec
|
|
|
40
42
|
)
|
|
41
43
|
end
|
|
42
44
|
|
|
43
|
-
def routes(query: nil, limit:
|
|
44
|
-
dispatch("routes", { query: query, limit: limit, offset: offset }, timeout: 30)
|
|
45
|
+
def routes(query: nil, limit: 100, offset: 0, engines: Introspection::Routes::DEFAULT_ENGINES)
|
|
46
|
+
dispatch("routes", { query: query, limit: limit, offset: offset, engines: engines }, timeout: 30)
|
|
45
47
|
end
|
|
46
48
|
|
|
47
|
-
def model(name:)
|
|
48
|
-
dispatch("model", { name: name }, timeout: 30)
|
|
49
|
+
def model(name:, fields: nil)
|
|
50
|
+
dispatch("model", { name: name, fields: fields }, timeout: 30)
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
def controller(name:)
|
data/lib/coatepec.rb
CHANGED
|
@@ -11,9 +11,14 @@ require_relative "coatepec/worker/client"
|
|
|
11
11
|
require_relative "coatepec/worker/rails_runtime"
|
|
12
12
|
require_relative "coatepec/introspection/routes"
|
|
13
13
|
require_relative "coatepec/introspection/safe_options"
|
|
14
|
+
require_relative "coatepec/introspection/bounded_options"
|
|
15
|
+
require_relative "coatepec/introspection/model_resolver"
|
|
14
16
|
require_relative "coatepec/introspection/model"
|
|
15
17
|
require_relative "coatepec/introspection/controller"
|
|
18
|
+
require_relative "coatepec/spec/failure_collapser"
|
|
16
19
|
require_relative "coatepec/spec/result"
|
|
20
|
+
require_relative "coatepec/spec/rspec_adapter"
|
|
21
|
+
require_relative "coatepec/test_unit/adapter"
|
|
17
22
|
require_relative "coatepec/spec/process_strategy"
|
|
18
23
|
require_relative "coatepec/spec/fork_strategy"
|
|
19
24
|
require_relative "coatepec/spec/spawn_strategy"
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: coatepec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Enrique Mogollan
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-09-
|
|
10
|
+
date: 2026-09-14 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: railties
|
|
@@ -44,8 +44,9 @@ dependencies:
|
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: '1.0'
|
|
46
46
|
description: Coatepec is a local stdio MCP sidecar that keeps an isolated Rails test
|
|
47
|
-
worker warm so coding agents can run targeted RSpec examples quickly,
|
|
48
|
-
|
|
47
|
+
worker warm so coding agents can run targeted RSpec examples quickly, check specs
|
|
48
|
+
for flakiness, and read routes, models, and controllers through structured read-only
|
|
49
|
+
Rails APIs -- without exposing a general Rails console.
|
|
49
50
|
email:
|
|
50
51
|
- emogollan@gmail.com
|
|
51
52
|
executables:
|
|
@@ -66,8 +67,11 @@ files:
|
|
|
66
67
|
- lib/coatepec.rb
|
|
67
68
|
- lib/coatepec/cli.rb
|
|
68
69
|
- lib/coatepec/errors.rb
|
|
70
|
+
- lib/coatepec/introspection/bounded_options.rb
|
|
69
71
|
- lib/coatepec/introspection/controller.rb
|
|
70
72
|
- lib/coatepec/introspection/model.rb
|
|
73
|
+
- lib/coatepec/introspection/model_resolver.rb
|
|
74
|
+
- lib/coatepec/introspection/route_entries.rb
|
|
71
75
|
- lib/coatepec/introspection/routes.rb
|
|
72
76
|
- lib/coatepec/introspection/safe_options.rb
|
|
73
77
|
- lib/coatepec/mcp.rb
|
|
@@ -76,14 +80,20 @@ files:
|
|
|
76
80
|
- lib/coatepec/project.rb
|
|
77
81
|
- lib/coatepec/project_config.rb
|
|
78
82
|
- lib/coatepec/protocol.rb
|
|
83
|
+
- lib/coatepec/spec/failure_collapser.rb
|
|
79
84
|
- lib/coatepec/spec/flaky_checker.rb
|
|
80
85
|
- lib/coatepec/spec/fork_strategy.rb
|
|
81
86
|
- lib/coatepec/spec/guarded_fork_strategy.rb
|
|
82
87
|
- lib/coatepec/spec/path_policy.rb
|
|
83
88
|
- lib/coatepec/spec/process_strategy.rb
|
|
84
89
|
- lib/coatepec/spec/result.rb
|
|
90
|
+
- lib/coatepec/spec/rspec_adapter.rb
|
|
85
91
|
- lib/coatepec/spec/runner.rb
|
|
86
92
|
- lib/coatepec/spec/spawn_strategy.rb
|
|
93
|
+
- lib/coatepec/test_unit/adapter.rb
|
|
94
|
+
- lib/coatepec/test_unit/child_entry.rb
|
|
95
|
+
- lib/coatepec/test_unit/json_reporter.rb
|
|
96
|
+
- lib/coatepec/test_unit/line_filtering.rb
|
|
87
97
|
- lib/coatepec/version.rb
|
|
88
98
|
- lib/coatepec/worker/change_detector.rb
|
|
89
99
|
- lib/coatepec/worker/client.rb
|
|
@@ -115,5 +125,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
115
125
|
requirements: []
|
|
116
126
|
rubygems_version: 3.6.6
|
|
117
127
|
specification_version: 4
|
|
118
|
-
summary: Run targeted RSpec examples
|
|
128
|
+
summary: Run targeted RSpec examples and introspect Rails structure over MCP, without
|
|
129
|
+
a Rails console
|
|
119
130
|
test_files: []
|