Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
04a7fe4f4b
commit
a7e58fa022
|
|
@ -4,6 +4,12 @@
|
|||
- .rails-cache
|
||||
- .default-before_script
|
||||
- .memory:rules
|
||||
variables:
|
||||
METRICS_FILE: "metrics.txt"
|
||||
artifacts:
|
||||
reports:
|
||||
metrics: "${METRICS_FILE}"
|
||||
expire_in: 31d
|
||||
|
||||
memory-static:
|
||||
extends: .only-code-memory-job-base
|
||||
|
|
@ -11,24 +17,25 @@ memory-static:
|
|||
needs: ["setup-test-env"]
|
||||
variables:
|
||||
SETUP_DB: "false"
|
||||
MEMORY_BUNDLE_MEM_FILE: "tmp/memory_bundle_mem.txt"
|
||||
MEMORY_BUNDLE_OBJECTS_FILE: "tmp/memory_bundle_objects.txt"
|
||||
script:
|
||||
# Uses two different reports from the 'derailed_benchmars' gem.
|
||||
|
||||
# Loads each of gems in the Gemfile and checks how much memory they consume when they are required.
|
||||
# 'derailed_benchmarks' internally uses 'get_process_mem'
|
||||
- bundle exec derailed bundle:mem > tmp/memory_bundle_mem.txt
|
||||
- scripts/generate-gems-size-metrics-static tmp/memory_bundle_mem.txt >> 'tmp/memory_metrics.txt'
|
||||
- bundle exec derailed bundle:mem > "${MEMORY_BUNDLE_MEM_FILE}"
|
||||
- scripts/generate-gems-size-metrics-static "${MEMORY_BUNDLE_MEM_FILE}" >> "${METRICS_FILE}"
|
||||
|
||||
# Outputs detailed information about objects created while gems are loaded.
|
||||
# 'derailed_benchmarks' internally uses 'memory_profiler'
|
||||
- bundle exec derailed bundle:objects > tmp/memory_bundle_objects.txt
|
||||
- scripts/generate-gems-memory-metrics-static tmp/memory_bundle_objects.txt >> 'tmp/memory_metrics.txt'
|
||||
- bundle exec derailed bundle:objects > "${MEMORY_BUNDLE_OBJECTS_FILE}"
|
||||
- scripts/generate-gems-memory-metrics-static "${MEMORY_BUNDLE_OBJECTS_FILE}" >> "${METRICS_FILE}"
|
||||
artifacts:
|
||||
paths:
|
||||
- tmp/memory_*.txt
|
||||
reports:
|
||||
metrics: tmp/memory_metrics.txt
|
||||
expire_in: 31d
|
||||
- "${METRICS_FILE}"
|
||||
- "${MEMORY_BUNDLE_MEM_FILE}"
|
||||
- "${MEMORY_BUNDLE_OBJECTS_FILE}"
|
||||
|
||||
# Show memory usage caused by invoking require per gem.
|
||||
# Unlike `memory-static`, it hits the app with one request to ensure that any last minute require-s have been called.
|
||||
|
|
@ -44,12 +51,11 @@ memory-on-boot:
|
|||
NODE_ENV: "production"
|
||||
RAILS_ENV: "production"
|
||||
SETUP_DB: "true"
|
||||
MEMORY_ON_BOOT_FILE: "tmp/memory_on_boot.txt"
|
||||
script:
|
||||
- PATH_TO_HIT="/users/sign_in" CUT_OFF=0.3 bundle exec derailed exec perf:mem >> 'tmp/memory_on_boot.txt'
|
||||
- scripts/generate-memory-metrics-on-boot tmp/memory_on_boot.txt >> 'tmp/memory_on_boot_metrics.txt'
|
||||
- PATH_TO_HIT="/users/sign_in" CUT_OFF=0.3 bundle exec derailed exec perf:mem >> "${MEMORY_ON_BOOT_FILE}"
|
||||
- scripts/generate-memory-metrics-on-boot "${MEMORY_ON_BOOT_FILE}" >> "${METRICS_FILE}"
|
||||
artifacts:
|
||||
paths:
|
||||
- tmp/memory_*.txt
|
||||
reports:
|
||||
metrics: tmp/memory_on_boot_metrics.txt
|
||||
expire_in: 31d
|
||||
- "${METRICS_FILE}"
|
||||
- "${MEMORY_ON_BOOT_FILE}"
|
||||
|
|
|
|||
|
|
@ -20,3 +20,7 @@ export const BV_DROPDOWN_HIDE = 'bv::dropdown::hide';
|
|||
|
||||
export const DEFAULT_TH_CLASSES =
|
||||
'gl-bg-transparent! gl-border-b-solid! gl-border-b-gray-100! gl-p-5! gl-border-b-1!';
|
||||
|
||||
// We set the drawer's z-index to 252 to clear flash messages that might
|
||||
// be displayed in the page and that have a z-index of 251.
|
||||
export const DRAWER_Z_INDEX = 252;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import $ from 'jquery';
|
||||
import createFlash from '~/flash';
|
||||
import toast from '~/vue_shared/plugins/global_toast';
|
||||
import { __ } from '~/locale';
|
||||
import eventHub from '~/vue_merge_request_widget/event_hub';
|
||||
import axios from './lib/utils/axios_utils';
|
||||
|
|
@ -136,10 +137,9 @@ MergeRequest.hideCloseButton = function () {
|
|||
|
||||
MergeRequest.toggleDraftStatus = function (title, isReady) {
|
||||
if (isReady) {
|
||||
createFlash({
|
||||
message: __('Marked as ready. Merging is now allowed.'),
|
||||
type: 'notice',
|
||||
});
|
||||
toast(__('Marked as ready. Merging is now allowed.'));
|
||||
} else {
|
||||
toast(__('Marked as draft. Can only be merged when marked as ready.'));
|
||||
}
|
||||
const titleEl = document.querySelector('.merge-request .detail-page-description .title');
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { GlButton } from '@gitlab/ui';
|
|||
import { produce } from 'immer';
|
||||
import $ from 'jquery';
|
||||
import createFlash from '~/flash';
|
||||
import toast from '~/vue_shared/plugins/global_toast';
|
||||
import { __ } from '~/locale';
|
||||
import MergeRequest from '~/merge_request';
|
||||
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
|
||||
|
|
@ -123,10 +124,7 @@ export default {
|
|||
},
|
||||
},
|
||||
}) => {
|
||||
createFlash({
|
||||
message: __('Marked as ready. Merging is now allowed.'),
|
||||
type: 'notice',
|
||||
});
|
||||
toast(__('Marked as ready. Merging is now allowed.'));
|
||||
$('.merge-request .detail-page-description .title').text(title);
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -116,6 +116,9 @@ class Namespace < ApplicationRecord
|
|||
# TODO: change to `type: Namespaces::UserNamespace.sti_name` when
|
||||
# working on issue https://gitlab.com/gitlab-org/gitlab/-/issues/341070
|
||||
scope :user_namespaces, -> { where(type: [nil, Namespaces::UserNamespace.sti_name]) }
|
||||
# TODO: this can be simplified with `type != 'Project'` when working on issue
|
||||
# https://gitlab.com/gitlab-org/gitlab/-/issues/341070
|
||||
scope :without_project_namespaces, -> { where("type IS DISTINCT FROM ?", Namespaces::ProjectNamespace.sti_name) }
|
||||
scope :sort_by_type, -> { order(Gitlab::Database.nulls_first_order(:type)) }
|
||||
scope :include_route, -> { includes(:route) }
|
||||
scope :by_parent, -> (parent) { where(parent_id: parent) }
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ the LDAP server, or share email addresses.
|
|||
### User deletion
|
||||
|
||||
Users deleted from the LDAP server are immediately blocked from signing in
|
||||
to GitLab. However, there's an LDAP check cache time of one hour (which is
|
||||
to GitLab and [no longer consumes a
|
||||
license](../../../user/admin_area/moderate_users.md).
|
||||
However, there's an LDAP check cache time of one hour (which is
|
||||
[configurable](#adjust-ldap-user-sync-schedule) for GitLab Premium users).
|
||||
This means users already signed-in or who are using Git over SSH can access
|
||||
GitLab for up to one hour. Manually block the user in the GitLab Admin Area
|
||||
|
|
|
|||
|
|
@ -848,10 +848,6 @@ describe GraphQL::Query, type: :request do
|
|||
|
||||
all_releases_query_path = 'releases/graphql/queries/all_releases.query.graphql'
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('graphql/releases/')
|
||||
end
|
||||
|
||||
it "graphql/#{all_releases_query_path}.json" do
|
||||
query = get_graphql_query_as_string(all_releases_query_path)
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ In order to completely prevent access of a user to the GitLab instance,
|
|||
administrators can choose to block the user.
|
||||
|
||||
Users can be blocked [via an abuse report](review_abuse_reports.md#blocking-users),
|
||||
or directly from the Admin Area. To do this:
|
||||
by removing them in LDAP, or directly from the Admin Area. To do this:
|
||||
|
||||
1. On the top bar, select **Menu > Admin**.
|
||||
1. On the left sidebar, select **Overview > Users**.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
require 'yaml'
|
||||
|
||||
unless Rails.env.production?
|
||||
namespace :frontend do
|
||||
desc 'GitLab | Frontend | Generate fixtures for JavaScript tests'
|
||||
RSpec::Core::RakeTask.new(:fixtures, [:pattern]) do |t, args|
|
||||
require 'fileutils'
|
||||
require_relative '../../spec/support/helpers/javascript_fixtures_helpers'
|
||||
|
||||
FileUtils.rm_r(JavaScriptFixturesHelpers.fixture_root_path, force: true)
|
||||
|
||||
directories = %w[spec]
|
||||
directories << 'ee/spec' if Gitlab.ee?
|
||||
directory_glob = "{#{directories.join(',')}}"
|
||||
|
|
@ -16,6 +20,8 @@ unless Rails.env.production?
|
|||
|
||||
desc 'GitLab | Frontend | Generate fixtures for JavaScript integration tests'
|
||||
RSpec::Core::RakeTask.new(:mock_server_rspec_fixtures) do |t, args|
|
||||
require 'yaml'
|
||||
|
||||
base_path = Pathname.new('spec/frontend_integration/fixture_generators.yml')
|
||||
ee_path = Pathname.new('ee') + base_path
|
||||
|
||||
|
|
|
|||
|
|
@ -20889,6 +20889,9 @@ msgstr ""
|
|||
msgid "Marked For Deletion At - %{deletion_time}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Marked as draft. Can only be merged when marked as ready."
|
||||
msgstr ""
|
||||
|
||||
msgid "Marked as ready. Merging is now allowed."
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -23724,6 +23727,9 @@ msgstr ""
|
|||
msgid "OnCallSchedules|Your schedule has been successfully created. To add individual users to this schedule, use the Add a rotation button. To enable notifications for this schedule, you must also create an %{linkStart}escalation policy%{linkEnd}."
|
||||
msgstr ""
|
||||
|
||||
msgid "OnDemandScans|%{learnMoreLinkStart}Lean more about on-demand scans%{learnMoreLinkEnd}."
|
||||
msgstr ""
|
||||
|
||||
msgid "OnDemandScans|Could not fetch scanner profiles. Please refresh the page, or try again later."
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -23808,6 +23814,15 @@ msgstr ""
|
|||
msgid "OnDemandScans|Start time"
|
||||
msgstr ""
|
||||
|
||||
msgid "OnDemandScans|There are no finished scans."
|
||||
msgstr ""
|
||||
|
||||
msgid "OnDemandScans|There are no running scans."
|
||||
msgstr ""
|
||||
|
||||
msgid "OnDemandScans|There are no scheduled scans."
|
||||
msgstr ""
|
||||
|
||||
msgid "OnDemandScans|Use existing scanner profile"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ function setup_db_user_only() {
|
|||
|
||||
function setup_db() {
|
||||
run_timed_command "setup_db_user_only"
|
||||
run_timed_command "bundle exec rake db:drop db:create db:structure:load db:migrate gitlab:db:setup_ee"
|
||||
run_timed_command_with_metric "bundle exec rake db:drop db:create db:structure:load db:migrate gitlab:db:setup_ee" "setup_db"
|
||||
}
|
||||
|
||||
function install_api_client_dependencies_with_apk() {
|
||||
|
|
@ -78,15 +78,27 @@ function install_tff_gem() {
|
|||
|
||||
function run_timed_command() {
|
||||
local cmd="${1}"
|
||||
local metric_name="${2}"
|
||||
local timed_metric_file
|
||||
local start=$(date +%s)
|
||||
|
||||
echosuccess "\$ ${cmd}"
|
||||
eval "${cmd}"
|
||||
|
||||
local ret=$?
|
||||
local end=$(date +%s)
|
||||
local runtime=$((end-start))
|
||||
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
echosuccess "==> '${cmd}' succeeded in ${runtime} seconds."
|
||||
|
||||
if [[ -n "${metric_name}" ]]; then
|
||||
timed_metric_file=$(timed_metric_file $metric_name)
|
||||
echo "# TYPE ${metric_name} gauge" > "${timed_metric_file}"
|
||||
echo "# UNIT ${metric_name} seconds" >> "${timed_metric_file}"
|
||||
echo "${metric_name} ${runtime}" >> "${timed_metric_file}"
|
||||
fi
|
||||
|
||||
return 0
|
||||
else
|
||||
echoerr "==> '${cmd}' failed (${ret}) in ${runtime} seconds."
|
||||
|
|
@ -94,6 +106,26 @@ function run_timed_command() {
|
|||
fi
|
||||
}
|
||||
|
||||
function run_timed_command_with_metric() {
|
||||
local cmd="${1}"
|
||||
local metric_name="${2}"
|
||||
local metrics_file=${METRICS_FILE:-metrics.txt}
|
||||
|
||||
run_timed_command "${cmd}" "${metric_name}"
|
||||
|
||||
local ret=$?
|
||||
|
||||
cat $(timed_metric_file $metric_name) >> "${metrics_file}"
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
function timed_metric_file() {
|
||||
local metric_name="${1}"
|
||||
|
||||
echo "$(pwd)/tmp/duration_${metric_name}.txt"
|
||||
}
|
||||
|
||||
function echoerr() {
|
||||
local header="${2}"
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,6 @@ RSpec.describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :co
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('abuse_reports/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(admin)
|
||||
enable_admin_mode!(admin)
|
||||
|
|
|
|||
|
|
@ -17,10 +17,6 @@ RSpec.describe Admin::UsersController, '(JavaScript fixtures)', type: :controlle
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('admin/users')
|
||||
end
|
||||
|
||||
it 'admin/users/new_with_internal_user_regex.html' do
|
||||
stub_application_setting(user_default_external: true)
|
||||
stub_application_setting(user_default_internal_regex: '^(?:(?!\.ext@).)*$\r?')
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
|
|||
|
||||
let_it_be(:value_stream_id) { 'default' }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('projects/analytics/value_stream_analytics/')
|
||||
end
|
||||
|
||||
before do
|
||||
update_metrics
|
||||
create_deployment
|
||||
|
|
|
|||
|
|
@ -21,11 +21,7 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
|
|||
|
||||
let(:project_wiki_page) { create(:wiki_page, wiki: project_wiki) }
|
||||
|
||||
fixture_subdir = 'api/markdown'
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures(fixture_subdir)
|
||||
|
||||
group.add_owner(user)
|
||||
project.add_maintainer(user)
|
||||
end
|
||||
|
|
@ -49,7 +45,7 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
|
|||
|
||||
name = "#{context}_#{name}" unless context.empty?
|
||||
|
||||
it "#{fixture_subdir}/#{name}.json" do
|
||||
it "api/markdown/#{name}.json" do
|
||||
api_url = case context
|
||||
when 'project'
|
||||
"/#{project.full_path}/preview_markdown"
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
|
|||
let_it_be(:project) { create(:project, :repository, namespace: namespace, path: 'lorem-ipsum') }
|
||||
let_it_be(:mr) { create(:merge_request, source_project: project) }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('api/merge_requests')
|
||||
end
|
||||
|
||||
it 'api/merge_requests/get.json' do
|
||||
4.times { |i| create(:merge_request, source_project: project, source_branch: "branch-#{i}") }
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ RSpec.describe API::Projects, '(JavaScript fixtures)', type: :request do
|
|||
let(:project) { create(:project, :repository, namespace: namespace, path: 'lorem-ipsum') }
|
||||
let(:project_empty) { create(:project_empty_repo, namespace: namespace, path: 'lorem-ipsum-empty') }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('api/projects')
|
||||
end
|
||||
|
||||
it 'api/projects/get.json' do
|
||||
get api("/projects/#{project.id}", admin)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,6 @@ RSpec.describe Admin::ApplicationSettingsController, '(JavaScript fixtures)', ty
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('application_settings/')
|
||||
end
|
||||
|
||||
after do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ RSpec.describe ::AutocompleteController, '(JavaScript fixtures)', type: :control
|
|||
let(:project) { create(:project, namespace: group, path: 'autocomplete-project') }
|
||||
let(:merge_request) { create(:merge_request, source_project: project, author: user) }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('autocomplete/')
|
||||
end
|
||||
|
||||
before do
|
||||
group.add_owner(user)
|
||||
sign_in(user)
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@ RSpec.describe Projects::AutocompleteSourcesController, '(JavaScript fixtures)',
|
|||
let_it_be(:project) { create(:project, namespace: group, path: 'autocomplete-sources-project') }
|
||||
let_it_be(:issue) { create(:issue, project: project) }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('autocomplete_sources/')
|
||||
end
|
||||
|
||||
before do
|
||||
group.add_owner(user)
|
||||
sign_in(user)
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ RSpec.describe Projects::BlobController, '(JavaScript fixtures)', type: :control
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('blob/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
allow(SecureRandom).to receive(:hex).and_return('securerandomhex:thereisnospoon')
|
||||
|
|
|
|||
|
|
@ -9,11 +9,6 @@ RSpec.describe 'Branches (JavaScript fixtures)' do
|
|||
let_it_be(:project) { create(:project, :repository, namespace: namespace, path: 'branches-project') }
|
||||
let_it_be(:user) { project.owner }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('branches/')
|
||||
clean_frontend_fixtures('api/branches/')
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ RSpec.describe Projects::ClustersController, '(JavaScript fixtures)', type: :con
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('clusters/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,11 +9,6 @@ RSpec.describe 'Commit (JavaScript fixtures)' do
|
|||
let_it_be(:user) { project.owner }
|
||||
let_it_be(:commit) { project.commit("master") }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('commit/')
|
||||
clean_frontend_fixtures('api/commits/')
|
||||
end
|
||||
|
||||
before do
|
||||
allow(SecureRandom).to receive(:hex).and_return('securerandomhex:thereisnospoon')
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,10 +13,6 @@ RSpec.describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :c
|
|||
let(:project3) { create(:project, :internal)}
|
||||
let(:project4) { create(:project, :internal)}
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('deploy_keys/')
|
||||
end
|
||||
|
||||
before do
|
||||
# Using an admin for these fixtures because they are used for verifying a frontend
|
||||
# component that would normally get its data from `Admin::DeployKeysController`
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@ RSpec.describe 'Freeze Periods (JavaScript fixtures)' do
|
|||
let_it_be(:project) { create(:project, :repository, path: 'freeze-periods-project') }
|
||||
let_it_be(:user) { project.owner }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('api/freeze-periods/')
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,10 +8,6 @@ RSpec.describe 'Groups (JavaScript fixtures)', type: :controller do
|
|||
let(:user) { create(:user) }
|
||||
let(:group) { create(:group, name: 'frontend-fixtures-group', runners_token: 'runnerstoken:intabulasreferre')}
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('groups/')
|
||||
end
|
||||
|
||||
before do
|
||||
group.add_owner(user)
|
||||
sign_in(user)
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ RSpec.describe Projects::IssuesController, '(JavaScript fixtures)', type: :contr
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('issues/')
|
||||
end
|
||||
|
||||
before do
|
||||
project.add_maintainer(user)
|
||||
sign_in(user)
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@ RSpec.describe Projects::JobsController, '(JavaScript fixtures)', type: :control
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('jobs/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,10 +17,6 @@ RSpec.describe 'Labels (JavaScript fixtures)' do
|
|||
let!(:groub_label_space) { create(:group_label, group: group, title: 'some space', color: '#FFFFFF') }
|
||||
let!(:groub_label_violets) { create(:group_label, group: group, title: 'violets', color: '#0000FF') }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('labels/')
|
||||
end
|
||||
|
||||
after do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -49,10 +49,6 @@ RSpec.describe Projects::MergeRequestsController, '(JavaScript fixtures)', type:
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('merge_requests/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
allow(Discussion).to receive(:build_discussion_id).and_return(['discussionid:ceterumcenseo'])
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@ RSpec.describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)'
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('merge_request_diffs/')
|
||||
end
|
||||
|
||||
before do
|
||||
# Create a user that matches the project.commit author
|
||||
# This is so that the "author" information will be populated
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ RSpec.describe MetricsDashboard, '(JavaScript fixtures)', type: :controller do
|
|||
let_it_be(:environment) { create(:environment, id: 1, project: project) }
|
||||
let_it_be(:params) { { environment: environment } }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('metrics_dashboard/')
|
||||
end
|
||||
|
||||
controller(::ApplicationController) do
|
||||
include MetricsDashboard
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ RSpec.describe Projects::PipelineSchedulesController, '(JavaScript fixtures)', t
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('pipeline_schedules/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,10 +23,6 @@ RSpec.describe Projects::PipelinesController, '(JavaScript fixtures)', type: :co
|
|||
let!(:build_test) { create(:ci_build, pipeline: pipeline, stage: 'test') }
|
||||
let!(:build_deploy_failed) { create(:ci_build, status: :failed, pipeline: pipeline, stage: 'deploy') }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('pipelines/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,10 +16,6 @@ RSpec.describe 'Projects (JavaScript fixtures)', type: :controller do
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('projects/')
|
||||
end
|
||||
|
||||
before do
|
||||
project_with_repo.add_maintainer(user)
|
||||
sign_in(user)
|
||||
|
|
@ -57,10 +53,6 @@ RSpec.describe 'Projects (JavaScript fixtures)', type: :controller do
|
|||
project_variable_populated.add_maintainer(user)
|
||||
end
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('graphql/projects/access_tokens')
|
||||
end
|
||||
|
||||
base_input_path = 'access_tokens/graphql/queries/'
|
||||
base_output_path = 'graphql/projects/access_tokens/'
|
||||
query_name = 'get_projects.query.graphql'
|
||||
|
|
|
|||
|
|
@ -8,10 +8,6 @@ RSpec.describe 'Projects JSON endpoints (JavaScript fixtures)', type: :controlle
|
|||
let(:admin) { create(:admin, name: 'root') }
|
||||
let(:project) { create(:project, :repository) }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('projects_json/')
|
||||
end
|
||||
|
||||
before do
|
||||
project.add_maintainer(admin)
|
||||
sign_in(admin)
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ RSpec.describe Projects::ServicesController, '(JavaScript fixtures)', type: :con
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('services/prometheus')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,14 +9,6 @@ RSpec.describe 'Raw files', '(JavaScript fixtures)' do
|
|||
let(:project) { create(:project, :repository, namespace: namespace, path: 'raw-project') }
|
||||
let(:response) { @blob.data.force_encoding('UTF-8') }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('blob/notebook/')
|
||||
clean_frontend_fixtures('blob/pdf/')
|
||||
clean_frontend_fixtures('blob/text/')
|
||||
clean_frontend_fixtures('blob/binary/')
|
||||
clean_frontend_fixtures('blob/images/')
|
||||
end
|
||||
|
||||
after do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -116,10 +116,6 @@ RSpec.describe 'Releases (JavaScript fixtures)' do
|
|||
end
|
||||
|
||||
describe API::Releases, type: :request do
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('api/releases/')
|
||||
end
|
||||
|
||||
it 'api/releases/release.json' do
|
||||
get api("/projects/#{project.id}/releases/#{release.tag}", admin)
|
||||
|
||||
|
|
@ -134,10 +130,6 @@ RSpec.describe 'Releases (JavaScript fixtures)' do
|
|||
one_release_query_path = 'releases/graphql/queries/one_release.query.graphql'
|
||||
one_release_for_editing_query_path = 'releases/graphql/queries/one_release_for_editing.query.graphql'
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('graphql/releases/')
|
||||
end
|
||||
|
||||
it "graphql/#{all_releases_query_path}.json" do
|
||||
query = get_graphql_query_as_string(all_releases_query_path)
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@ RSpec.describe 'Runner (JavaScript fixtures)' do
|
|||
query_path = 'runner/graphql/'
|
||||
fixtures_path = 'graphql/runner/'
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures(fixtures_path)
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@ RSpec.describe SearchController, '(JavaScript fixtures)', type: :controller do
|
|||
|
||||
let_it_be(:user) { create(:user) }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('search/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ RSpec.describe Projects::ServicesController, '(JavaScript fixtures)', type: :con
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('services/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,10 +5,6 @@ require 'spec_helper'
|
|||
RSpec.describe 'Sessions (JavaScript fixtures)' do
|
||||
include JavaScriptFixturesHelpers
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('sessions/')
|
||||
end
|
||||
|
||||
describe SessionsController, '(JavaScript fixtures)', type: :controller do
|
||||
include DeviseHelpers
|
||||
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ RSpec.describe SnippetsController, '(JavaScript fixtures)', type: :controller do
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('snippets/')
|
||||
end
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
allow(Discussion).to receive(:build_discussion_id).and_return(['discussionid:ceterumcenseo'])
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@ RSpec.describe 'Startup CSS fixtures', type: :controller do
|
|||
|
||||
render_views
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('startup_css/')
|
||||
end
|
||||
|
||||
shared_examples 'startup css project fixtures' do |type|
|
||||
let(:user) { create(:user, :admin) }
|
||||
let(:project) { create(:project, :public, :repository, description: 'Code and stuff', creator: user) }
|
||||
|
|
|
|||
|
|
@ -8,10 +8,6 @@ RSpec.describe 'Tags (JavaScript fixtures)' do
|
|||
let_it_be(:project) { create(:project, :repository, path: 'tags-project') }
|
||||
let_it_be(:user) { project.owner }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('api/tags/')
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,10 +8,6 @@ RSpec.describe TimeZoneHelper, '(JavaScript fixtures)' do
|
|||
|
||||
let(:response) { @timezones.sort_by! { |tz| tz[:name] }.to_json }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('timezones/')
|
||||
end
|
||||
|
||||
it 'timezones/short.json' do
|
||||
@timezones = timezone_data(format: :short)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,10 +13,6 @@ RSpec.describe 'Todos (JavaScript fixtures)' do
|
|||
let(:issue_2) { create(:issue, title: 'issue_2', project: project) }
|
||||
let!(:todo_2) { create(:todo, :done, user: user, project: project, target: issue_2, created_at: 50.hours.ago) }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('todos/')
|
||||
end
|
||||
|
||||
after do
|
||||
remove_repository(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,10 +7,6 @@ RSpec.context 'U2F' do
|
|||
|
||||
let(:user) { create(:user, :two_factor_via_u2f, otp_secret: 'otpsecret:coolkids') }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('u2f/')
|
||||
end
|
||||
|
||||
before do
|
||||
stub_feature_flags(webauthn: false)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,10 +7,6 @@ RSpec.context 'WebAuthn' do
|
|||
|
||||
let(:user) { create(:user, :two_factor_via_webauthn, otp_secret: 'otpsecret:coolkids') }
|
||||
|
||||
before(:all) do
|
||||
clean_frontend_fixtures('webauthn/')
|
||||
end
|
||||
|
||||
describe SessionsController, '(JavaScript fixtures)', type: :controller do
|
||||
include DeviseHelpers
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import Vue from 'vue';
|
||||
import createFlash from '~/flash';
|
||||
import WorkInProgress from '~/vue_merge_request_widget/components/states/work_in_progress.vue';
|
||||
import toast from '~/vue_shared/plugins/global_toast';
|
||||
import eventHub from '~/vue_merge_request_widget/event_hub';
|
||||
|
||||
jest.mock('~/flash');
|
||||
jest.mock('~/vue_shared/plugins/global_toast');
|
||||
|
||||
const createComponent = () => {
|
||||
const Component = Vue.extend(WorkInProgress);
|
||||
|
|
@ -63,10 +63,7 @@ describe('Wip', () => {
|
|||
setImmediate(() => {
|
||||
expect(vm.isMakingRequest).toBeTruthy();
|
||||
expect(eventHub.$emit).toHaveBeenCalledWith('UpdateWidgetData', mrObj);
|
||||
expect(createFlash).toHaveBeenCalledWith({
|
||||
message: 'Marked as ready. Merging is now allowed.',
|
||||
type: 'notice',
|
||||
});
|
||||
expect(toast).toHaveBeenCalledWith('Marked as ready. Merging is now allowed.');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -299,6 +299,15 @@ RSpec.describe Namespace do
|
|||
expect(described_class.sorted_by_similarity_and_parent_id_desc('Namespace')).to eq([namespace2, namespace1, namespace2sub, namespace1sub, namespace])
|
||||
end
|
||||
end
|
||||
|
||||
describe '.without_project_namespaces' do
|
||||
let_it_be(:user_namespace) { create(:user_namespace) }
|
||||
let_it_be(:project_namespace) { create(:project_namespace) }
|
||||
|
||||
it 'excludes project namespaces' do
|
||||
expect(described_class.without_project_namespaces).to match_array([namespace, namespace1, namespace2, namespace1sub, namespace2sub, user_namespace, project_namespace.parent])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'delegate' do
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
require 'action_dispatch/testing/test_request'
|
||||
require 'fileutils'
|
||||
|
||||
require_relative '../../../lib/gitlab/popen'
|
||||
|
||||
module JavaScriptFixturesHelpers
|
||||
extend ActiveSupport::Concern
|
||||
include Gitlab::Popen
|
||||
|
|
@ -25,15 +27,6 @@ module JavaScriptFixturesHelpers
|
|||
'tmp/tests/frontend/fixtures' + (Gitlab.ee? ? '-ee' : '')
|
||||
end
|
||||
|
||||
# Public: Removes all fixture files from given directory
|
||||
#
|
||||
# directory_name - directory of the fixtures (relative to .fixture_root_path)
|
||||
#
|
||||
# TODO: Make sure this isn't called anymore.
|
||||
def clean_frontend_fixtures(directory_name)
|
||||
# We don't really need to cleanup fixtures, as this can be a problem when FOSS & EE fixtures try to generate files in the same folder.
|
||||
end
|
||||
|
||||
def remove_repository(project)
|
||||
Gitlab::Shell.new.remove_repository(project.repository_storage, project.disk_path)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue