Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions elasticgraph/spec/unit/elastic_graph/gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require_relative "../../../../script/list_eg_gems"
require "elastic_graph/support/json_schema/meta_schema_validator"
require "elastic_graph/support/json_schema/validator"
require "yaml"

module ElasticGraph
RSpec.describe "ElasticGraph gems" do
Expand Down Expand Up @@ -197,6 +198,24 @@ def with_load_paths(*paths)
end
end

# Every EG gem that ships RBS signatures (i.e. has a `sig` directory) must be listed in
# `rbs_collection.yaml` with `ignore: true`. Otherwise, `rbs collection install` pulls the
# gem's signatures in via bundler while those same signatures _also_ exist locally in this
# monorepo, and Steep fails with "declaration is duplicated" errors. The bootstrap gem
# `elasticgraph` (no dash) ships no signatures, so it is intentionally excluded.
it "ignores every EG gem that ships RBS signatures in `rbs_collection.yaml` to avoid Steep `declaration is duplicated` errors" do
eg_gems_with_sig = ::ElasticGraphGems.list.select do |gem_name|
::File.directory?(::File.join(CommonSpecHelpers::REPO_ROOT, gem_name, "sig"))
end

rbs_config = ::YAML.safe_load_file(::File.join(CommonSpecHelpers::REPO_ROOT, "rbs_collection.yaml"))
ignored_eg_gems = rbs_config.fetch("gems")
.select { |gem| gem.fetch("name").start_with?("elasticgraph") && gem["ignore"] == true }
.map { |gem| gem.fetch("name") }

expect(ignored_eg_gems).to match_array(eg_gems_with_sig)
end

# We don't expect any variation in these gemspec attributes.
%i[homepage license required_ruby_version version].each do |gemspec_attribute|
it "has the same value for `#{gemspec_attribute}` in all ElasticGraph gemspecs" do
Expand Down
2 changes: 2 additions & 0 deletions rbs_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ gems:
ignore: true
- name: elasticgraph-indexer_lambda
ignore: true
- name: elasticgraph-json_ingestion
ignore: true
- name: elasticgraph-lambda_support
ignore: true
- name: elasticgraph-local
Expand Down