summaryrefslogtreecommitdiff
path: root/spec/migrations/calculate_conv_dev_index_percentages_spec.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-02 13:14:24 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-02 13:14:24 +0000
commite07ebe66af957c46e7c69329b3ab561bb539351b (patch)
tree9a4d6d52f94b99aea154ad53000a39d172b18cdb /spec/migrations/calculate_conv_dev_index_percentages_spec.rb
parent58786e2086b9d8db5784771f4dbfe8b5c107df18 (diff)
parent6aeb6996447ead0f6daf71faab85c99e11ab8ae8 (diff)
downloadgitlab-ce-harish-and-cindy-ssl-check-rake-task.tar.gz
Merge branch '59177-squash-old-migrations' into 'master'harish-and-cindy-ssl-check-rake-taskharish-and-cindy-ldap-sync-rake-tasks
Squash old migrations Closes #59177 See merge request gitlab-org/gitlab-ce!30226
Diffstat (limited to 'spec/migrations/calculate_conv_dev_index_percentages_spec.rb')
-rw-r--r--spec/migrations/calculate_conv_dev_index_percentages_spec.rb59
1 files changed, 0 insertions, 59 deletions
diff --git a/spec/migrations/calculate_conv_dev_index_percentages_spec.rb b/spec/migrations/calculate_conv_dev_index_percentages_spec.rb
deleted file mode 100644
index 09c78d02890..00000000000
--- a/spec/migrations/calculate_conv_dev_index_percentages_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# encoding: utf-8
-
-require 'spec_helper'
-require Rails.root.join('db', 'post_migrate', '20170803090603_calculate_conv_dev_index_percentages.rb')
-
-describe CalculateConvDevIndexPercentages, :migration do
- let(:migration) { described_class.new }
- let!(:conv_dev_index) do
- table(:conversational_development_index_metrics).create!(
- leader_issues: 9.256,
- leader_notes: 0,
- leader_milestones: 16.2456,
- leader_boards: 5.2123,
- leader_merge_requests: 1.2,
- leader_ci_pipelines: 12.1234,
- leader_environments: 3.3333,
- leader_deployments: 1.200,
- leader_projects_prometheus_active: 0.111,
- leader_service_desk_issues: 15.891,
- instance_issues: 1.234,
- instance_notes: 28.123,
- instance_milestones: 0,
- instance_boards: 3.254,
- instance_merge_requests: 0.6,
- instance_ci_pipelines: 2.344,
- instance_environments: 2.2222,
- instance_deployments: 0.771,
- instance_projects_prometheus_active: 0.109,
- instance_service_desk_issues: 13.345,
- percentage_issues: 0,
- percentage_notes: 0,
- percentage_milestones: 0,
- percentage_boards: 0,
- percentage_merge_requests: 0,
- percentage_ci_pipelines: 0,
- percentage_environments: 0,
- percentage_deployments: 0,
- percentage_projects_prometheus_active: 0,
- percentage_service_desk_issues: 0)
- end
-
- describe '#up' do
- it 'calculates percentages correctly' do
- migration.up
- conv_dev_index.reload
-
- expect(conv_dev_index.percentage_issues).to be_within(0.1).of(13.3)
- expect(conv_dev_index.percentage_notes).to be_zero # leader 0
- expect(conv_dev_index.percentage_milestones).to be_zero # instance 0
- expect(conv_dev_index.percentage_boards).to be_within(0.1).of(62.4)
- expect(conv_dev_index.percentage_merge_requests).to eq(50.0)
- expect(conv_dev_index.percentage_ci_pipelines).to be_within(0.1).of(19.3)
- expect(conv_dev_index.percentage_environments).to be_within(0.1).of(66.7)
- expect(conv_dev_index.percentage_deployments).to be_within(0.1).of(64.2)
- expect(conv_dev_index.percentage_projects_prometheus_active).to be_within(0.1).of(98.2)
- expect(conv_dev_index.percentage_service_desk_issues).to be_within(0.1).of(84.0)
- end
- end
-end