Welcome to mirror list, hosted at ThFree Co, Russian Federation.

import_failures.rb « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b4a7c6c46b18f52913bd7bbdc07f38e055e9fa94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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' }
    relation_key { 'issues' }
    relation_index { 1 }
    correlation_id_value { SecureRandom.uuid }

    trait :hard_failure do
      retry_count { 0 }
    end

    trait :soft_failure do
      retry_count { 1 }
    end

    trait :github_import_failure do
      external_identifiers { { iid: 2, object_type: 'pull_request', title: 'Implement cool feature' } }
    end
  end
end