mirror of
https://github.com/discourse/discourse.git
synced 2025-10-03 17:21:20 +08:00
DEV: Dynamically test all IntermediateDB entities (#34624)
Some checks failed
Licenses / run (push) Has been cancelled
Linting / run (push) Has been cancelled
Migration Tests / Tests (push) Has been cancelled
Publish Assets / publish-assets (push) Has been cancelled
Tests / core backend (push) Has been cancelled
Tests / plugins backend (push) Has been cancelled
Tests / core frontend (Chrome) (push) Has been cancelled
Tests / plugins frontend (push) Has been cancelled
Tests / themes frontend (push) Has been cancelled
Tests / core system (push) Has been cancelled
Tests / plugins system (push) Has been cancelled
Tests / themes system (push) Has been cancelled
Tests / core frontend (Firefox ESR) (push) Has been cancelled
Tests / core frontend (Firefox Evergreen) (push) Has been cancelled
Tests / chat system (push) Has been cancelled
Tests / merge (push) Has been cancelled
Some checks failed
Licenses / run (push) Has been cancelled
Linting / run (push) Has been cancelled
Migration Tests / Tests (push) Has been cancelled
Publish Assets / publish-assets (push) Has been cancelled
Tests / core backend (push) Has been cancelled
Tests / plugins backend (push) Has been cancelled
Tests / core frontend (Chrome) (push) Has been cancelled
Tests / plugins frontend (push) Has been cancelled
Tests / themes frontend (push) Has been cancelled
Tests / core system (push) Has been cancelled
Tests / plugins system (push) Has been cancelled
Tests / themes system (push) Has been cancelled
Tests / core frontend (Firefox ESR) (push) Has been cancelled
Tests / core frontend (Firefox Evergreen) (push) Has been cancelled
Tests / chat system (push) Has been cancelled
Tests / merge (push) Has been cancelled
This commit is contained in:
parent
7f07453157
commit
bb6c5c9fa1
22 changed files with 10 additions and 121 deletions
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Migrations::Database::IntermediateDB.constants.each do |const|
|
||||
mod = Migrations::Database::IntermediateDB.const_get(const)
|
||||
next unless mod.is_a?(Module)
|
||||
|
||||
RSpec.describe mod do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::BadgeGrouping do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::Badge do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::CategoryCustomField do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::Category do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::CategoryUser do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::Group do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::GroupUser do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::LogEntry do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::MutedUser do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::PermalinkNormalization do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::TagGroupMembership do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::TagGroupPermission do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::TagGroup do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::Tag do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::TagSynonym do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::TagUser do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::Upload do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::UserFieldOption do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::UserField do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe ::Migrations::Database::IntermediateDB::UserSuspension do
|
||||
it_behaves_like "a database entity"
|
||||
end
|
|
@ -94,25 +94,4 @@ RSpec.describe ::Migrations::Database::IntermediateDB do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it "checks that manually created entities are tested" do
|
||||
Dir[
|
||||
File.join(::Migrations.root_path, "lib", "database", "intermediate_db", "*.rb")
|
||||
].each do |path|
|
||||
next if File.read(path).include?("auto-generated")
|
||||
|
||||
spec_path =
|
||||
File.join(
|
||||
::Migrations.root_path,
|
||||
"spec",
|
||||
"lib",
|
||||
"database",
|
||||
"intermediate_db",
|
||||
"#{File.basename(path, ".rb")}_spec.rb",
|
||||
)
|
||||
|
||||
expect(File.exist?(spec_path)).to eq(true), "#{spec_path} is missing"
|
||||
expect(File.read(spec_path)).to include('it_behaves_like "a database entity"')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue