summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/downtime_check
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-06-24 18:29:23 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2016-07-20 12:41:56 +0200
commita8bfe20d0dbc79616ad69b0e9c1c985ba1887407 (patch)
tree289641ee727f146a13393aa77043c1d3bc01e47b /spec/lib/gitlab/downtime_check
parentd6bd412be4e3063c5f8844ef2c15f736f173b2f1 (diff)
downloadgitlab-ce-a8bfe20d0dbc79616ad69b0e9c1c985ba1887407.tar.gz
Added checks for migration downtimemigration-downtime-tags
These new checks can be used to check if migrations require downtime or not (as tagged by their authors). In CI this compares the current branch with master so migrations added by merge requests are automatically verified. To check the migrations added since a Git reference simply run: bundle exec rake gitlab:db:downtime_check[GIT_REF]
Diffstat (limited to 'spec/lib/gitlab/downtime_check')
-rw-r--r--spec/lib/gitlab/downtime_check/message_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/gitlab/downtime_check/message_spec.rb b/spec/lib/gitlab/downtime_check/message_spec.rb
new file mode 100644
index 00000000000..93094cda776
--- /dev/null
+++ b/spec/lib/gitlab/downtime_check/message_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe Gitlab::DowntimeCheck::Message do
+ describe '#to_s' do
+ it 'returns an ANSI formatted String for an offline migration' do
+ message = described_class.new('foo.rb', true, 'hello')
+
+ expect(message.to_s).to eq("[\e[32moffline\e[0m]: foo.rb: hello")
+ end
+
+ it 'returns an ANSI formatted String for an online migration' do
+ message = described_class.new('foo.rb')
+
+ expect(message.to_s).to eq("[\e[31monline\e[0m]: foo.rb")
+ end
+ end
+end