Commit e56fd471 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 8831c2df
...@@ -419,7 +419,8 @@ end ...@@ -419,7 +419,8 @@ end
gem 'octokit', '~> 4.15' gem 'octokit', '~> 4.15'
gem 'mail_room', '~> 0.10.0' # https://gitlab.com/gitlab-org/gitlab/issues/207207
gem 'gitlab-mail_room', '~> 0.0.2', require: 'mail_room'
gem 'email_reply_trimmer', '~> 0.1' gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text' gem 'html2text'
......
...@@ -388,6 +388,7 @@ GEM ...@@ -388,6 +388,7 @@ GEM
opentracing (~> 0.4) opentracing (~> 0.4)
redis (> 3.0.0, < 5.0.0) redis (> 3.0.0, < 5.0.0)
gitlab-license (1.0.0) gitlab-license (1.0.0)
gitlab-mail_room (0.0.2)
gitlab-markup (1.7.0) gitlab-markup (1.7.0)
gitlab-net-dns (0.9.1) gitlab-net-dns (0.9.1)
gitlab-puma (4.3.1.gitlab.2) gitlab-puma (4.3.1.gitlab.2)
...@@ -616,7 +617,6 @@ GEM ...@@ -616,7 +617,6 @@ GEM
lumberjack (1.0.13) lumberjack (1.0.13)
mail (2.7.1) mail (2.7.1)
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
mail_room (0.10.0)
marcel (0.3.3) marcel (0.3.3)
mimemagic (~> 0.3.2) mimemagic (~> 0.3.2)
marginalia (1.8.0) marginalia (1.8.0)
...@@ -1235,6 +1235,7 @@ DEPENDENCIES ...@@ -1235,6 +1235,7 @@ DEPENDENCIES
gitlab-chronic (~> 0.10.5) gitlab-chronic (~> 0.10.5)
gitlab-labkit (= 0.10.0) gitlab-labkit (= 0.10.0)
gitlab-license (~> 1.0) gitlab-license (~> 1.0)
gitlab-mail_room (~> 0.0.2)
gitlab-markup (~> 1.7.0) gitlab-markup (~> 1.7.0)
gitlab-net-dns (~> 0.9.1) gitlab-net-dns (~> 0.9.1)
gitlab-puma (~> 4.3.1.gitlab.2) gitlab-puma (~> 4.3.1.gitlab.2)
...@@ -1284,7 +1285,6 @@ DEPENDENCIES ...@@ -1284,7 +1285,6 @@ DEPENDENCIES
loofah (~> 2.2) loofah (~> 2.2)
lru_redux lru_redux
mail (= 2.7.1) mail (= 2.7.1)
mail_room (~> 0.10.0)
marginalia (~> 1.8.0) marginalia (~> 1.8.0)
memory_profiler (~> 0.9) memory_profiler (~> 0.9)
method_source (~> 0.8) method_source (~> 0.8)
......
...@@ -19,7 +19,7 @@ get_mail_room_pid() ...@@ -19,7 +19,7 @@ get_mail_room_pid()
start() start()
{ {
bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1 bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room --log-exit-as json -q -c $mail_room_config >> $mail_room_logfile 2>&1
} }
stop() stop()
......
---
title: Replace content_viewer_spec setTimeouts with semantic actions / events
merge_request:
author: Oregand
type: other
...@@ -121,10 +121,7 @@ Rails.application.routes.draw do ...@@ -121,10 +121,7 @@ Rails.application.routes.draw do
draw :country draw :country
draw :country_state draw :country_state
draw :subscription draw :subscription
draw :analytics
constraints(-> (*) { Gitlab::Analytics.any_features_enabled? }) do
draw :analytics
end
end end
if ENV['GITLAB_CHAOS_SECRET'] || Rails.env.development? || Rails.env.test? if ENV['GITLAB_CHAOS_SECRET'] || Rails.env.development? || Rails.env.test?
......
...@@ -85,7 +85,11 @@ module Gitlab ...@@ -85,7 +85,11 @@ module Gitlab
job['pid'] = ::Process.pid job['pid'] = ::Process.pid
job.delete('args') unless ENV['SIDEKIQ_LOG_ARGUMENTS'] job.delete('args') unless ENV['SIDEKIQ_LOG_ARGUMENTS']
job['args'] = Gitlab::Utils::LogLimitedArray.log_limited_array(job['args']) if job['args']
if job['args']
job['args'].map!(&:to_s)
job['args'] = Gitlab::Utils::LogLimitedArray.log_limited_array(job['args'])
end
job job
end end
......
...@@ -73,5 +73,20 @@ describe 'Group navbar' do ...@@ -73,5 +73,20 @@ describe 'Group navbar' do
it_behaves_like 'verified navigation bar' it_behaves_like 'verified navigation bar'
end end
context 'when value stream analytics is available' do
before do
stub_licensed_features(cycle_analytics_for_groups: true)
analytics_nav_item[:nav_sub_items] << _('Value Stream Analytics')
group.add_maintainer(user)
sign_in(user)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
end end
end end
import Vue from 'vue'; import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import mountComponent from 'spec/helpers/vue_mount_component_helper'; import mountComponent from 'spec/helpers/vue_mount_component_helper';
import waitForPromises from 'spec/helpers/wait_for_promises';
import { GREEN_BOX_IMAGE_URL } from 'spec/test_constants'; import { GREEN_BOX_IMAGE_URL } from 'spec/test_constants';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import contentViewer from '~/vue_shared/components/content_viewer/content_viewer.vue'; import contentViewer from '~/vue_shared/components/content_viewer/content_viewer.vue';
...@@ -22,7 +23,7 @@ describe('ContentViewer', () => { ...@@ -22,7 +23,7 @@ describe('ContentViewer', () => {
it('markdown preview renders + loads rendered markdown from server', done => { it('markdown preview renders + loads rendered markdown from server', done => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
mock.onPost(`${gon.relative_url_root}/testproject/preview_markdown`).reply(200, { mock.onPost(`${gon.relative_url_root}/testproject/preview_markdown`).replyOnce(200, {
body: '<b>testing</b>', body: '<b>testing</b>',
}); });
...@@ -33,13 +34,12 @@ describe('ContentViewer', () => { ...@@ -33,13 +34,12 @@ describe('ContentViewer', () => {
type: 'markdown', type: 'markdown',
}); });
const previewContainer = vm.$el.querySelector('.md-previewer'); waitForPromises()
.then(() => {
setTimeout(() => { expect(vm.$el.querySelector('.md-previewer').textContent).toContain('testing');
expect(previewContainer.textContent).toContain('testing'); })
.then(done)
done(); .catch(done.fail);
});
}); });
it('renders image preview', done => { it('renders image preview', done => {
...@@ -49,11 +49,12 @@ describe('ContentViewer', () => { ...@@ -49,11 +49,12 @@ describe('ContentViewer', () => {
type: 'image', type: 'image',
}); });
setTimeout(() => { vm.$nextTick()
expect(vm.$el.querySelector('img').getAttribute('src')).toBe(GREEN_BOX_IMAGE_URL); .then(() => {
expect(vm.$el.querySelector('img').getAttribute('src')).toBe(GREEN_BOX_IMAGE_URL);
done(); })
}); .then(done)
.catch(done.fail);
}); });
it('renders fallback download control', done => { it('renders fallback download control', done => {
...@@ -62,18 +63,19 @@ describe('ContentViewer', () => { ...@@ -62,18 +63,19 @@ describe('ContentViewer', () => {
fileSize: 1024, fileSize: 1024,
}); });
setTimeout(() => { vm.$nextTick()
expect( .then(() => {
vm.$el expect(
.querySelector('.file-info') vm.$el
.textContent.trim() .querySelector('.file-info')
.replace(/\s+/, ' '), .textContent.trim()
).toEqual('test.abc (1.00 KiB)'); .replace(/\s+/, ' '),
).toEqual('test.abc (1.00 KiB)');
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download');
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download');
done(); })
}); .then(done)
.catch(done.fail);
}); });
it('renders fallback download control for file with a data URL path properly', done => { it('renders fallback download control for file with a data URL path properly', done => {
...@@ -82,13 +84,14 @@ describe('ContentViewer', () => { ...@@ -82,13 +84,14 @@ describe('ContentViewer', () => {
filePath: 'somepath/test.abc', filePath: 'somepath/test.abc',
}); });
setTimeout(() => { vm.$nextTick()
expect(vm.$el.querySelector('.file-info').textContent.trim()).toEqual('test.abc'); .then(() => {
expect(vm.$el.querySelector('.btn.btn-default')).toHaveAttr('download', 'test.abc'); expect(vm.$el.querySelector('.file-info').textContent.trim()).toEqual('test.abc');
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download'); expect(vm.$el.querySelector('.btn.btn-default')).toHaveAttr('download', 'test.abc');
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download');
done(); })
}); .then(done)
.catch(done.fail);
}); });
it('markdown preview receives the file path as a parameter', done => { it('markdown preview receives the file path as a parameter', done => {
...@@ -106,14 +109,15 @@ describe('ContentViewer', () => { ...@@ -106,14 +109,15 @@ describe('ContentViewer', () => {
filePath: 'foo/test.md', filePath: 'foo/test.md',
}); });
setTimeout(() => { vm.$nextTick()
expect(axios.post).toHaveBeenCalledWith( .then(() => {
`${gon.relative_url_root}/testproject/preview_markdown`, expect(axios.post).toHaveBeenCalledWith(
{ path: 'foo/test.md', text: '* Test' }, `${gon.relative_url_root}/testproject/preview_markdown`,
jasmine.any(Object), { path: 'foo/test.md', text: '* Test' },
); jasmine.any(Object),
);
done(); })
}); .then(done)
.catch(done.fail);
}); });
}); });
...@@ -30,6 +30,7 @@ describe Gitlab::SidekiqLogging::StructuredLogger do ...@@ -30,6 +30,7 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
let(:clock_thread_cputime_end) { 1.333333799 } let(:clock_thread_cputime_end) { 1.333333799 }
let(:start_payload) do let(:start_payload) do
job.except('error_backtrace', 'error_class', 'error_message').merge( job.except('error_backtrace', 'error_class', 'error_message').merge(
'args' => job['args'].map(&:to_s),
'message' => 'TestWorker JID-da883554ee4fe414012f5f42: start', 'message' => 'TestWorker JID-da883554ee4fe414012f5f42: start',
'job_status' => 'start', 'job_status' => 'start',
'pid' => Process.pid, 'pid' => Process.pid,
...@@ -99,13 +100,29 @@ describe Gitlab::SidekiqLogging::StructuredLogger do ...@@ -99,13 +100,29 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
end end
end end
context 'when the job args contain non-string objects' do
it 'converts them to strings' do
Timecop.freeze(timestamp) do
job['args'] = [2, true, 'foo', { "foo" => "bar" }]
expected_args = ['2', 'true', 'foo', '{"foo"=>"bar"}']
expect(logger).to receive(:info).with(start_payload.merge('args' => expected_args)).ordered
expect(logger).to receive(:info).with(end_payload.merge('args' => expected_args)).ordered
expect(subject).to receive(:log_job_start).and_call_original
expect(subject).to receive(:log_job_done).and_call_original
subject.call(job, 'test_queue') { }
end
end
end
context 'when the job args are bigger than the maximum allowed' do context 'when the job args are bigger than the maximum allowed' do
it 'keeps args from the front until they exceed the limit' do it 'keeps args from the front until they exceed the limit' do
Timecop.freeze(timestamp) do Timecop.freeze(timestamp) do
half_limit = Gitlab::Utils::LogLimitedArray::MAXIMUM_ARRAY_LENGTH / 2 half_limit = Gitlab::Utils::LogLimitedArray::MAXIMUM_ARRAY_LENGTH / 2
job['args'] = [1, 2, 'a' * half_limit, 'b' * half_limit, 3] job['args'] = [1, 2, 'a' * half_limit, 'b' * half_limit, 3]
expected_args = job['args'].take(3) + ['...'] expected_args = job['args'].map(&:to_s).take(3) + ['...']
expect(logger).to receive(:info).with(start_payload.merge('args' => expected_args)).ordered expect(logger).to receive(:info).with(start_payload.merge('args' => expected_args)).ordered
expect(logger).to receive(:info).with(end_payload.merge('args' => expected_args)).ordered expect(logger).to receive(:info).with(end_payload.merge('args' => expected_args)).ordered
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment