summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 14:21:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 14:21:10 +0000
commitcb0d23c455b73486fd1015f8ca9479b5b7e3585d (patch)
treed7dc129a407fd74266d2dc561bebf24665197c2f /spec/tasks
parentc3e911be175c0aabfea1eb030f9e0ef23f5f3887 (diff)
downloadgitlab-ce-cb0d23c455b73486fd1015f8ca9479b5b7e3585d.tar.gz
Add latest changes from gitlab-org/gitlab@12-7-stable-ee
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/generate_sample_prometheus_data_spec.rb2
-rw-r--r--spec/tasks/gitlab/import_export/import_rake_spec.rb36
2 files changed, 7 insertions, 31 deletions
diff --git a/spec/tasks/gitlab/generate_sample_prometheus_data_spec.rb b/spec/tasks/gitlab/generate_sample_prometheus_data_spec.rb
index 72e61f5c524..7620047624a 100644
--- a/spec/tasks/gitlab/generate_sample_prometheus_data_spec.rb
+++ b/spec/tasks/gitlab/generate_sample_prometheus_data_spec.rb
@@ -17,7 +17,7 @@ describe 'gitlab:generate_sample_prometheus_data rake task' do
it 'creates the file correctly' do
Rake.application.rake_require 'tasks/gitlab/generate_sample_prometheus_data'
allow(Environment).to receive(:find).and_return(environment)
- allow(environment).to receive_message_chain(:prometheus_adapter, :prometheus_client, :query_range) { sample_query_result }
+ allow(environment).to receive_message_chain(:prometheus_adapter, :prometheus_client, :query_range) { sample_query_result[30] }
run_rake_task('gitlab:generate_sample_prometheus_data', [environment.id])
expect(File.exist?(sample_query_file)).to be true
diff --git a/spec/tasks/gitlab/import_export/import_rake_spec.rb b/spec/tasks/gitlab/import_export/import_rake_spec.rb
index 18b89912b9f..b824ede03b2 100644
--- a/spec/tasks/gitlab/import_export/import_rake_spec.rb
+++ b/spec/tasks/gitlab/import_export/import_rake_spec.rb
@@ -76,37 +76,13 @@ describe 'gitlab:import_export:import rake task', :sidekiq do
let(:not_imported_message) { /Total number of not imported relations: 1/ }
let(:error) { /Validation failed: Notes is invalid/ }
- context 'when import_graceful_failures feature flag is enabled' do
- before do
- stub_feature_flags(import_graceful_failures: true)
- end
-
- it 'performs project import successfully' do
- expect { subject }.to output(not_imported_message).to_stdout
- expect { subject }.not_to raise_error
-
- expect(project.merge_requests).to be_empty
- expect(project.import_state.last_error).to be_nil
- expect(project.import_state.status).to eq('finished')
- end
- end
-
- context 'when import_graceful_failures feature flag is disabled' do
- before do
- stub_feature_flags(import_graceful_failures: false)
- end
-
- it 'fails project import with an error' do
- # Catch exit call, and raise exception instead
- expect_any_instance_of(GitlabProjectImport).to receive(:exit)
- .with(1).and_raise(SystemExit)
-
- expect { subject }.to raise_error(SystemExit).and output(error).to_stdout
+ it 'performs project import successfully' do
+ expect { subject }.to output(not_imported_message).to_stdout
+ expect { subject }.not_to raise_error
- expect(project.merge_requests).to be_empty
- expect(project.import_state.last_error).to match(error)
- expect(project.import_state.status).to eq('failed')
- end
+ expect(project.merge_requests).to be_empty
+ expect(project.import_state.last_error).to be_nil
+ expect(project.import_state.status).to eq('finished')
end
end
end