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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/integrations.rb')
-rw-r--r--spec/factories/integrations.rb179
1 files changed, 149 insertions, 30 deletions
diff --git a/spec/factories/integrations.rb b/spec/factories/integrations.rb
index b74b81d4db9..68751e68f05 100644
--- a/spec/factories/integrations.rb
+++ b/spec/factories/integrations.rb
@@ -25,6 +25,8 @@ FactoryBot.define do
factory :datadog_integration, class: 'Integrations::Datadog' do
project
active { true }
+ datadog_site { 'datadoghq.com' }
+ datadog_tags { 'key:value' }
api_key { 'secret' }
end
@@ -34,13 +36,10 @@ FactoryBot.define do
active { true }
push_events { true }
tag_push_events { true }
- properties do
- {
- recipients: 'test@example.com',
- disable_diffs: true,
- send_from_committer_email: true
- }
- end
+ recipients { 'foo@bar.com' }
+ disable_diffs { true }
+ send_from_committer_email { true }
+ branches_to_be_notified { 'all' }
end
factory :gitlab_slack_application_integration, class: 'Integrations::GitlabSlackApplication' do
@@ -70,24 +69,18 @@ FactoryBot.define do
project
type { 'Integrations::Packagist' }
active { true }
- properties do
- {
- username: 'username',
- token: 'test',
- server: 'https://packagist.example.com'
- }
- end
+ username { 'username' }
+ token { 'secrettoken' }
+ server { 'https://packagist.example.comp' }
end
factory :prometheus_integration, class: 'Integrations::Prometheus' do
project
active { true }
- properties do
- {
- api_url: 'https://prometheus.example.com/',
- manual_configuration: true
- }
- end
+ api_url { 'https://prometheus.example.com/' }
+ manual_configuration { true }
+ google_iap_audience_client_id { 'IAP_CLIENT_ID.apps.googleusercontent.com' }
+ google_iap_service_account_json { '{ type: "service_account", project_id: "123" }' }
end
factory :bamboo_integration, class: 'Integrations::Bamboo' do
@@ -103,6 +96,7 @@ FactoryBot.define do
project
active { true }
drone_url { 'https://drone.example.com' }
+ enable_ssl_verification { false }
token { 'test' }
end
@@ -110,14 +104,14 @@ FactoryBot.define do
project
active { true }
type { 'Integrations::Jira' }
+ url { 'https://jira.example.com' }
+ api_url { '' }
+ username { 'jira_username' }
+ password { 'jira_password' }
+ jira_auth_type { 0 }
transient do
create_data { true }
- url { 'https://jira.example.com' }
- api_url { '' }
- username { 'jira_username' }
- password { 'jira_password' }
- jira_auth_type { 0 }
jira_issue_transition_automatic { false }
jira_issue_transition_id { '56-1' }
issues_enabled { false }
@@ -130,6 +124,8 @@ FactoryBot.define do
end
after(:build) do |integration, evaluator|
+ integration.instance_variable_set(:@old_data_fields, nil)
+
if evaluator.create_data
integration.jira_tracker_data = build(:jira_tracker_data,
integration: integration, url: evaluator.url, api_url: evaluator.api_url,
@@ -199,7 +195,8 @@ FactoryBot.define do
factory :youtrack_integration, class: 'Integrations::Youtrack' do
project
active { true }
- issue_tracker
+ project_url { 'http://issuetracker.example.com' }
+ issues_url { 'http://issues.example.com/issues/:id' }
end
factory :ewm_integration, class: 'Integrations::Ewm' do
@@ -211,15 +208,17 @@ FactoryBot.define do
factory :clickup_integration, class: 'Integrations::Clickup' do
project
active { true }
- issue_tracker
+ project_url { 'http://issuetracker.example.com' }
+ issues_url { 'http://issues.example.com/issues/:id' }
end
trait :issue_tracker do
+ project_url { 'http://issuetracker.example.com' }
+ issues_url { 'http://issues.example.com/issues/:id' }
+ new_issue_url { 'http://new-issue.example.com' }
+
transient do
create_data { true }
- project_url { 'http://issuetracker.example.com' }
- issues_url { 'http://issues.example.com/issues/:id' }
- new_issue_url { 'http://new-issue.example.com' }
end
after(:build) do |integration, evaluator|
@@ -248,6 +247,15 @@ FactoryBot.define do
trait :chat_notification do
sequence(:webhook) { |n| "https://example.com/webhook/#{n}" }
+ push_events { false }
+ issues_events { false }
+ confidential_issues_events { false }
+ merge_requests_events { false }
+ note_events { false }
+ confidential_note_events { false }
+ tag_push_events { false }
+ pipeline_events { false }
+ wiki_page_events { false }
end
trait :inactive do
@@ -265,6 +273,116 @@ FactoryBot.define do
chat_notification
project
type { 'Integrations::Mattermost' }
+ labels_to_be_notified_behavior { 'match_any' }
+ active { true }
+ end
+
+ factory :microsoft_teams_integration, class: 'Integrations::MicrosoftTeams' do
+ chat_notification
+ project
+ type { 'Integrations::MicrosoftTeams' }
+ active { true }
+ end
+
+ factory :asana_integration, class: 'Integrations::Asana' do
+ project
+ api_key { 'secrettoken' }
+ active { true }
+ end
+
+ factory :assembla_integration, class: 'Integrations::Assembla' do
+ project
+ token { 'secrettoken' }
+ active { true }
+ end
+
+ factory :buildkite_integration, class: 'Integrations::Buildkite' do
+ project
+ token { 'secrettoken' }
+ project_url { 'http://example.com' }
+ active { true }
+ end
+
+ factory :campfire_integration, class: 'Integrations::Campfire' do
+ project
+ active { true }
+ room { '1234' }
+ token { 'test' }
+ end
+
+ factory :hangouts_chat_integration, class: 'Integrations::HangoutsChat' do
+ chat_notification
+ project
+ type { 'Integrations::HangoutsChat' }
+ active { true }
+ end
+
+ factory :irker_integration, class: 'Integrations::Irker' do
+ project
+ recipients { 'irc://irc.network.net:666/#channel' }
+ server_port { 1234 }
+ type { 'Integrations::Irker' }
+ active { true }
+ end
+
+ factory :mattermost_slash_commands_integration, class: 'Integrations::MattermostSlashCommands' do
+ project
+ token { 'secrettoken' }
+ active { true }
+ end
+
+ factory :mock_ci_integration, class: 'Integrations::MockCi' do
+ project
+ mock_service_url { 'http://example.com' }
+ type { 'Integrations::MockCi' }
+ active { true }
+ end
+
+ factory :mock_monitoring_integration, class: 'Integrations::MockMonitoring' do
+ project
+ type { 'Integrations::MockMonitoring' }
+ active { true }
+ end
+
+ factory :pumble_integration, class: 'Integrations::Pumble' do
+ project
+ chat_notification
+ type { 'Integrations::Pumble' }
+ active { true }
+ end
+
+ factory :pushover_integration, class: 'Integrations::Pushover' do
+ project
+ type { 'Integrations::Pushover' }
+ api_key { 'secrettoken' }
+ user_key { 'secretkey' }
+ priority { "0" }
+ active { true }
+ device { nil }
+ sound { nil }
+ end
+
+ factory :teamcity_integration, class: 'Integrations::Teamcity' do
+ project
+ teamcity_url { 'http://example.com' }
+ username { 'username' }
+ password { 'secrettoken' }
+ build_type { '123' }
+ type { 'Integrations::Teamcity' }
+ active { true }
+ end
+
+ factory :unify_circuit_integration, class: 'Integrations::UnifyCircuit' do
+ project
+ chat_notification
+ type { 'Integrations::UnifyCircuit' }
+ active { true }
+ end
+
+ factory :webex_teams_integration, class: 'Integrations::WebexTeams' do
+ project
+ chat_notification
+ type { 'Integrations::WebexTeams' }
active { true }
end
@@ -279,6 +397,7 @@ FactoryBot.define do
factory :slack_slash_commands_integration, class: 'Integrations::SlackSlashCommands' do
project
active { true }
+ token { 'secrettoken' }
type { 'Integrations::SlackSlashCommands' }
end