debian-mirror-gitlab/spec/factories/import_failures.rb

30 lines
702 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
require 'securerandom'
FactoryBot.define do
factory :import_failure do
association :project, factory: :project
created_at { Time.parse('2020-01-01T00:00:00Z') }
exception_class { 'RuntimeError' }
exception_message { 'Something went wrong' }
source { 'method_call' }
2022-01-26 12:08:38 +05:30
relation_key { 'issues' }
relation_index { 1 }
2020-04-22 19:07:51 +05:30
correlation_id_value { SecureRandom.uuid }
trait :hard_failure do
retry_count { 0 }
end
trait :soft_failure do
retry_count { 1 }
end
2023-07-09 08:55:56 +05:30
trait :github_import_failure do
external_identifiers { { iid: 2, object_type: 'pull_request', title: 'Implement cool feature' } }
end
2020-04-22 19:07:51 +05:30
end
end