Commit de4cfc31 authored by Mark Chao's avatar Mark Chao

Merge branch 'tkuah-master-patch-04833' into 'master'

Do not skip trait specs

See merge request gitlab-org/gitlab!54196
parents 806a91f8 868d0fad
......@@ -5,6 +5,41 @@ require 'spec_helper'
RSpec.describe 'factories' do
include Database::DatabaseHelpers
def skipped_traits
[
[:alert_management_alert, :with_ended_at],
[:audit_event, :unauthenticated],
[:ci_build_trace_chunk, :fog_with_data],
[:ci_job_artifact, :remote_store],
[:ci_job_artifact, :raw],
[:ci_job_artifact, :gzip],
[:ci_job_artifact, :correct_checksum],
[:design_version, :empty],
[:environment, :non_playable],
[:go_module_commit, :files],
[:go_module_commit, :package],
[:go_module_version, :pseudo],
[:composer_cache_file, :object_storage],
[:debian_project_component_file, :object_storage],
[:debian_project_distribution, :object_storage],
[:debian_file_metadatum, :unknown],
[:package_file, :object_storage],
[:pages_domain, :without_certificate],
[:pages_domain, :without_key],
[:pages_domain, :with_missing_chain],
[:pages_domain, :with_trusted_chain],
[:pages_domain, :with_trusted_expired_chain],
[:pages_domain, :explicit_ecdsa],
[:project_member, :blocked],
[:project, :remote_mirror],
[:prometheus_alert_event, :none],
[:remote_mirror, :ssh],
[:self_managed_prometheus_alert_event, :resolved],
[:self_managed_prometheus_alert_event, :none],
[:user_preference, :only_comments]
]
end
shared_examples 'factory' do |factory|
describe "#{factory.name} factory" do
it 'does not raise error when built' do
......@@ -16,8 +51,10 @@ RSpec.describe 'factories' do
end
factory.definition.defined_traits.map(&:name).each do |trait_name|
describe "linting #{trait_name} trait" do
skip 'does not raise error when created' do
describe "linting :#{trait_name} trait" do
it 'does not raise error when created' do
pending("Trait skipped linting due to legacy error") if skipped_traits.include?([factory.name, trait_name.to_sym])
expect { create(factory.name, trait_name) }.not_to raise_error
end
end
......@@ -37,8 +74,13 @@ RSpec.describe 'factories' do
import_state
namespace
project_broken_repo
prometheus_alert
prometheus_alert_event
prometheus_metric
self_managed_prometheus_alert_event
users_star_project
wiki_page
wiki_page_meta
].to_set.freeze
# Some factories and their corresponding models are based on
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment