diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
commit | 585826cb22ecea5998a2c2a4675735c94bdeedac (patch) | |
tree | 5b05f0b30d33cef48963609e8a18a4dff260eab3 /spec/support | |
parent | df221d036e5d0c6c0ee4d55b9c97f481ee05dee8 (diff) |
Add latest changes from gitlab-org/gitlab@16-6-stable-eev16.6.0-rc42
Diffstat (limited to 'spec/support')
120 files changed, 1683 insertions, 1728 deletions
diff --git a/spec/support/atlassian/jira_connect/schemata.rb b/spec/support/atlassian/jira_connect/schemata.rb index 73a6833b7cc..de1d6dbf691 100644 --- a/spec/support/atlassian/jira_connect/schemata.rb +++ b/spec/support/atlassian/jira_connect/schemata.rb @@ -7,11 +7,11 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w( + 'required' => %w[ schemaVersion pipelineId buildNumber updateSequenceNumber displayName url state issueKeys testInfo references lastUpdated - ), + ], 'properties' => { 'schemaVersion' => schema_version_type, 'pipelineId' => { 'type' => 'string' }, @@ -24,7 +24,7 @@ module Atlassian 'issueKeys' => issue_keys_type, 'testInfo' => { 'type' => 'object', - 'required' => %w(totalNumber numberPassed numberFailed numberSkipped), + 'required' => %w[totalNumber numberPassed numberFailed numberSkipped], 'properties' => { 'totalNumber' => { 'type' => 'integer' }, 'numberFailed' => { 'type' => 'integer' }, @@ -36,11 +36,11 @@ module Atlassian 'type' => 'array', 'items' => { 'type' => 'object', - 'required' => %w(commit ref), + 'required' => %w[commit ref], 'properties' => { 'commit' => { 'type' => 'object', - 'required' => %w(id repositoryUri), + 'required' => %w[id repositoryUri], 'properties' => { 'id' => { 'type' => 'string' }, 'repositoryUri' => { 'type' => 'string' } @@ -48,7 +48,7 @@ module Atlassian }, 'ref' => { 'type' => 'object', - 'required' => %w(name uri), + 'required' => %w[name uri], 'properties' => { 'name' => { 'type' => 'string' }, 'uri' => { 'type' => 'string' } @@ -65,16 +65,16 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w( + 'required' => %w[ deploymentSequenceNumber updateSequenceNumber associations displayName url description lastUpdated state pipeline environment - ), + ], 'properties' => { 'deploymentSequenceNumber' => { 'type' => 'integer' }, 'updateSequenceNumber' => { 'type' => 'integer' }, 'associations' => { - 'type' => %w(array), + 'type' => %w[array], 'items' => association_type, 'minItems' => 1 }, @@ -95,9 +95,9 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w( + 'required' => %w[ updateSequenceId id key issueKeys summary details - ), + ], 'properties' => { 'id' => { 'type' => 'string' }, 'key' => { 'type' => 'string' }, @@ -120,7 +120,7 @@ module Atlassian 'environment' => { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w(name), + 'required' => %w[name], 'properties' => { 'name' => { 'type' => 'string' }, 'type' => { @@ -144,7 +144,7 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w(url status lastUpdated), + 'required' => %w[url status lastUpdated], 'properties' => { 'lastUpdated' => iso8601_type, 'url' => { 'type' => 'string' }, @@ -157,7 +157,7 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w(enabled), + 'required' => %w[enabled], 'properties' => { 'enabled' => { 'type' => 'boolean' }, 'defaultValue' => { 'type' => 'string' }, @@ -182,7 +182,7 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w(id displayName type), + 'required' => %w[id displayName type], 'properties' => { 'id' => { 'type' => 'string', 'maxLength' => 255 }, 'displayName' => { 'type' => 'string', 'maxLength' => 255 }, @@ -198,7 +198,7 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w(id displayName url), + 'required' => %w[id displayName url], 'properties' => { 'id' => { 'type' => 'string', 'maxLength' => 255 }, 'displayName' => { 'type' => 'string', 'maxLength' => 255 }, @@ -222,7 +222,7 @@ module Atlassian { 'type' => 'object', 'additionalProperties' => false, - 'required' => %w(associationType values), + 'required' => %w[associationType values], 'properties' => { 'associationType' => { 'type' => 'string', @@ -276,7 +276,7 @@ module Atlassian def provider_metadata { 'type' => 'object', - 'required' => %w(product), + 'required' => %w[product], 'properties' => { 'product' => { 'type' => 'string' } } } end diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 78d7e57c208..c8fa430c02c 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -191,7 +191,7 @@ RSpec.configure do |config| if example.metadata[:screenshot] screenshot = example.metadata[:screenshot][:image] || example.metadata[:screenshot][:html] screenshot&.delete_prefix!(ENV.fetch('CI_PROJECT_DIR', '')) - example.metadata[:stdout] = %{[[ATTACHMENT|#{screenshot}]]} + example.metadata[:stdout] = %([[ATTACHMENT|#{screenshot}]]) end end diff --git a/spec/support/capybara_slow_finder.rb b/spec/support/capybara_slow_finder.rb index 975ddd52c1f..697b288e8b5 100644 --- a/spec/support/capybara_slow_finder.rb +++ b/spec/support/capybara_slow_finder.rb @@ -13,13 +13,13 @@ module Capybara # Inspired by https://github.com/ngauthier/capybara-slow_finder_errors module SlowFinder def synchronize(seconds = nil, errors: nil) - start_time = Gitlab::Metrics::System.monotonic_time + start_time = ::Gitlab::Metrics::System.monotonic_time super rescue Capybara::ElementNotFound => e seconds ||= Capybara.default_max_wait_time - raise e unless seconds > 0 && Gitlab::Metrics::System.monotonic_time - start_time > seconds + raise e unless seconds > 0 && ::Gitlab::Metrics::System.monotonic_time - start_time > seconds message = format(MESSAGE, timeout: seconds) raise e, "#{$!}\n\n#{message}", e.backtrace diff --git a/spec/support/database/auto_explain.rb b/spec/support/database/auto_explain.rb index 799457034a1..11f8f1f899b 100644 --- a/spec/support/database/auto_explain.rb +++ b/spec/support/database/auto_explain.rb @@ -119,9 +119,10 @@ module AutoExplain return false if ENV['CI_JOB_NAME_SLUG'] == 'db-migrate-non-superuser' return false if connection.database_version.to_s[0..1].to_i < 14 return false if connection.select_one('SHOW is_superuser')['is_superuser'] != 'on' + return false if connection.select_one('SELECT pg_stat_file(\'log/pglog.csv\', true)')['pg_stat_file'].nil? - # This condition matches the pipeline rules for if-merge-request-labels-record-queries - return true if ENV['CI_MERGE_REQUEST_LABELS']&.include?('pipeline:record-queries') + # This condition matches the pipeline rules for if-merge-request + return true if %w[detached merged_result].include?(ENV['CI_MERGE_REQUEST_EVENT_TYPE']) # This condition matches the pipeline rules for if-default-branch-refs ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] && !ENV['CI_MERGE_REQUEST_IID'] diff --git a/spec/support/database/click_house/hooks.rb b/spec/support/database/click_house/hooks.rb index b970d3daf84..77b33b7aaa3 100644 --- a/spec/support/database/click_house/hooks.rb +++ b/spec/support/database/click_house/hooks.rb @@ -2,6 +2,8 @@ # rubocop: disable Gitlab/NamespacedClass class ClickHouseTestRunner + include ClickHouseTestHelpers + def truncate_tables ClickHouse::Client.configuration.databases.each_key do |db| # Select tables with at least one row @@ -9,6 +11,8 @@ class ClickHouseTestRunner "(SELECT '#{table}' AS table FROM #{table} LIMIT 1)" end.join(' UNION ALL ') + next if query.empty? + tables_with_data = ClickHouse::Client.select(query, db).pluck('table') tables_with_data.each do |table| ClickHouse::Client.execute("TRUNCATE TABLE #{table}", db) @@ -19,17 +23,13 @@ class ClickHouseTestRunner def ensure_schema return if @ensure_schema - ClickHouse::Client.configuration.databases.each_key do |db| - # drop all tables - lookup_tables(db).each do |table| - ClickHouse::Client.execute("DROP TABLE IF EXISTS #{table}", db) - end + clear_db - # run the schema SQL files - Dir[Rails.root.join("db/click_house/#{db}/*.sql")].each do |file| - ClickHouse::Client.execute(File.read(file), db) - end - end + # run the schema SQL files + migrations_paths = ClickHouse::MigrationSupport::Migrator.migrations_paths + schema_migration = ClickHouse::MigrationSupport::SchemaMigration + migration_context = ClickHouse::MigrationSupport::MigrationContext.new(migrations_paths, schema_migration) + migrate(nil, migration_context) @ensure_schema = true end @@ -38,11 +38,7 @@ class ClickHouseTestRunner def tables_for(db) @tables ||= {} - @tables[db] ||= lookup_tables(db) - end - - def lookup_tables(db) - ClickHouse::Client.select('SHOW TABLES', db).pluck('name') + @tables[db] ||= lookup_tables(db) - [ClickHouse::MigrationSupport::SchemaMigration.table_name] end end # rubocop: enable Gitlab/NamespacedClass @@ -52,8 +48,12 @@ RSpec.configure do |config| config.around(:each, :click_house) do |example| with_net_connect_allowed do - click_house_test_runner.ensure_schema - click_house_test_runner.truncate_tables + if example.example.metadata[:click_house] == :without_migrations + click_house_test_runner.clear_db + else + click_house_test_runner.ensure_schema + click_house_test_runner.truncate_tables + end example.run end diff --git a/spec/support/database/partitioning_routing_analyzer.rb b/spec/support/database/partitioning_routing_analyzer.rb new file mode 100644 index 00000000000..b1edd817386 --- /dev/null +++ b/spec/support/database/partitioning_routing_analyzer.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +RSpec.configure do |config| + config.around(:each, :suppress_partitioning_routing_analyzer) do |example| + Gitlab::Database::QueryAnalyzers::Ci::PartitioningRoutingAnalyzer.with_suppressed(&example) + end +end diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index a1579ad1685..0a1d68a744c 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -20,7 +20,7 @@ module DbCleaner def setup_database_cleaner all_connection_classes.each do |connection_class| - DatabaseCleaner[:active_record, { connection: connection_class }] + DatabaseCleaner[:active_record, db: connection_class] end end @@ -57,7 +57,7 @@ module DbCleaner end def recreate_all_databases! - start = Gitlab::Metrics::System.monotonic_time + start = ::Gitlab::Metrics::System.monotonic_time puts "Recreating the database" @@ -81,7 +81,7 @@ module DbCleaner Gitlab::Database::Partitioning.sync_partitions_ignore_db_error stub_feature_flags(disallow_database_ddl_feature_flags: disable_ddl_was) - puts "Databases re-creation done in #{Gitlab::Metrics::System.monotonic_time - start}" + puts "Databases re-creation done in #{::Gitlab::Metrics::System.monotonic_time - start}" end def recreate_databases_and_seed_if_needed diff --git a/spec/support/finder_collection_allowlist.yml b/spec/support/finder_collection_allowlist.yml index 0af4de11d51..e60cc4278af 100644 --- a/spec/support/finder_collection_allowlist.yml +++ b/spec/support/finder_collection_allowlist.yml @@ -70,4 +70,3 @@ - UploaderFinder - UserGroupNotificationSettingsFinder - UserGroupsCounter -- DataTransfer::MockedTransferFinder # Can be removed when https://gitlab.com/gitlab-org/gitlab/-/issues/397693 is closed diff --git a/spec/support/helpers/api_internal_base_helpers.rb b/spec/support/helpers/api_internal_base_helpers.rb index 0c334e164a6..d3ae1a5c3b2 100644 --- a/spec/support/helpers/api_internal_base_helpers.rb +++ b/spec/support/helpers/api_internal_base_helpers.rb @@ -41,18 +41,19 @@ module APIInternalBaseHelpers ) end - def push(key, container, protocol = 'ssh', env: nil, changes: nil) + def push(key, container, protocol = 'ssh', env: nil, changes: nil, relative_path: nil) push_with_path( key, full_path: full_path_for(container), gl_repository: gl_repository_for(container), protocol: protocol, env: env, - changes: changes + changes: changes, + relative_path: relative_path ) end - def push_with_path(key, full_path:, gl_repository: nil, protocol: 'ssh', env: nil, changes: nil) + def push_with_path(key, full_path:, gl_repository: nil, protocol: 'ssh', env: nil, changes: nil, relative_path: nil) changes ||= 'd14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master' params = { @@ -61,7 +62,8 @@ module APIInternalBaseHelpers project: full_path, action: 'git-receive-pack', protocol: protocol, - env: env + env: env, + relative_path: relative_path } params[:gl_repository] = gl_repository if gl_repository diff --git a/spec/support/helpers/click_house_test_helpers.rb b/spec/support/helpers/click_house_test_helpers.rb new file mode 100644 index 00000000000..24f81a3ec01 --- /dev/null +++ b/spec/support/helpers/click_house_test_helpers.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module ClickHouseTestHelpers + def migrate(target_version, migration_context) + quietly { migration_context.up(target_version) } + end + + def rollback(target_version, migration_context) + quietly { migration_context.down(target_version) } + end + + def table_names(database = :main, configuration = ClickHouse::Client.configuration) + ClickHouse::Client.select('SHOW TABLES', database, configuration).pluck('name') + end + + def active_schema_migrations_count(database = :main, configuration = ClickHouse::Client.configuration) + query = <<~SQL + SELECT COUNT(*) AS count FROM schema_migrations FINAL WHERE active = 1 + SQL + + ClickHouse::Client.select(query, database, configuration).first['count'] + end + + def describe_table(table_name, database = :main, configuration = ClickHouse::Client.configuration) + ClickHouse::Client + .select("DESCRIBE TABLE #{table_name} FORMAT JSON", database, configuration) + .map(&:symbolize_keys) + .index_by { |h| h[:name].to_sym } + end + + def schema_migrations(database = :main, configuration = ClickHouse::Client.configuration) + ClickHouse::Client + .select('SELECT * FROM schema_migrations FINAL ORDER BY version ASC', database, configuration) + .map(&:symbolize_keys) + end + + def clear_db(configuration = ClickHouse::Client.configuration) + configuration.databases.each_key do |db| + # drop all tables + lookup_tables(db, configuration).each do |table| + ClickHouse::Client.execute("DROP TABLE IF EXISTS #{table}", db, configuration) + end + + ClickHouse::MigrationSupport::SchemaMigration.create_table(db, configuration) + end + end + + def register_database(config, database_identifier, db_config) + config.register_database( + database_identifier, + database: db_config[:database], + url: db_config[:url], + username: db_config[:username], + password: db_config[:password], + variables: db_config[:variables] || {} + ) + end + + private + + def lookup_tables(db, configuration = ClickHouse::Client.configuration) + ClickHouse::Client.select('SHOW TABLES', db, configuration).pluck('name') + end + + def quietly(&_block) + was_verbose = ClickHouse::Migration.verbose + ClickHouse::Migration.verbose = false + + yield + ensure + ClickHouse::Migration.verbose = was_verbose + end + + def clear_consts(fixtures_path) + $LOADED_FEATURES.select { |file| file.include? fixtures_path }.each do |file| + const = File.basename(file) + .scan(ClickHouse::Migration::MIGRATION_FILENAME_REGEXP)[0][1] + .camelcase + .safe_constantize + + Object.send(:remove_const, const.to_s) if const + $LOADED_FEATURES.delete(file) + end + end +end diff --git a/spec/support/helpers/crypto_helpers.rb b/spec/support/helpers/crypto_helpers.rb new file mode 100644 index 00000000000..0b2d5f6386a --- /dev/null +++ b/spec/support/helpers/crypto_helpers.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module CryptoHelpers + def sha256(value) + Gitlab::CryptoHelper.sha256(value) + end +end diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index 5f60f8a6bfa..890fefcc7de 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -1,6 +1,10 @@ # frozen_string_literal: true +require_relative './listbox_helpers' + module CycleAnalyticsHelpers + include ::ListboxHelpers + def toggle_value_stream_dropdown page.find('[data-testid="dropdown-value-streams"]').click end @@ -16,8 +20,8 @@ module CycleAnalyticsHelpers within last_stage do find('[name*="custom-stage-name-"]').fill_in with: "Cool custom stage - name #{index}" - select_dropdown_option_by_value "custom-stage-start-event-", :merge_request_created - select_dropdown_option_by_value "custom-stage-end-event-", :merge_request_merged + select_dropdown_option_by_value "custom-stage-start-event-", 'Merge request created' + select_dropdown_option_by_value "custom-stage-end-event-", 'Merge request merged' end end @@ -34,8 +38,8 @@ module CycleAnalyticsHelpers within last_stage do find('[name*="custom-stage-name-"]').fill_in with: "Cool custom label stage - name #{index}" - select_dropdown_option_by_value "custom-stage-start-event-", :issue_label_added - select_dropdown_option_by_value "custom-stage-end-event-", :issue_label_removed + select_dropdown_option_by_value "custom-stage-start-event-", 'Issue label was added' + select_dropdown_option_by_value "custom-stage-end-event-", 'Issue label was removed' select_event_label("[data-testid*='custom-stage-start-event-label-']") select_event_label("[data-testid*='custom-stage-end-event-label-']") @@ -102,19 +106,14 @@ module CycleAnalyticsHelpers select_value_stream(custom_value_stream_name) end - def toggle_dropdown(field) - page.within("[data-testid*='#{field}']") do - find('.dropdown-toggle').click + def select_dropdown_option_by_value(name, value) + page.within("[data-testid*='#{name}']") do + toggle_listbox wait_for_requests - - expect(find('.dropdown-menu')).to have_selector('.dropdown-item') end - end - def select_dropdown_option_by_value(name, value, elem = '.dropdown-item') - toggle_dropdown name - page.find("[data-testid*='#{name}'] .dropdown-menu").find("#{elem}[value='#{value}']").click + select_listbox_item(value) end def create_commit_referencing_issue(issue, branch_name: generate(:branch)) diff --git a/spec/support/helpers/cycle_analytics_helpers/test_generation.rb b/spec/support/helpers/cycle_analytics_helpers/test_generation.rb deleted file mode 100644 index 1c7c45c06a1..00000000000 --- a/spec/support/helpers/cycle_analytics_helpers/test_generation.rb +++ /dev/null @@ -1,166 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Layout/LineLength -# rubocop:disable Metrics/CyclomaticComplexity -# rubocop:disable Metrics/PerceivedComplexity -# rubocop:disable Metrics/AbcSize - -# Note: The ABC size is large here because we have a method generating test cases with -# multiple nested contexts. This shouldn't count as a violation. -module CycleAnalyticsHelpers - module TestGeneration - # Generate the most common set of specs that all value stream analytics phases need to have. - # - # Arguments: - # - # phase: Which phase are we testing? Will call `CycleAnalytics.new.send(phase)` for the final assertion - # data_fn: A function that returns a hash, constituting initial data for the test case - # start_time_conditions: An array of `conditions`. Each condition is an tuple of `condition_name` and `condition_fn`. `condition_fn` is called with - # `context` (no lexical scope, so need to do `context.create` for factories, for example) and `data` (from the `data_fn`). - # Each `condition_fn` is expected to implement a case which consitutes the start of the given value stream analytics phase. - # end_time_conditions: An array of `conditions`. Each condition is an tuple of `condition_name` and `condition_fn`. `condition_fn` is called with - # `context` (no lexical scope, so need to do `context.create` for factories, for example) and `data` (from the `data_fn`). - # Each `condition_fn` is expected to implement a case which consitutes the end of the given value stream analytics phase. - # before_end_fn: This function is run before calling the end time conditions. Used for setup that needs to be run between the start and end conditions. - # post_fn: Code that needs to be run after running the end time conditions. - - def generate_cycle_analytics_spec(phase:, data_fn:, start_time_conditions:, end_time_conditions:, before_end_fn: nil, post_fn: nil) - combinations_of_start_time_conditions = (1..start_time_conditions.size).flat_map { |size| start_time_conditions.combination(size).to_a } - combinations_of_end_time_conditions = (1..end_time_conditions.size).flat_map { |size| end_time_conditions.combination(size).to_a } - - scenarios = combinations_of_start_time_conditions.product(combinations_of_end_time_conditions) - scenarios.each do |start_time_conditions, end_time_conditions| - let_it_be(:other_project) { create(:project, :repository) } - - before do - other_project.add_developer(user) - end - - context "start condition: #{start_time_conditions.map(&:first).to_sentence}" do - context "end condition: #{end_time_conditions.map(&:first).to_sentence}" do - it "finds the median of available durations between the two conditions", :sidekiq_might_not_need_inline do - time_differences = Array.new(5) do |index| - data = data_fn[self] - start_time = (index * 10).days.from_now - end_time = start_time + rand(1..5).days - - start_time_conditions.each_value do |condition_fn| - travel_to(start_time) { condition_fn[self, data] } - end - - # Run `before_end_fn` at the midpoint between `start_time` and `end_time` - travel_to(start_time + ((end_time - start_time) / 2)) { before_end_fn[self, data] } if before_end_fn - - end_time_conditions.each_value do |condition_fn| - travel_to(end_time) { condition_fn[self, data] } - end - - travel_to(end_time + 1.day) { post_fn[self, data] } if post_fn - - end_time - start_time - end - - median_time_difference = time_differences.sort[2] - expect(subject[phase].project_median).to be_within(5).of(median_time_difference) - end - - context "when the data belongs to another project" do - it "returns nil" do - # Use a stub to "trick" the data/condition functions - # into using another project. This saves us from having to - # define separate data/condition functions for this particular - # test case. - allow(self).to receive(:project) { other_project } - - data = data_fn[self] - start_time = Time.now - end_time = rand(1..10).days.from_now - - start_time_conditions.each_value do |condition_fn| - travel_to(start_time) { condition_fn[self, data] } - end - - end_time_conditions.each_value do |condition_fn| - travel_to(end_time) { condition_fn[self, data] } - end - - travel_to(end_time + 1.day) { post_fn[self, data] } if post_fn - - # Turn off the stub before checking assertions - allow(self).to receive(:project).and_call_original - - expect(subject[phase].project_median).to be_nil - end - end - - context "when the end condition happens before the start condition" do - it 'returns nil' do - data = data_fn[self] - start_time = Time.now - end_time = start_time + rand(1..5).days - - # Run `before_end_fn` at the midpoint between `start_time` and `end_time` - travel_to(start_time + ((end_time - start_time) / 2)) { before_end_fn[self, data] } if before_end_fn - - end_time_conditions.each_value do |condition_fn| - travel_to(start_time) { condition_fn[self, data] } - end - - start_time_conditions.each_value do |condition_fn| - travel_to(end_time) { condition_fn[self, data] } - end - - travel_to(end_time + 1.day) { post_fn[self, data] } if post_fn - - expect(subject[phase].project_median).to be_nil - end - end - end - - context "end condition NOT PRESENT: #{end_time_conditions.map(&:first).to_sentence}" do - it "returns nil" do - data = data_fn[self] - start_time = Time.now - - start_time_conditions.each_value do |condition_fn| - travel_to(start_time) { condition_fn[self, data] } - end - - post_fn[self, data] if post_fn - - expect(subject[phase].project_median).to be_nil - end - end - end - - context "start condition NOT PRESENT: #{start_time_conditions.map(&:first).to_sentence}" do - context "end condition: #{end_time_conditions.map(&:first).to_sentence}" do - it "returns nil" do - data = data_fn[self] - end_time = rand(1..10).days.from_now - - end_time_conditions.each_with_index do |(_condition_name, condition_fn), index| - travel_to(end_time + index.days) { condition_fn[self, data] } - end - - travel_to(end_time + 1.day) { post_fn[self, data] } if post_fn - - expect(subject[phase].project_median).to be_nil - end - end - end - end - - context "when none of the start / end conditions are matched" do - it "returns nil" do - expect(subject[phase].project_median).to be_nil - end - end - end - end -end - -# rubocop:enable Layout/LineLength -# rubocop:enable Metrics/CyclomaticComplexity -# rubocop:enable Metrics/PerceivedComplexity -# rubocop:enable Metrics/AbcSize diff --git a/spec/support/helpers/database/duplicate_indexes.yml b/spec/support/helpers/database/duplicate_indexes.yml index 02efdabd70b..1ebc45a9d81 100644 --- a/spec/support/helpers/database/duplicate_indexes.yml +++ b/spec/support/helpers/database/duplicate_indexes.yml @@ -2,264 +2,245 @@ # It maps table_name to {index1: array_of_duplicate_indexes, index2: array_of_duplicate_indexes, ... } abuse_reports: idx_abuse_reports_user_id_status_and_category: - - index_abuse_reports_on_user_id + - index_abuse_reports_on_user_id alert_management_http_integrations: index_http_integrations_on_project_and_endpoint: - - index_alert_management_http_integrations_on_project_id -analytics_cycle_analytics_group_stages: - index_group_stages_on_group_id_group_value_stream_id_and_name: - - index_analytics_ca_group_stages_on_group_id + - index_alert_management_http_integrations_on_project_id approval_project_rules_users: index_approval_project_rules_users_1: - - index_approval_project_rules_users_on_approval_project_rule_id + - index_approval_project_rules_users_on_approval_project_rule_id approvals: index_approvals_on_merge_request_id_and_created_at: - - index_approvals_on_merge_request_id + - index_approvals_on_merge_request_id board_group_recent_visits: index_board_group_recent_visits_on_user_group_and_board: - - index_board_group_recent_visits_on_user_id + - index_board_group_recent_visits_on_user_id board_project_recent_visits: index_board_project_recent_visits_on_user_project_and_board: - - index_board_project_recent_visits_on_user_id + - index_board_project_recent_visits_on_user_id board_user_preferences: index_board_user_preferences_on_user_id_and_board_id: - - index_board_user_preferences_on_user_id + - index_board_user_preferences_on_user_id boards_epic_board_recent_visits: index_epic_board_recent_visits_on_user_group_and_board: - - index_boards_epic_board_recent_visits_on_user_id + - index_boards_epic_board_recent_visits_on_user_id boards_epic_user_preferences: index_boards_epic_user_preferences_on_board_user_epic_unique: - - index_boards_epic_user_preferences_on_board_id + - index_boards_epic_user_preferences_on_board_id bulk_import_batch_trackers: i_bulk_import_trackers_id_batch_number: - - index_bulk_import_batch_trackers_on_tracker_id + - index_bulk_import_batch_trackers_on_tracker_id bulk_import_export_batches: i_bulk_import_export_batches_id_batch_number: - - index_bulk_import_export_batches_on_export_id + - index_bulk_import_export_batches_on_export_id ci_job_artifacts: index_ci_job_artifacts_on_id_project_id_and_created_at: - - index_ci_job_artifacts_on_project_id + - index_ci_job_artifacts_on_project_id index_ci_job_artifacts_on_id_project_id_and_file_type: - - index_ci_job_artifacts_on_project_id + - index_ci_job_artifacts_on_project_id index_ci_job_artifacts_on_project_id_and_id: - - index_ci_job_artifacts_on_project_id + - index_ci_job_artifacts_on_project_id ci_pipeline_artifacts: index_ci_pipeline_artifacts_on_pipeline_id_and_file_type: - - index_ci_pipeline_artifacts_on_pipeline_id + - index_ci_pipeline_artifacts_on_pipeline_id ci_stages: index_ci_stages_on_pipeline_id_and_name: - - index_ci_stages_on_pipeline_id + - index_ci_stages_on_pipeline_id index_ci_stages_on_pipeline_id_and_position: - - index_ci_stages_on_pipeline_id + - index_ci_stages_on_pipeline_id index_ci_stages_on_pipeline_id_convert_to_bigint_and_name: - - index_ci_stages_on_pipeline_id_convert_to_bigint + - index_ci_stages_on_pipeline_id_convert_to_bigint index_ci_stages_on_pipeline_id_convert_to_bigint_and_position: - - index_ci_stages_on_pipeline_id_convert_to_bigint + - index_ci_stages_on_pipeline_id_convert_to_bigint dast_site_tokens: index_dast_site_token_on_project_id_and_url: - - index_dast_site_tokens_on_project_id + - index_dast_site_tokens_on_project_id design_management_designs: index_design_management_designs_on_iid_and_project_id: - - index_design_management_designs_on_project_id + - index_design_management_designs_on_project_id design_management_designs_versions: design_management_designs_versions_uniqueness: - - index_design_management_designs_versions_on_design_id + - index_design_management_designs_versions_on_design_id error_tracking_errors: index_et_errors_on_project_id_and_status_and_id: - - index_error_tracking_errors_on_project_id + - index_error_tracking_errors_on_project_id index_et_errors_on_project_id_and_status_events_count_id_desc: - - index_error_tracking_errors_on_project_id + - index_error_tracking_errors_on_project_id index_et_errors_on_project_id_and_status_first_seen_at_id_desc: - - index_error_tracking_errors_on_project_id + - index_error_tracking_errors_on_project_id index_et_errors_on_project_id_and_status_last_seen_at_id_desc: - - index_error_tracking_errors_on_project_id + - index_error_tracking_errors_on_project_id geo_node_namespace_links: index_geo_node_namespace_links_on_geo_node_id_and_namespace_id: - - index_geo_node_namespace_links_on_geo_node_id + - index_geo_node_namespace_links_on_geo_node_id in_product_marketing_emails: - index_in_product_marketing_emails_on_user_campaign: - - index_in_product_marketing_emails_on_user_id index_in_product_marketing_emails_on_user_track_series: - - index_in_product_marketing_emails_on_user_id + - index_in_product_marketing_emails_on_user_id incident_management_oncall_participants: index_inc_mgmnt_oncall_participants_on_user_id_and_rotation_id: - - index_inc_mgmnt_oncall_participants_on_oncall_user_id + - index_inc_mgmnt_oncall_participants_on_oncall_user_id incident_management_oncall_schedules: index_im_oncall_schedules_on_project_id_and_iid: - - index_incident_management_oncall_schedules_on_project_id + - index_incident_management_oncall_schedules_on_project_id instance_audit_events_streaming_headers: idx_instance_external_audit_event_destination_id_key_uniq: - - idx_headers_instance_external_audit_event_destination_id + - idx_headers_instance_external_audit_event_destination_id issue_links: index_issue_links_on_source_id_and_target_id: - - index_issue_links_on_source_id + - index_issue_links_on_source_id issues: index_issues_on_author_id_and_id_and_created_at: - - index_issues_on_author_id + - index_issues_on_author_id jira_connect_subscriptions: idx_jira_connect_subscriptions_on_installation_id_namespace_id: - - idx_jira_connect_subscriptions_on_installation_id + - idx_jira_connect_subscriptions_on_installation_id list_user_preferences: index_list_user_preferences_on_user_id_and_list_id: - - index_list_user_preferences_on_user_id + - index_list_user_preferences_on_user_id member_tasks: index_member_tasks_on_member_id_and_project_id: - - index_member_tasks_on_member_id + - index_member_tasks_on_member_id members: index_members_on_member_namespace_id_compound: - - index_members_on_member_namespace_id -merge_request_assignees: - index_merge_request_assignees_on_merge_request_id_and_user_id: - - index_merge_request_assignees_on_merge_request_id -merge_request_metrics: - index_mr_metrics_on_target_project_id_merged_at_nulls_last: - - index_merge_request_metrics_on_target_project_id + - index_members_on_member_namespace_id merge_requests: index_merge_requests_on_author_id_and_created_at: - - index_merge_requests_on_author_id + - index_merge_requests_on_author_id index_merge_requests_on_author_id_and_id: - - index_merge_requests_on_author_id + - index_merge_requests_on_author_id index_merge_requests_on_author_id_and_target_project_id: - - index_merge_requests_on_author_id + - index_merge_requests_on_author_id ml_candidate_params: index_ml_candidate_params_on_candidate_id_on_name: - - index_ml_candidate_params_on_candidate_id + - index_ml_candidate_params_on_candidate_id ml_candidates: index_ml_candidates_on_project_id_on_internal_id: - - index_ml_candidates_on_project_id + - index_ml_candidates_on_project_id ml_model_versions: index_ml_model_versions_on_project_id_and_model_id_and_version: - - index_ml_model_versions_on_project_id + - index_ml_model_versions_on_project_id ml_models: index_ml_models_on_project_id_and_name: - - index_ml_models_on_project_id + - index_ml_models_on_project_id p_ci_runner_machine_builds: index_p_ci_runner_machine_builds_on_runner_machine_id: - - index_ci_runner_machine_builds_on_runner_machine_id + - index_ci_runner_machine_builds_on_runner_machine_id packages_debian_group_distributions: uniq_pkgs_debian_group_distributions_group_id_and_codename: - - index_packages_debian_group_distributions_on_group_id + - index_packages_debian_group_distributions_on_group_id uniq_pkgs_debian_group_distributions_group_id_and_suite: - - index_packages_debian_group_distributions_on_group_id + - index_packages_debian_group_distributions_on_group_id packages_debian_project_distributions: uniq_pkgs_debian_project_distributions_project_id_and_codename: - - index_packages_debian_project_distributions_on_project_id + - index_packages_debian_project_distributions_on_project_id uniq_pkgs_debian_project_distributions_project_id_and_suite: - - index_packages_debian_project_distributions_on_project_id + - index_packages_debian_project_distributions_on_project_id packages_tags: index_packages_tags_on_package_id_and_updated_at: - - index_packages_tags_on_package_id + - index_packages_tags_on_package_id pages_domains: index_pages_domains_on_project_id_and_enabled_until: - - index_pages_domains_on_project_id + - index_pages_domains_on_project_id index_pages_domains_on_verified_at_and_enabled_until: - - index_pages_domains_on_verified_at + - index_pages_domains_on_verified_at personal_access_tokens: index_pat_on_user_id_and_expires_at: - - index_personal_access_tokens_on_user_id + - index_personal_access_tokens_on_user_id pm_affected_packages: i_affected_packages_unique_for_upsert: - - index_pm_affected_packages_on_pm_advisory_id + - index_pm_affected_packages_on_pm_advisory_id pm_package_version_licenses: i_pm_package_version_licenses_join_ids: - - index_pm_package_version_licenses_on_pm_package_version_id + - index_pm_package_version_licenses_on_pm_package_version_id pm_package_versions: i_pm_package_versions_on_package_id_and_version: - - index_pm_package_versions_on_pm_package_id + - index_pm_package_versions_on_pm_package_id project_compliance_standards_adherence: u_project_compliance_standards_adherence_for_reporting: - - index_project_compliance_standards_adherence_on_project_id + - index_project_compliance_standards_adherence_on_project_id project_relation_exports: index_project_export_job_relation: - - index_project_relation_exports_on_project_export_job_id + - index_project_relation_exports_on_project_export_job_id project_repositories: index_project_repositories_on_shard_id_and_project_id: - - index_project_repositories_on_shard_id + - index_project_repositories_on_shard_id project_topics: index_project_topics_on_project_id_and_topic_id: - - index_project_topics_on_project_id -projects: - index_projects_api_path_id_desc: - - index_on_projects_path - index_projects_on_path_and_id: - - index_on_projects_path + - index_project_topics_on_project_id protected_environments: index_protected_environments_on_project_id_and_name: - - index_protected_environments_on_project_id + - index_protected_environments_on_project_id protected_tags: index_protected_tags_on_project_id_and_name: - - index_protected_tags_on_project_id + - index_protected_tags_on_project_id related_epic_links: index_related_epic_links_on_source_id_and_target_id: - - index_related_epic_links_on_source_id + - index_related_epic_links_on_source_id requirements_management_test_reports: idx_test_reports_on_issue_id_created_at_and_id: - - index_requirements_management_test_reports_on_issue_id + - index_requirements_management_test_reports_on_issue_id sbom_component_versions: index_sbom_component_versions_on_component_id_and_version: - - index_sbom_component_versions_on_component_id + - index_sbom_component_versions_on_component_id sbom_occurrences: index_sbom_occurrences_for_input_file_path_search: - - index_sbom_occurrences_on_project_id_component_id - - index_sbom_occurrences_on_project_id + - index_sbom_occurrences_on_project_id_component_id + - index_sbom_occurrences_on_project_id idx_sbom_occurrences_on_project_id_and_source_id: - - index_sbom_occurrences_on_project_id + - index_sbom_occurrences_on_project_id index_sbom_occurrences_on_project_id_and_id: - - index_sbom_occurrences_on_project_id + - index_sbom_occurrences_on_project_id index_sbom_occurrences_on_project_id_component_id: - - index_sbom_occurrences_on_project_id + - index_sbom_occurrences_on_project_id index_sbom_occurrences_on_project_id_and_component_id_and_id: - - index_sbom_occurrences_on_project_id_component_id - - index_sbom_occurrences_on_project_id + - index_sbom_occurrences_on_project_id_component_id + - index_sbom_occurrences_on_project_id index_sbom_occurrences_on_project_id_and_package_manager: - - index_sbom_occurrences_on_project_id -scan_result_policies: - index_scan_result_policies_on_position_in_configuration: - - index_scan_result_policies_on_policy_configuration_id + - index_sbom_occurrences_on_project_id search_namespace_index_assignments: index_search_namespace_index_assignments_uniqueness_index_type: - - index_search_namespace_index_assignments_on_namespace_id + - index_search_namespace_index_assignments_on_namespace_id index_search_namespace_index_assignments_uniqueness_on_index_id: - - index_search_namespace_index_assignments_on_namespace_id + - index_search_namespace_index_assignments_on_namespace_id sprints: sequence_is_unique_per_iterations_cadence_id: - - index_sprints_iterations_cadence_id + - index_sprints_iterations_cadence_id taggings: taggings_idx: - - index_taggings_on_tag_id + - index_taggings_on_tag_id term_agreements: term_agreements_unique_index: - - index_term_agreements_on_user_id + - index_term_agreements_on_user_id todos: index_todos_on_author_id_and_created_at: - - index_todos_on_author_id + - index_todos_on_author_id user_callouts: index_user_callouts_on_user_id_and_feature_name: - - index_user_callouts_on_user_id + - index_user_callouts_on_user_id users: index_users_on_state_and_user_type: - - index_users_on_state + - index_users_on_state vulnerabilities: index_vulnerabilities_project_id_state_severity_default_branch: - - index_vulnerabilities_on_project_id_and_state_and_severity + - index_vulnerabilities_on_project_id_and_state_and_severity vulnerability_external_issue_links: idx_vulnerability_ext_issue_links_on_vulne_id_and_ext_issue: - - index_vulnerability_external_issue_links_on_vulnerability_id + - index_vulnerability_external_issue_links_on_vulnerability_id vulnerability_finding_links: finding_link_name_url_idx: - - finding_links_on_vulnerability_occurrence_id + - finding_links_on_vulnerability_occurrence_id vulnerability_finding_signatures: idx_vuln_signatures_uniqueness_signature_sha: - - index_vulnerability_finding_signatures_on_finding_id + - index_vulnerability_finding_signatures_on_finding_id vulnerability_flags: index_vulnerability_flags_on_unique_columns: - - index_vulnerability_flags_on_vulnerability_occurrence_id + - index_vulnerability_flags_on_vulnerability_occurrence_id web_hook_logs: index_web_hook_logs_on_web_hook_id_and_created_at: - - index_web_hook_logs_part_on_web_hook_id + - index_web_hook_logs_part_on_web_hook_id web_hooks: index_web_hooks_on_project_id_recent_failures: - - index_web_hooks_on_project_id + - index_web_hooks_on_project_id work_item_hierarchy_restrictions: index_work_item_hierarchy_restrictions_on_parent_and_child: - - index_work_item_hierarchy_restrictions_on_parent_type_id + - index_work_item_hierarchy_restrictions_on_parent_type_id diff --git a/spec/support/helpers/email_helpers.rb b/spec/support/helpers/email_helpers.rb index 57386233775..9dffe035b2a 100644 --- a/spec/support/helpers/email_helpers.rb +++ b/spec/support/helpers/email_helpers.rb @@ -94,7 +94,8 @@ module EmailHelpers port: credential.smtp_port, user_name: credential.smtp_username, password: credential.smtp_password, - domain: service_desk_setting.custom_email.split('@').last + domain: service_desk_setting.custom_email.split('@').last, + authentication: credential.smtp_authentication ) end end diff --git a/spec/support/helpers/features/dom_helpers.rb b/spec/support/helpers/features/dom_helpers.rb index cbbb80dde36..619f16f5e6d 100644 --- a/spec/support/helpers/features/dom_helpers.rb +++ b/spec/support/helpers/features/dom_helpers.rb @@ -2,6 +2,10 @@ module Features module DomHelpers + def has_testid?(testid, **kwargs) + page.has_selector?("[data-testid='#{testid}']", **kwargs) + end + def find_by_testid(testid, **kwargs) page.find("[data-testid='#{testid}']", **kwargs) end diff --git a/spec/support/helpers/features/releases_helpers.rb b/spec/support/helpers/features/releases_helpers.rb index d5846aad15d..c3fbd128a28 100644 --- a/spec/support/helpers/features/releases_helpers.rb +++ b/spec/support/helpers/features/releases_helpers.rb @@ -44,20 +44,22 @@ module Features end def fill_release_title(release_title) - fill_in('Release title', with: release_title) + fill_in('release-title', with: release_title) end - def select_milestone(milestone_title) - page.within '[data-testid="milestones-field"]' do - find('button').click + def select_milestones(*milestone_titles) + within_testid 'milestones-field' do + find_by_testid('base-dropdown-toggle').click wait_for_all_requests - find('input[aria-label="Search Milestones"]').set(milestone_title) + milestone_titles.each do |milestone_title| + find('input[type="search"]').set(milestone_title) - wait_for_all_requests + wait_for_all_requests - find('button', text: milestone_title, match: :first).click + find('[role="option"]', text: milestone_title).click + end end end diff --git a/spec/support/helpers/gitaly_setup.rb b/spec/support/helpers/gitaly_setup.rb index 06390406efc..f263b3b44ce 100644 --- a/spec/support/helpers/gitaly_setup.rb +++ b/spec/support/helpers/gitaly_setup.rb @@ -72,7 +72,9 @@ module GitalySetup end def repos_path(storage = REPOS_STORAGE) - Gitlab.config.repositories.storages[REPOS_STORAGE].legacy_disk_path + Gitlab::GitalyClient::StorageSettings.allow_disk_access do + Gitlab.config.repositories.storages[REPOS_STORAGE].legacy_disk_path + end end def service_cmd(service, toml = nil) diff --git a/spec/support/helpers/gpg_helpers.rb b/spec/support/helpers/gpg_helpers.rb index cc8ee6c98e6..1f93b1bb698 100644 --- a/spec/support/helpers/gpg_helpers.rb +++ b/spec/support/helpers/gpg_helpers.rb @@ -700,7 +700,7 @@ module GpgHelpers end def subkey_fingerprints - %w(65A33805A5DDA7454190EE536F0E46B850B18E99 3AD06974F78DD1603D5E4617D0955D22F2C324E2) + %w[65A33805A5DDA7454190EE536F0E46B850B18E99 3AD06974F78DD1603D5E4617D0955D22F2C324E2] end def names diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb index 5eba982e3da..085340d6cb9 100644 --- a/spec/support/helpers/graphql_helpers.rb +++ b/spec/support/helpers/graphql_helpers.rb @@ -2,6 +2,7 @@ module GraphqlHelpers def self.included(base) + base.include(::ApiHelpers) base.include(::Gitlab::Graphql::Laziness) end diff --git a/spec/support/helpers/listbox_helpers.rb b/spec/support/helpers/listbox_helpers.rb index 7a734d2b097..a8a4c079e3c 100644 --- a/spec/support/helpers/listbox_helpers.rb +++ b/spec/support/helpers/listbox_helpers.rb @@ -14,6 +14,10 @@ module ListboxHelpers find('.gl-new-dropdown-item', text: text, exact_text: exact_text).click end + def toggle_listbox + find('.gl-new-dropdown-toggle').click + end + def expect_listbox_item(text) expect(page).to have_css('.gl-new-dropdown-item[role="option"]', text: text) end diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb index abe21d2b74c..d35fa801638 100644 --- a/spec/support/helpers/login_helpers.rb +++ b/spec/support/helpers/login_helpers.rb @@ -70,7 +70,13 @@ module LoginHelpers # Requires Javascript driver. def gitlab_sign_out - find(".header-user-dropdown-toggle").click + if has_testid?('super-sidebar') + click_on "#{@current_user.name} user’s menu" + else + # This can be removed once https://gitlab.com/gitlab-org/gitlab/-/issues/420121 is complete. + find(".header-user-dropdown-toggle").click + end + click_link "Sign out" @current_user = nil @@ -79,11 +85,8 @@ module LoginHelpers # Requires Javascript driver. def gitlab_disable_admin_mode - open_top_nav - - within_top_nav do - click_on 'Leave admin mode' - end + click_on 'Search or go to…' + click_on 'Leave admin mode' end private @@ -209,9 +212,9 @@ module LoginHelpers def mock_saml_config_with_upstream_two_factor_authn_contexts config = mock_saml_config - config.args[:upstream_two_factor_authn_contexts] = %w(urn:oasis:names:tc:SAML:2.0:ac:classes:CertificateProtectedTransport + config.args[:upstream_two_factor_authn_contexts] = %w[urn:oasis:names:tc:SAML:2.0:ac:classes:CertificateProtectedTransport urn:oasis:names:tc:SAML:2.0:ac:classes:SecondFactorOTPSMS - urn:oasis:names:tc:SAML:2.0:ac:classes:SecondFactorIGTOKEN) + urn:oasis:names:tc:SAML:2.0:ac:classes:SecondFactorIGTOKEN] config end @@ -259,19 +262,15 @@ module LoginHelpers end def stub_omniauth_config(messages) - allow(Gitlab.config.omniauth).to receive_messages(messages) + allow(Gitlab.config.omniauth).to receive_messages(GitlabSettings::Options.build(messages)) end def stub_basic_saml_config - allow_next_instance_of(Gitlab::Auth::Saml::Config) do |config| - allow(config).to receive_messages({ options: { name: 'saml', args: {} } }) - end + stub_omniauth_config(providers: [{ name: 'saml', args: {} }]) end def stub_saml_group_config(groups) - allow_next_instance_of(Gitlab::Auth::Saml::Config) do |config| - allow(config).to receive_messages({ options: { name: 'saml', groups_attribute: 'groups', external_groups: groups, args: {} } }) - end + stub_omniauth_config(providers: [{ name: 'saml', groups_attribute: 'groups', external_groups: groups, args: {} }]) end end diff --git a/spec/support/helpers/navbar_structure_helper.rb b/spec/support/helpers/navbar_structure_helper.rb index fe39968b002..131c7597827 100644 --- a/spec/support/helpers/navbar_structure_helper.rb +++ b/spec/support/helpers/navbar_structure_helper.rb @@ -8,6 +8,13 @@ module NavbarStructureHelper structure.insert(index + 1, new_nav_item) end + def insert_before_nav_item(after_nav_item_name, new_nav_item:) + expect(structure).to include(a_hash_including(nav_item: after_nav_item_name)) + + index = structure.find_index { |h| h[:nav_item] == after_nav_item_name if h } + structure.insert(index, new_nav_item) + end + def insert_after_sub_nav_item(before_sub_nav_item_name, within:, new_sub_nav_item_name:) expect(structure).to include(a_hash_including(nav_item: within)) hash = structure.find { |h| h[:nav_item] == within if h } @@ -30,49 +37,57 @@ module NavbarStructureHelper hash[:nav_sub_items].insert(index, new_sub_nav_item_name) end - def insert_package_nav(within) - insert_after_nav_item( - within, - new_nav_item: { - nav_item: _('Packages and registries'), - nav_sub_items: [_('Package Registry')] - } + def insert_package_nav + insert_after_sub_nav_item( + _("Feature flags"), + within: _('Deploy'), + new_sub_nav_item_name: _("Package Registry") ) end - def insert_customer_relations_nav(within) - insert_after_nav_item( - within, + def create_package_nav(before) + insert_before_nav_item( + before, new_nav_item: { - nav_item: _('Customer relations'), - nav_sub_items: [ - _('Contacts'), - _('Organizations') - ] + nav_item: _("Deploy"), + nav_sub_items: [_("Package Registry")] } ) end + def insert_customer_relations_nav(after) + insert_after_sub_nav_item( + after, + within: _('Plan'), + new_sub_nav_item_name: _("Customer contacts") + ) + insert_after_sub_nav_item( + _("Customer contacts"), + within: _('Plan'), + new_sub_nav_item_name: _("Customer organizations") + ) + end + def insert_container_nav insert_after_sub_nav_item( _('Package Registry'), - within: _('Packages and registries'), + within: _('Deploy'), new_sub_nav_item_name: _('Container Registry') ) end def insert_dependency_proxy_nav - insert_after_sub_nav_item( - _('Package Registry'), - within: _('Packages and registries'), + insert_before_sub_nav_item( + _('Kubernetes'), + within: _('Operate'), new_sub_nav_item_name: _('Dependency Proxy') ) end def insert_infrastructure_registry_nav insert_after_sub_nav_item( - _('Package Registry'), - within: _('Packages and registries'), + s_('Terraform|Terraform states'), + within: _('Operate'), new_sub_nav_item_name: _('Terraform modules') ) end @@ -80,15 +95,15 @@ module NavbarStructureHelper def insert_harbor_registry_nav(within) insert_after_sub_nav_item( within, - within: _('Packages and registries'), + within: _('Operate'), new_sub_nav_item_name: _('Harbor Registry') ) end def insert_infrastructure_google_cloud_nav insert_after_sub_nav_item( - s_('Terraform|Terraform states'), - within: _('Infrastructure'), + s_('Terraform|Terraform modules'), + within: _('Operate'), new_sub_nav_item_name: _('Google Cloud') ) end @@ -96,7 +111,7 @@ module NavbarStructureHelper def insert_infrastructure_aws_nav insert_after_sub_nav_item( _('Google Cloud'), - within: _('Infrastructure'), + within: _('Operate'), new_sub_nav_item_name: _('AWS') ) end @@ -104,25 +119,24 @@ module NavbarStructureHelper def insert_model_experiments_nav(within) insert_after_sub_nav_item( within, - within: _('Packages and registries'), + within: _('Analyze'), new_sub_nav_item_name: _('Model experiments') ) end def project_analytics_sub_nav_item [ - _('Value stream'), - _('CI/CD'), - (_('Code review') if Gitlab.ee?), - (_('Merge request') if Gitlab.ee?), - _('Repository') + _('Value stream analytics'), + _('Contributor statistics'), + _('CI/CD analytics'), + _('Repository analytics'), + (_('Code review analytics') if Gitlab.ee?), + (_('Merge request analytics') if Gitlab.ee?) ] end def group_analytics_sub_nav_item - [ - _('Contribution') - ] + [_("Contribution analytics")] end end diff --git a/spec/support/helpers/packages_manager_api_spec_helper.rb b/spec/support/helpers/packages_manager_api_spec_helpers.rb index 1c9fce183e9..c81c9b5982e 100644 --- a/spec/support/helpers/packages_manager_api_spec_helper.rb +++ b/spec/support/helpers/packages_manager_api_spec_helpers.rb @@ -22,12 +22,12 @@ module PackagesManagerApiSpecHelpers end end - def temp_file(package_tmp) + def temp_file(package_tmp, content: nil) upload_path = ::Packages::PackageFileUploader.workhorse_local_upload_path file_path = "#{upload_path}/#{package_tmp}" FileUtils.mkdir_p(upload_path) - File.write(file_path, 'test') + content ? FileUtils.cp(content, file_path) : File.write(file_path, 'test') UploadedFile.new(file_path, filename: File.basename(file_path)) end diff --git a/spec/support/helpers/prevent_set_operator_mismatch_helper.rb b/spec/support/helpers/prevent_set_operator_mismatch_helper.rb new file mode 100644 index 00000000000..482a5560fe9 --- /dev/null +++ b/spec/support/helpers/prevent_set_operator_mismatch_helper.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module PreventSetOperatorMismatchHelper + extend ActiveSupport::Concern + + included do + before do + stub_const('Type', Gitlab::Database::QueryAnalyzers::PreventSetOperatorMismatch::Type) + end + end + + def sql_select_node(sql) + parsed = PgQuery.parse(sql) + parsed.tree.stmts[0].stmt.select_stmt + end +end diff --git a/spec/support/helpers/project_template_test_helper.rb b/spec/support/helpers/project_template_test_helper.rb index 35e40faeea7..a02cd491bca 100644 --- a/spec/support/helpers/project_template_test_helper.rb +++ b/spec/support/helpers/project_template_test_helper.rb @@ -10,6 +10,7 @@ module ProjectTemplateTestHelper serverless_framework tencent_serverless_framework jsonnet cluster_management kotlin_native_linux pelican bridgetown typo3_distribution laravel + astro_tailwind ] end end diff --git a/spec/support/helpers/prometheus_helpers.rb b/spec/support/helpers/prometheus_helpers.rb index da80f6f08c2..065c653c62f 100644 --- a/spec/support/helpers/prometheus_helpers.rb +++ b/spec/support/helpers/prometheus_helpers.rb @@ -207,7 +207,7 @@ module PrometheusHelpers def prometheus_label_values { 'status': 'success', - 'data': %w(job_adds job_controller_rate_limiter_use job_depth job_queue_latency job_work_duration_sum up) + 'data': %w[job_adds job_controller_rate_limiter_use job_depth job_queue_latency job_work_duration_sum up] } end diff --git a/spec/support/helpers/repo_helpers.rb b/spec/support/helpers/repo_helpers.rb index d264356aa64..bac88da4885 100644 --- a/spec/support/helpers/repo_helpers.rb +++ b/spec/support/helpers/repo_helpers.rb @@ -112,13 +112,13 @@ eos } ] + extra_changes - commits = %w( + commits = %w[ 5937ac0a7beb003549fc5fd26fc247adbce4a52e 570e7b2abdd848b95f2f578043fc23bd6f6fd24d 6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 d14d6c0abdd253381df51a723d58691b2ee1ab08 c1acaa58bbcbc3eafe538cb8274ba387047b69f8 - ).reverse # last commit is recent one + ].reverse # last commit is recent one reviewers = [ { diff --git a/spec/support/helpers/search_helpers.rb b/spec/support/helpers/search_helpers.rb index d13703776cd..dd5ce63876e 100644 --- a/spec/support/helpers/search_helpers.rb +++ b/spec/support/helpers/search_helpers.rb @@ -2,16 +2,28 @@ module SearchHelpers def fill_in_search(text) - page.within('.header-search') do - find('#search').click - fill_in 'search', with: text + within_testid('super-sidebar') do + click_button "Search or go to…" end + fill_in 'search', with: text wait_for_all_requests end def submit_search(query) - page.within('.header-search-form, .search-page-form') do + # Forms directly on the search page + if page.has_css?('.search-page-form') + search_form = '.search-page-form' + # Open search modal from super sidebar + elsif has_testid?('super-sidebar-search-button') + find_by_testid('super-sidebar-search-button').click + search_form = '#super-sidebar-search-modal' + # Open legacy search dropdown in navigation + else + search_form = '.header-search-form' + end + + page.within(search_form) do field = find_field('search') field.click field.fill_in(with: query) @@ -27,7 +39,7 @@ module SearchHelpers end def select_search_scope(scope) - page.within '[data-testid="search-filter"]' do + within_testid('search-filter') do click_link scope wait_for_all_requests @@ -35,9 +47,9 @@ module SearchHelpers end def has_search_scope?(scope) - return false unless page.has_selector?('[data-testid="search-filter"]') + return false unless has_testid?('search-filter') - page.within '[data-testid="search-filter"]' do + within_testid('search-filter') do has_link?(scope) end end diff --git a/spec/support/helpers/seed_repo.rb b/spec/support/helpers/seed_repo.rb index 74ac529a3de..b0bd0dfb60e 100644 --- a/spec/support/helpers/seed_repo.rb +++ b/spec/support/helpers/seed_repo.rb @@ -47,7 +47,7 @@ module SeedRepo FILES_COUNT = 2 C_FILE_PATH = "files/ruby" C_FILES = ["popen.rb", "regex.rb", "version_info.rb"].freeze - BLOB_FILE = %{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n} + BLOB_FILE = %(%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n) BLOB_FILE_PATH = "app/views/keys/show.html.haml" end diff --git a/spec/support/helpers/stub_saas_features.rb b/spec/support/helpers/stub_saas_features.rb index e344888cb8c..d0aa7108a6a 100644 --- a/spec/support/helpers/stub_saas_features.rb +++ b/spec/support/helpers/stub_saas_features.rb @@ -6,9 +6,9 @@ module StubSaasFeatures # @param [Hash] features where key is feature name and value is boolean whether enabled or not. # # Examples - # - `stub_saas_features('onboarding' => false)` ... Disable `onboarding` + # - `stub_saas_features(onboarding: false)` ... Disable `onboarding` # SaaS feature globally. - # - `stub_saas_features('onboarding' => true)` ... Enable `onboarding` + # - `stub_saas_features(onboarding: true)` ... Enable `onboarding` # SaaS feature globally. def stub_saas_features(features) features.each do |feature_name, value| diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index 740abdb6cfa..e606a377ec7 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -305,7 +305,7 @@ module TestEnv unless File.directory?(repo_path) start = Time.now - system(*%W(#{Gitlab.config.git.bin_path} clone --quiet -- #{clone_url} #{repo_path})) + system(*%W[#{Gitlab.config.git.bin_path} clone --quiet -- #{clone_url} #{repo_path}]) puts "==> #{repo_path} set up in #{Time.now - start} seconds...\n" end @@ -316,7 +316,7 @@ module TestEnv # set all the required local branches. This would happen when a new # branch is added to BRANCH_SHA, in which case we want to update # everything. - unless system(*%W(#{Gitlab.config.git.bin_path} -C #{repo_path} fetch origin)) + unless system(*%W[#{Gitlab.config.git.bin_path} -C #{repo_path} fetch origin]) raise 'Could not fetch test seed repository.' end @@ -329,7 +329,7 @@ module TestEnv if create_bundle start = Time.now - system(git_env, *%W(#{Gitlab.config.git.bin_path} -C #{repo_path} bundle create #{repo_bundle_path} --exclude refs/remotes/* --all)) + system(git_env, *%W[#{Gitlab.config.git.bin_path} -C #{repo_path} bundle create #{repo_bundle_path} --exclude refs/remotes/* --all]) puts "==> #{repo_bundle_path} generated in #{Time.now - start} seconds...\n" end end @@ -530,7 +530,7 @@ module TestEnv return false unless Dir.exist?(component_folder) - sha, exit_status = Gitlab::Popen.popen(%W(#{Gitlab.config.git.bin_path} rev-parse HEAD), component_folder) + sha, exit_status = Gitlab::Popen.popen(%W[#{Gitlab.config.git.bin_path} rev-parse HEAD], component_folder) return false if exit_status != 0 expected_version == sha.chomp diff --git a/spec/support/helpers/usage_data_helpers.rb b/spec/support/helpers/usage_data_helpers.rb index 42e599c7510..3b8c0b42fe8 100644 --- a/spec/support/helpers/usage_data_helpers.rb +++ b/spec/support/helpers/usage_data_helpers.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module UsageDataHelpers - COUNTS_KEYS = %i( + COUNTS_KEYS = %i[ assignee_lists ci_builds ci_external_pipelines @@ -72,9 +72,9 @@ module UsageDataHelpers uploads web_hooks user_preferences_user_gitpod_enabled - ).freeze + ].freeze - USAGE_DATA_KEYS = %i( + USAGE_DATA_KEYS = %i[ counts recorded_at mattermost_enabled @@ -93,7 +93,7 @@ module UsageDataHelpers prometheus_metrics_enabled object_store topology - ).freeze + ].freeze def stub_usage_data_connections Gitlab::Database.database_base_models_with_gitlab_shared.each_value do |base_model| diff --git a/spec/support/import_export/configuration_helper.rb b/spec/support/import_export/configuration_helper.rb index 28797229661..f6917cdd89e 100644 --- a/spec/support/import_export/configuration_helper.rb +++ b/spec/support/import_export/configuration_helper.rb @@ -32,7 +32,7 @@ module ConfigurationHelper # - project is not part of the tree, so it has to be added manually. # - milestone, labels, merge_request have both singular and plural versions in the tree, so remove the duplicates. # - User, Author... Models we do not care about for checking models - names.flatten.uniq - %w(milestones labels user author merge_request design) + [key.to_s] + names.flatten.uniq - %w[milestones labels user author merge_request design] + [key.to_s] end def relation_class_for_name(relation_name) diff --git a/spec/support/import_export/export_file_helper.rb b/spec/support/import_export/export_file_helper.rb index 3be2d39906d..8068d3082d5 100644 --- a/spec/support/import_export/export_file_helper.rb +++ b/spec/support/import_export/export_file_helper.rb @@ -59,7 +59,7 @@ module ExportFileHelper def in_directory_with_expanded_export(project) Dir.mktmpdir do |tmpdir| export_file = project.export_file.path - _output, exit_status = Gitlab::Popen.popen(%W{tar -zxf #{export_file} -C #{tmpdir}}) + _output, exit_status = Gitlab::Popen.popen(%W[tar -zxf #{export_file} -C #{tmpdir}]) yield(exit_status, tmpdir) end diff --git a/spec/support/matchers/markdown_matchers.rb b/spec/support/matchers/markdown_matchers.rb index 7a82d7674d9..21fc1824bea 100644 --- a/spec/support/matchers/markdown_matchers.rb +++ b/spec/support/matchers/markdown_matchers.rb @@ -76,7 +76,7 @@ module MarkdownMatchers expect(actual).to have_autolink('irc://irc.freenode.net/git') expect(actual).to have_autolink('http://localhost:3000') - %w(code a kbd).each do |elem| + %w[code a kbd].each do |elem| expect(body).not_to have_selector("#{elem} a") end end diff --git a/spec/support/matchers/navigation_matcher.rb b/spec/support/matchers/navigation_matcher.rb index a0beecbfb2c..400c2fe7436 100644 --- a/spec/support/matchers/navigation_matcher.rb +++ b/spec/support/matchers/navigation_matcher.rb @@ -1,14 +1,20 @@ # frozen_string_literal: true +# These matches look for selectors within the Vue navigation sidebar. +# They should therefore be used in feature specs with the Js driver enabled. + RSpec::Matchers.define :have_active_navigation do |expected| match do |page| - expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) - expect(page.find('.sidebar-top-level-items > li.active')).to have_content(expected) + within_testid('super-sidebar') do + expect(page).to have_selector('button[aria-expanded="true"]', text: expected) + end end end RSpec::Matchers.define :have_active_sub_navigation do |expected| match do |page| - expect(page).to have_css('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)', text: expected) + within_testid('super-sidebar') do + expect(page).to have_selector('[aria-current="page"]', text: expected) + end end end diff --git a/spec/support/redis.rb b/spec/support/redis.rb index d5ae0bf1582..9cf5c44de98 100644 --- a/spec/support/redis.rb +++ b/spec/support/redis.rb @@ -3,9 +3,8 @@ require 'gitlab/redis' RSpec.configure do |config| config.after(:each, :redis) do - Sidekiq.redis do |connection| - connection.redis.flushdb - end + Sidekiq.redis(&:flushdb) + redis_queues_metadata_cleanup! end Gitlab::Redis::ALL_CLASSES.each do |instance_class| @@ -13,10 +12,12 @@ RSpec.configure do |config| config.around(:each, :"clean_gitlab_redis_#{underscored_name}") do |example| public_send("redis_#{underscored_name}_cleanup!") + redis_queues_metadata_cleanup! if underscored_name == 'queues' example.run public_send("redis_#{underscored_name}_cleanup!") + redis_queues_metadata_cleanup! if underscored_name == 'queues' end end diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index 51f3ff2c077..da23f81e86e 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -81,7 +81,6 @@ - './ee/spec/controllers/groups/iteration_cadences_controller_spec.rb' - './ee/spec/controllers/groups/iterations_controller_spec.rb' - './ee/spec/controllers/groups/ldaps_controller_spec.rb' -- './ee/spec/controllers/groups/ldap_settings_controller_spec.rb' - './ee/spec/controllers/groups/merge_requests_controller_spec.rb' - './ee/spec/controllers/groups/omniauth_callbacks_controller_spec.rb' - './ee/spec/controllers/groups/push_rules_controller_spec.rb' @@ -132,7 +131,6 @@ - './ee/spec/controllers/projects/merge_requests_controller_spec.rb' - './ee/spec/controllers/projects/merge_requests/creations_controller_spec.rb' - './ee/spec/controllers/projects/mirrors_controller_spec.rb' -- './ee/spec/controllers/projects/pages_controller_spec.rb' - './ee/spec/controllers/projects/path_locks_controller_spec.rb' - './ee/spec/controllers/projects/pipelines_controller_spec.rb' - './ee/spec/controllers/projects/protected_environments_controller_spec.rb' @@ -165,7 +163,6 @@ - './ee/spec/controllers/users_controller_spec.rb' - './ee/spec/db/production/license_spec.rb' - './ee/spec/elastic_integration/global_search_spec.rb' -- './ee/spec/elastic_integration/repository_index_spec.rb' - './ee/spec/elastic/migrate/20201105181100_apply_max_analyzed_offset_spec.rb' - './ee/spec/elastic/migrate/20201116142400_add_new_data_to_issues_documents_spec.rb' - './ee/spec/elastic/migrate/20201123123400_migrate_issues_to_separate_index_spec.rb' @@ -203,7 +200,6 @@ - './ee/spec/features/admin/admin_show_new_user_signups_cap_alert_spec.rb' - './ee/spec/features/admin/admin_users_spec.rb' - './ee/spec/features/admin/geo/admin_geo_nodes_spec.rb' -- './ee/spec/features/admin/geo/admin_geo_projects_spec.rb' - './ee/spec/features/admin/geo/admin_geo_replication_nav_spec.rb' - './ee/spec/features/admin/geo/admin_geo_sidebar_spec.rb' - './ee/spec/features/admin/groups/admin_changes_plan_spec.rb' @@ -292,7 +288,6 @@ - './ee/spec/features/groups/iterations/user_views_iteration_cadence_spec.rb' - './ee/spec/features/groups/iterations/user_views_iteration_spec.rb' - './ee/spec/features/groups/ldap_group_links_spec.rb' -- './ee/spec/features/groups/ldap_settings_spec.rb' - './ee/spec/features/groups/members/leave_group_spec.rb' - './ee/spec/features/groups/members/list_members_spec.rb' - './ee/spec/features/groups/members/manage_groups_spec.rb' @@ -337,7 +332,6 @@ - './ee/spec/features/issues/user_views_issues_spec.rb' - './ee/spec/features/labels_hierarchy_spec.rb' - './ee/spec/features/markdown/markdown_spec.rb' -- './ee/spec/features/markdown/metrics_spec.rb' - './ee/spec/features/merge_request/merge_request_widget_blocking_mrs_spec.rb' - './ee/spec/features/merge_request/sidebar_spec.rb' - './ee/spec/features/merge_requests/user_filters_by_approvers_spec.rb' @@ -393,7 +387,6 @@ - './ee/spec/features/projects/insights_spec.rb' - './ee/spec/features/projects/integrations/jira_issues_list_spec.rb' - './ee/spec/features/projects/integrations/project_integrations_spec.rb' -- './ee/spec/features/projects/integrations/prometheus_custom_metrics_spec.rb' - './ee/spec/features/projects/integrations/user_activates_github_spec.rb' - './ee/spec/features/projects/integrations/user_activates_jira_spec.rb' - './ee/spec/features/projects/issues/user_creates_issue_spec.rb' @@ -476,7 +469,6 @@ - './ee/spec/features/security/project/snippet/public_access_spec.rb' - './ee/spec/features/signup_spec.rb' - './ee/spec/features/subscriptions/expiring_subscription_message_spec.rb' -- './ee/spec/features/subscriptions/groups/edit_spec.rb' - './ee/spec/features/subscriptions_spec.rb' - './ee/spec/features/trial_registrations/company_information_spec.rb' - './ee/spec/features/trial_registrations/signin_spec.rb' @@ -509,7 +501,6 @@ - './ee/spec/finders/dast_site_profiles_finder_spec.rb' - './ee/spec/finders/dast_site_validations_finder_spec.rb' - './ee/spec/finders/ee/alert_management/http_integrations_finder_spec.rb' -- './ee/spec/finders/ee/autocomplete/users_finder_spec.rb' - './ee/spec/finders/ee/ci/daily_build_group_report_results_finder_spec.rb' - './ee/spec/finders/ee/clusters/agents_finder_spec.rb' - './ee/spec/finders/ee/fork_targets_finder_spec.rb' @@ -527,9 +518,6 @@ - './ee/spec/finders/geo/package_file_registry_finder_spec.rb' - './ee/spec/finders/geo/pages_deployment_registry_finder_spec.rb' - './ee/spec/finders/geo/pipeline_artifact_registry_finder_spec.rb' -- './ee/spec/finders/geo/project_registry_finder_spec.rb' -- './ee/spec/finders/geo/project_registry_status_finder_spec.rb' -- './ee/spec/finders/geo/repository_verification_finder_spec.rb' - './ee/spec/finders/geo/snippet_repository_registry_finder_spec.rb' - './ee/spec/finders/geo/terraform_state_version_registry_finder_spec.rb' - './ee/spec/finders/geo/upload_registry_finder_spec.rb' @@ -552,15 +540,10 @@ - './ee/spec/finders/security/findings_finder_spec.rb' - './ee/spec/finders/security/pipeline_vulnerabilities_finder_spec.rb' - './ee/spec/finders/security/scan_execution_policies_finder_spec.rb' -- './ee/spec/finders/security/training_providers/base_url_finder_spec.rb' -- './ee/spec/finders/security/training_providers/kontra_url_finder_spec.rb' -- './ee/spec/finders/security/training_providers/secure_code_warrior_url_finder_spec.rb' -- './ee/spec/finders/security/training_urls_finder_spec.rb' - './ee/spec/finders/security/vulnerabilities_finder_spec.rb' - './ee/spec/finders/security/vulnerability_feedbacks_finder_spec.rb' - './ee/spec/finders/security/vulnerability_reads_finder_spec.rb' - './ee/spec/finders/snippets_finder_spec.rb' -- './ee/spec/finders/software_license_policies_finder_spec.rb' - './ee/spec/finders/template_finder_spec.rb' - './ee/spec/finders/users_finder_spec.rb' - './ee/spec/frontend/fixtures/analytics/charts.rb' @@ -606,11 +589,9 @@ - './ee/spec/graphql/ee/types/mutation_type_spec.rb' - './ee/spec/graphql/ee/types/namespace_type_spec.rb' - './ee/spec/graphql/ee/types/notes/noteable_interface_spec.rb' -- './ee/spec/graphql/ee/types/projects/service_type_enum_spec.rb' - './ee/spec/graphql/ee/types/repository/blob_type_spec.rb' - './ee/spec/graphql/ee/types/todoable_interface_spec.rb' - './ee/spec/graphql/ee/types/user_merge_request_interaction_type_spec.rb' -- './ee/spec/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create_spec.rb' - './ee/spec/graphql/mutations/app_sec/fuzzing/coverage/corpus/create_spec.rb' - './ee/spec/graphql/mutations/audit_events/streaming/headers/create_spec.rb' - './ee/spec/graphql/mutations/audit_events/streaming/headers/destroy_spec.rb' @@ -671,7 +652,6 @@ - './ee/spec/graphql/mutations/security_policy/commit_scan_execution_policy_spec.rb' - './ee/spec/graphql/mutations/security_policy/create_security_policy_project_spec.rb' - './ee/spec/graphql/mutations/security_policy/unassign_security_policy_project_spec.rb' -- './ee/spec/graphql/mutations/security/training_provider_update_spec.rb' - './ee/spec/graphql/mutations/todos/create_spec.rb' - './ee/spec/graphql/mutations/vulnerabilities/confirm_spec.rb' - './ee/spec/graphql/mutations/vulnerabilities/create_external_issue_link_spec.rb' @@ -727,7 +707,6 @@ - './ee/spec/graphql/resolvers/security_orchestration/scan_execution_policy_resolver_spec.rb' - './ee/spec/graphql/resolvers/security_orchestration/scan_result_policy_resolver_spec.rb' - './ee/spec/graphql/resolvers/security_report_summary_resolver_spec.rb' -- './ee/spec/graphql/resolvers/security_training_urls_resolver_spec.rb' - './ee/spec/graphql/resolvers/timebox_report_resolver_spec.rb' - './ee/spec/graphql/resolvers/user_discussions_count_resolver_spec.rb' - './ee/spec/graphql/resolvers/user_notes_count_resolver_spec.rb' @@ -961,7 +940,6 @@ - './ee/spec/helpers/ee/system_note_helper_spec.rb' - './ee/spec/helpers/ee/todos_helper_spec.rb' - './ee/spec/helpers/ee/users/callouts_helper_spec.rb' -- './ee/spec/helpers/ee/version_check_helper_spec.rb' - './ee/spec/helpers/ee/wiki_helper_spec.rb' - './ee/spec/helpers/epics_helper_spec.rb' - './ee/spec/helpers/gitlab_subscriptions/upcoming_reconciliation_helper_spec.rb' @@ -1019,7 +997,6 @@ - './ee/spec/lib/audit/details_spec.rb' - './ee/spec/lib/audit/external_status_check_changes_auditor_spec.rb' - './ee/spec/lib/audit/group_merge_request_approval_setting_changes_auditor_spec.rb' -- './ee/spec/lib/audit/group_push_rules_changes_auditor_spec.rb' - './ee/spec/lib/banzai/filter/cross_project_issuable_information_filter_spec.rb' - './ee/spec/lib/banzai/filter/issuable_reference_expansion_filter_spec.rb' - './ee/spec/lib/banzai/filter/jira_private_image_link_filter_spec.rb' @@ -1092,14 +1069,11 @@ - './ee/spec/lib/ee/gitlab/auth/saml/identity_linker_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/backfill_iteration_cadence_id_for_boards_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/backfill_project_statistics_container_repository_size_spec.rb' -- './ee/spec/lib/ee/gitlab/background_migration/create_security_setting_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/delete_invalid_epic_issues_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_check_progress_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_in_batch_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/migrate_shared_vulnerability_scanners_spec.rb' -- './ee/spec/lib/ee/gitlab/background_migration/populate_latest_pipeline_ids_spec.rb' -- './ee/spec/lib/ee/gitlab/background_migration/populate_resolved_on_default_branch_column_spec.rb' - './ee/spec/lib/ee/gitlab/background_migration/purge_stale_security_scans_spec.rb' - './ee/spec/lib/ee/gitlab/checks/push_rule_check_spec.rb' - './ee/spec/lib/ee/gitlab/checks/push_rules/branch_check_spec.rb' @@ -1118,14 +1092,11 @@ - './ee/spec/lib/ee/gitlab/ci/pipeline/chain/validate/after_config_spec.rb' - './ee/spec/lib/ee/gitlab/ci/pipeline/chain/validate/external_spec.rb' - './ee/spec/lib/ee/gitlab/ci/pipeline/chain/validate/security_orchestration_policy_spec.rb' -- './ee/spec/lib/ee/gitlab/ci/pipeline/quota/activity_spec.rb' - './ee/spec/lib/ee/gitlab/ci/pipeline/quota/size_spec.rb' -- './ee/spec/lib/ee/gitlab/ci/reports/security/reports_spec.rb' - './ee/spec/lib/ee/gitlab/ci/status/build/manual_spec.rb' - './ee/spec/lib/ee/gitlab/ci/templates/templates_spec.rb' - './ee/spec/lib/ee/gitlab/cleanup/orphan_job_artifact_files_batch_spec.rb' - './ee/spec/lib/ee/gitlab/cleanup/orphan_job_artifact_files_spec.rb' -- './ee/spec/lib/ee/gitlab/database/gitlab_schema_spec.rb' - './ee/spec/lib/ee/gitlab/database_spec.rb' - './ee/spec/lib/ee/gitlab/elastic/helper_spec.rb' - './ee/spec/lib/ee/gitlab/email/handler/service_desk_handler_spec.rb' @@ -1150,11 +1121,9 @@ - './ee/spec/lib/ee/gitlab/issuable_metadata_spec.rb' - './ee/spec/lib/ee/gitlab/metrics/samplers/database_sampler_spec.rb' - './ee/spec/lib/ee/gitlab/middleware/read_only_spec.rb' -- './ee/spec/lib/ee/gitlab/namespaces/storage/enforcement_spec.rb' - './ee/spec/lib/ee/gitlab/namespace_storage_size_error_message_spec.rb' - './ee/spec/lib/ee/gitlab/omniauth_initializer_spec.rb' - './ee/spec/lib/ee/gitlab/pages/deployment_update_spec.rb' -- './ee/spec/lib/ee/gitlab/prometheus/metric_group_spec.rb' - './ee/spec/lib/ee/gitlab/rack_attack/request_spec.rb' - './ee/spec/lib/ee/gitlab/repo_path_spec.rb' - './ee/spec/lib/ee/gitlab/repository_size_checker_spec.rb' @@ -1169,7 +1138,6 @@ - './ee/spec/lib/ee/gitlab/template/gitlab_ci_yml_template_spec.rb' - './ee/spec/lib/ee/gitlab/tracking_spec.rb' - './ee/spec/lib/ee/gitlab/url_builder_spec.rb' -- './ee/spec/lib/ee/gitlab/usage_data_counters/hll_redis_counter_spec.rb' - './ee/spec/lib/ee/gitlab/usage_data_counters/issue_activity_unique_counter_spec.rb' - './ee/spec/lib/ee/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb' - './ee/spec/lib/ee/gitlab/usage_data_counters/work_item_activity_unique_counter_spec.rb' @@ -1300,7 +1268,6 @@ - './ee/spec/lib/gitlab/ci/parsers/security/validators/default_branch_image_validator_spec.rb' - './ee/spec/lib/gitlab/ci/pipeline/chain/config/content_spec.rb' - './ee/spec/lib/gitlab/ci/pipeline/chain/create_cross_database_associations_spec.rb' -- './ee/spec/lib/gitlab/ci/pipeline/chain/limit/activity_spec.rb' - './ee/spec/lib/gitlab/ci/pipeline/chain/limit/size_spec.rb' - './ee/spec/lib/gitlab/ci/reports/coverage_fuzzing/report_spec.rb' - './ee/spec/lib/gitlab/ci/reports/dependency_list/dependency_spec.rb' @@ -1387,13 +1354,6 @@ - './ee/spec/lib/gitlab/geo/log_cursor/events/cache_invalidation_event_spec.rb' - './ee/spec/lib/gitlab/geo/log_cursor/events/event_spec.rb' - './ee/spec/lib/gitlab/geo/log_cursor/events/hashed_storage_attachments_event_spec.rb' -- './ee/spec/lib/gitlab/geo/log_cursor/events/hashed_storage_migrated_event_spec.rb' -- './ee/spec/lib/gitlab/geo/log_cursor/events/repositories_changed_event_spec.rb' -- './ee/spec/lib/gitlab/geo/log_cursor/events/repository_created_event_spec.rb' -- './ee/spec/lib/gitlab/geo/log_cursor/events/repository_deleted_event_spec.rb' -- './ee/spec/lib/gitlab/geo/log_cursor/events/repository_renamed_event_spec.rb' -- './ee/spec/lib/gitlab/geo/log_cursor/events/repository_updated_event_spec.rb' -- './ee/spec/lib/gitlab/geo/log_cursor/events/reset_checksum_event_spec.rb' - './ee/spec/lib/gitlab/geo/log_cursor/lease_spec.rb' - './ee/spec/lib/gitlab/geo/log_cursor/logger_spec.rb' - './ee/spec/lib/gitlab/geo/logger_spec.rb' @@ -1461,12 +1421,8 @@ - './ee/spec/lib/gitlab/pagination/keyset/simple_order_builder_spec.rb' - './ee/spec/lib/gitlab/patch/database_config_spec.rb' - './ee/spec/lib/gitlab/patch/draw_route_spec.rb' -- './ee/spec/lib/gitlab/patch/geo_database_tasks_spec.rb' - './ee/spec/lib/gitlab/path_locks_finder_spec.rb' - './ee/spec/lib/gitlab/project_template_spec.rb' -- './ee/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb' -- './ee/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb' -- './ee/spec/lib/gitlab/prometheus/queries/cluster_query_spec.rb' - './ee/spec/lib/gitlab/proxy_spec.rb' - './ee/spec/lib/gitlab/quick_actions/users_extractor_spec.rb' - './ee/spec/lib/gitlab/rack_attack_spec.rb' @@ -1523,7 +1479,6 @@ - './ee/spec/lib/gitlab/visibility_level_spec.rb' - './ee/spec/lib/gitlab/vulnerabilities/base_vulnerability_spec.rb' - './ee/spec/lib/gitlab/vulnerabilities/container_scanning_vulnerability_spec.rb' -- './ee/spec/lib/gitlab/vulnerabilities/findings_preloader_spec.rb' - './ee/spec/lib/gitlab/vulnerabilities/parser_spec.rb' - './ee/spec/lib/gitlab/vulnerabilities/standard_vulnerability_spec.rb' - './ee/spec/lib/gitlab/web_ide/config/entry/schema/match_spec.rb' @@ -1552,7 +1507,6 @@ - './ee/spec/mailers/devise_mailer_spec.rb' - './ee/spec/mailers/ee/emails/admin_notification_spec.rb' - './ee/spec/mailers/ee/emails/issues_spec.rb' -- './ee/spec/mailers/ee/emails/merge_requests_spec.rb' - './ee/spec/mailers/ee/emails/profile_spec.rb' - './ee/spec/mailers/ee/emails/projects_spec.rb' - './ee/spec/mailers/emails/epics_spec.rb' @@ -1576,7 +1530,6 @@ - './ee/spec/models/allowed_email_domain_spec.rb' - './ee/spec/models/analytics/cycle_analytics/aggregation_context_spec.rb' - './ee/spec/models/analytics/cycle_analytics/group_level_spec.rb' -- './ee/spec/models/analytics/cycle_analytics/runtime_limiter_spec.rb' - './ee/spec/models/analytics/devops_adoption/enabled_namespace_spec.rb' - './ee/spec/models/analytics/devops_adoption/snapshot_spec.rb' - './ee/spec/models/analytics/issues_analytics_spec.rb' @@ -1634,7 +1587,6 @@ - './ee/spec/models/concerns/ee/project_security_scanners_information_spec.rb' - './ee/spec/models/concerns/ee/weight_eventable_spec.rb' - './ee/spec/models/concerns/elastic/application_versioned_search_spec.rb' -- './ee/spec/models/concerns/elastic/issue_spec.rb' - './ee/spec/models/concerns/elastic/merge_request_spec.rb' - './ee/spec/models/concerns/elastic/milestone_spec.rb' - './ee/spec/models/concerns/elastic/note_spec.rb' @@ -1707,7 +1659,6 @@ - './ee/spec/models/ee/namespaces/namespace_ban_spec.rb' - './ee/spec/models/ee/namespace_spec.rb' - './ee/spec/models/ee/namespace_statistics_spec.rb' -- './ee/spec/models/ee/namespace/storage/notification_spec.rb' - './ee/spec/models/ee/notification_setting_spec.rb' - './ee/spec/models/ee/pages_deployment_spec.rb' - './ee/spec/models/ee/personal_access_token_spec.rb' @@ -1718,7 +1669,6 @@ - './ee/spec/models/ee/project_setting_spec.rb' - './ee/spec/models/ee/project_wiki_spec.rb' - './ee/spec/models/ee/protected_branch_spec.rb' -- './ee/spec/models/ee/protected_ref_access_spec.rb' - './ee/spec/models/ee/protected_ref_spec.rb' - './ee/spec/models/ee/release_spec.rb' - './ee/spec/models/ee/resource_label_event_spec.rb' @@ -1761,7 +1711,6 @@ - './ee/spec/models/geo/package_file_registry_spec.rb' - './ee/spec/models/geo/pages_deployment_registry_spec.rb' - './ee/spec/models/geo/pipeline_artifact_registry_spec.rb' -- './ee/spec/models/geo/project_registry_spec.rb' - './ee/spec/models/geo/push_user_spec.rb' - './ee/spec/models/geo/repositories_changed_event_spec.rb' - './ee/spec/models/geo/repository_created_event_spec.rb' @@ -1794,7 +1743,6 @@ - './ee/spec/models/integrations/github_spec.rb' - './ee/spec/models/integrations/github/status_message_spec.rb' - './ee/spec/models/integrations/github/status_notifier_spec.rb' -- './ee/spec/models/integrations/gitlab_slack_application_spec.rb' - './ee/spec/models/ip_restriction_spec.rb' - './ee/spec/models/issuable_metric_image_spec.rb' - './ee/spec/models/issuables_analytics_spec.rb' @@ -1833,7 +1781,6 @@ - './ee/spec/models/project_member_spec.rb' - './ee/spec/models/project_repository_state_spec.rb' - './ee/spec/models/project_security_setting_spec.rb' -- './ee/spec/models/project_team_spec.rb' - './ee/spec/models/protected_branch/required_code_owners_section_spec.rb' - './ee/spec/models/protected_branch/unprotect_access_level_spec.rb' - './ee/spec/models/protected_environments/approval_rule_spec.rb' @@ -1863,7 +1810,6 @@ - './ee/spec/models/security/scan_spec.rb' - './ee/spec/models/security/training_provider_spec.rb' - './ee/spec/models/security/training_spec.rb' -- './ee/spec/models/slack_integration_spec.rb' - './ee/spec/models/snippet_repository_spec.rb' - './ee/spec/models/snippet_spec.rb' - './ee/spec/models/software_license_policy_spec.rb' @@ -1927,7 +1873,6 @@ - './ee/spec/policies/global_policy_spec.rb' - './ee/spec/policies/group_hook_policy_spec.rb' - './ee/spec/policies/group_policy_spec.rb' -- './ee/spec/policies/identity_provider_policy_spec.rb' - './ee/spec/policies/instance_security_dashboard_policy_spec.rb' - './ee/spec/policies/issuable_policy_spec.rb' - './ee/spec/policies/issue_policy_spec.rb' @@ -2002,7 +1947,6 @@ - './ee/spec/requests/api/award_emoji_spec.rb' - './ee/spec/requests/api/boards_spec.rb' - './ee/spec/requests/api/branches_spec.rb' -- './ee/spec/requests/api/captcha_check_spec.rb' - './ee/spec/requests/api/ci/jobs_spec.rb' - './ee/spec/requests/api/ci/minutes_spec.rb' - './ee/spec/requests/api/ci/pipelines_spec.rb' @@ -2024,7 +1968,6 @@ - './ee/spec/requests/api/features_spec.rb' - './ee/spec/requests/api/files_spec.rb' - './ee/spec/requests/api/geo_nodes_spec.rb' -- './ee/spec/requests/api/geo_replication_spec.rb' - './ee/spec/requests/api/geo_spec.rb' - './ee/spec/requests/api/graphql/analytics/devops_adoption/enabled_namespaces_spec.rb' - './ee/spec/requests/api/graphql/app_sec/fuzzing/api/ci_configuration_type_spec.rb' @@ -2071,7 +2014,6 @@ - './ee/spec/requests/api/graphql/mutations/analytics/devops_adoption/enabled_namespaces/bulk_enable_spec.rb' - './ee/spec/requests/api/graphql/mutations/analytics/devops_adoption/enabled_namespaces/disable_spec.rb' - './ee/spec/requests/api/graphql/mutations/analytics/devops_adoption/enabled_namespaces/enable_spec.rb' -- './ee/spec/requests/api/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create_spec.rb' - './ee/spec/requests/api/graphql/mutations/audit_events/external_audit_event_destinations/create_spec.rb' - './ee/spec/requests/api/graphql/mutations/audit_events/external_audit_event_destinations/destroy_spec.rb' - './ee/spec/requests/api/graphql/mutations/audit_events/external_audit_event_destinations/update_spec.rb' @@ -2142,7 +2084,6 @@ - './ee/spec/requests/api/graphql/mutations/users/abuse/namespace_bans/destroy_spec.rb' - './ee/spec/requests/api/graphql/mutations/vulnerabilities/create_external_issue_link_spec.rb' - './ee/spec/requests/api/graphql/mutations/vulnerabilities/destroy_external_issue_link_spec.rb' -- './ee/spec/requests/api/graphql/mutations/vulnerabilities/finding_dismiss_spec.rb' - './ee/spec/requests/api/graphql/mutations/work_items/update_spec.rb' - './ee/spec/requests/api/graphql/namespace/compliance_frameworks_spec.rb' - './ee/spec/requests/api/graphql/namespace/projects_spec.rb' @@ -2174,7 +2115,6 @@ - './ee/spec/requests/api/graphql/project/security_orchestration/scan_result_policy_spec.rb' - './ee/spec/requests/api/graphql/project/vulnerability_severities_count_spec.rb' - './ee/spec/requests/api/graphql/project/work_items_spec.rb' -- './ee/spec/requests/api/graphql/vulnerabilities/description_spec.rb' - './ee/spec/requests/api/graphql/vulnerabilities/details_spec.rb' - './ee/spec/requests/api/graphql/vulnerabilities/external_issue_links_spec.rb' - './ee/spec/requests/api/graphql/vulnerabilities/identifiers_spec.rb' @@ -2241,7 +2181,6 @@ - './ee/spec/requests/api/todos_spec.rb' - './ee/spec/requests/api/usage_data_spec.rb' - './ee/spec/requests/api/users_spec.rb' -- './ee/spec/requests/api/v3/github_spec.rb' - './ee/spec/requests/api/visual_review_discussions_spec.rb' - './ee/spec/requests/api/vulnerabilities_spec.rb' - './ee/spec/requests/api/vulnerability_exports_spec.rb' @@ -2260,7 +2199,6 @@ - './ee/spec/requests/groups/analytics/devops_adoption_controller_spec.rb' - './ee/spec/requests/groups/audit_events_spec.rb' - './ee/spec/requests/groups/clusters_controller_spec.rb' -- './ee/spec/requests/groups/compliance_frameworks_spec.rb' - './ee/spec/requests/groups/contribution_analytics_spec.rb' - './ee/spec/requests/groups_controller_spec.rb' - './ee/spec/requests/groups/epics/epic_links_controller_spec.rb' @@ -2358,7 +2296,6 @@ - './ee/spec/serializers/integrations/jira_serializers/issue_entity_spec.rb' - './ee/spec/serializers/integrations/jira_serializers/issue_serializer_spec.rb' - './ee/spec/serializers/integrations/zentao_serializers/issue_entity_spec.rb' -- './ee/spec/serializers/issuable_sidebar_extras_entity_spec.rb' - './ee/spec/serializers/issue_serializer_spec.rb' - './ee/spec/serializers/issues/linked_issue_feature_flag_entity_spec.rb' - './ee/spec/serializers/license_compliance/collapsed_comparer_entity_spec.rb' @@ -2370,7 +2307,6 @@ - './ee/spec/serializers/member_entity_spec.rb' - './ee/spec/serializers/member_user_entity_spec.rb' - './ee/spec/serializers/merge_request_poll_widget_entity_spec.rb' -- './ee/spec/serializers/merge_request_sidebar_basic_entity_spec.rb' - './ee/spec/serializers/merge_request_widget_entity_spec.rb' - './ee/spec/serializers/metrics_report_metric_entity_spec.rb' - './ee/spec/serializers/metrics_reports_comparer_entity_spec.rb' @@ -2454,10 +2390,8 @@ - './ee/spec/services/app_sec/fuzzing/coverage/corpuses/create_service_spec.rb' - './ee/spec/services/arkose/blocked_users_report_service_spec.rb' - './ee/spec/services/audit_events/build_service_spec.rb' -- './ee/spec/services/audit_events/custom_audit_event_service_spec.rb' - './ee/spec/services/audit_event_service_spec.rb' - './ee/spec/services/audit_events/export_csv_service_spec.rb' -- './ee/spec/services/audit_events/impersonation_audit_event_service_spec.rb' - './ee/spec/services/audit_events/protected_branch_audit_event_service_spec.rb' - './ee/spec/services/audit_events/register_runner_audit_event_service_spec.rb' - './ee/spec/services/audit_events/release_artifacts_downloaded_audit_event_service_spec.rb' @@ -2700,41 +2634,20 @@ - './ee/spec/services/geo/cache_invalidation_event_store_spec.rb' - './ee/spec/services/geo/container_repository_sync_service_spec.rb' - './ee/spec/services/geo/container_repository_sync_spec.rb' -- './ee/spec/services/geo/design_repository_sync_service_spec.rb' - './ee/spec/services/geo/event_service_spec.rb' - './ee/spec/services/geo/file_registry_removal_service_spec.rb' -- './ee/spec/services/geo/files_expire_service_spec.rb' - './ee/spec/services/geo/framework_repository_sync_service_spec.rb' - './ee/spec/services/geo/graphql_request_service_spec.rb' - './ee/spec/services/geo/hashed_storage_attachments_event_store_spec.rb' - './ee/spec/services/geo/hashed_storage_attachments_migration_service_spec.rb' -- './ee/spec/services/geo/hashed_storage_migrated_event_store_spec.rb' -- './ee/spec/services/geo/hashed_storage_migration_service_spec.rb' - './ee/spec/services/geo/metrics_update_service_spec.rb' -- './ee/spec/services/geo/move_repository_service_spec.rb' - './ee/spec/services/geo/node_create_service_spec.rb' - './ee/spec/services/geo/node_status_request_service_spec.rb' - './ee/spec/services/geo/node_update_service_spec.rb' -- './ee/spec/services/geo/project_housekeeping_service_spec.rb' - './ee/spec/services/geo/prune_event_log_service_spec.rb' - './ee/spec/services/geo/registry_consistency_service_spec.rb' -- './ee/spec/services/geo/rename_repository_service_spec.rb' - './ee/spec/services/geo/replication_toggle_request_service_spec.rb' -- './ee/spec/services/geo/repositories_changed_event_store_spec.rb' -- './ee/spec/services/geo/repository_base_sync_service_spec.rb' -- './ee/spec/services/geo/repository_created_event_store_spec.rb' -- './ee/spec/services/geo/repository_deleted_event_store_spec.rb' -- './ee/spec/services/geo/repository_destroy_service_spec.rb' - './ee/spec/services/geo/repository_registry_removal_service_spec.rb' -- './ee/spec/services/geo/repository_renamed_event_store_spec.rb' -- './ee/spec/services/geo/repository_sync_service_spec.rb' -- './ee/spec/services/geo/repository_updated_event_store_spec.rb' -- './ee/spec/services/geo/repository_updated_service_spec.rb' -- './ee/spec/services/geo/repository_verification_primary_service_spec.rb' -- './ee/spec/services/geo/repository_verification_reset_spec.rb' -- './ee/spec/services/geo/repository_verification_secondary_service_spec.rb' -- './ee/spec/services/geo/reset_checksum_event_store_spec.rb' -- './ee/spec/services/geo/wiki_sync_service_spec.rb' - './ee/spec/services/gitlab_subscriptions/activate_service_spec.rb' - './ee/spec/services/gitlab_subscriptions/check_future_renewal_service_spec.rb' - './ee/spec/services/gitlab_subscriptions/create_service_spec.rb' @@ -2823,7 +2736,6 @@ - './ee/spec/services/personal_access_tokens/revoke_invalid_tokens_spec.rb' - './ee/spec/services/personal_access_tokens/revoke_service_audit_log_spec.rb' - './ee/spec/services/personal_access_tokens/rotation_verifier_service_spec.rb' -- './ee/spec/services/projects/after_rename_service_spec.rb' - './ee/spec/services/projects/alerting/notify_service_spec.rb' - './ee/spec/services/projects/cleanup_service_spec.rb' - './ee/spec/services/projects/create_from_template_service_spec.rb' @@ -2838,13 +2750,11 @@ - './ee/spec/services/projects/group_links/destroy_service_spec.rb' - './ee/spec/services/projects/group_links/update_service_spec.rb' - './ee/spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb' -- './ee/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb' - './ee/spec/services/projects/import_export/export_service_spec.rb' - './ee/spec/services/projects/import_service_spec.rb' - './ee/spec/services/projects/mark_for_deletion_service_spec.rb' - './ee/spec/services/projects/open_issues_count_service_spec.rb' - './ee/spec/services/projects/operations/update_service_spec.rb' -- './ee/spec/services/projects/prometheus/alerts/notify_service_spec.rb' - './ee/spec/services/projects/protect_default_branch_service_spec.rb' - './ee/spec/services/projects/restore_service_spec.rb' - './ee/spec/services/projects/setup_ci_cd_spec.rb' @@ -2894,7 +2804,6 @@ - './ee/spec/services/security/ingestion/tasks/ingest_finding_signatures_spec.rb' - './ee/spec/services/security/ingestion/tasks/ingest_findings_spec.rb' - './ee/spec/services/security/ingestion/tasks/ingest_identifiers_spec.rb' -- './ee/spec/services/security/ingestion/tasks/ingest_issue_links_spec.rb' - './ee/spec/services/security/ingestion/tasks/ingest_remediations_spec.rb' - './ee/spec/services/security/ingestion/tasks/ingest_vulnerabilities/create_spec.rb' - './ee/spec/services/security/ingestion/tasks/ingest_vulnerabilities/mark_resolved_as_detected_spec.rb' @@ -2925,7 +2834,6 @@ - './ee/spec/services/security/security_orchestration_policies/rule_schedule_service_spec.rb' - './ee/spec/services/security/security_orchestration_policies/scan_pipeline_service_spec.rb' - './ee/spec/services/security/security_orchestration_policies/sync_opened_merge_requests_service_spec.rb' -- './ee/spec/services/security/security_orchestration_policies/sync_open_merge_requests_head_pipeline_service_spec.rb' - './ee/spec/services/security/security_orchestration_policies/validate_policy_service_spec.rb' - './ee/spec/services/security/store_grouped_scans_service_spec.rb' - './ee/spec/services/security/store_scan_service_spec.rb' @@ -2953,14 +2861,12 @@ - './ee/spec/services/users/abuse/git_abuse/namespace_throttle_service_spec.rb' - './ee/spec/services/users/abuse/namespace_bans/create_service_spec.rb' - './ee/spec/services/users/abuse/namespace_bans/destroy_service_spec.rb' -- './ee/spec/services/users/captcha_challenge_service_spec.rb' - './ee/spec/services/users_ops_dashboard_projects/destroy_service_spec.rb' - './ee/spec/services/users/update_highest_member_role_service_spec.rb' - './ee/spec/services/vulnerabilities/confirm_service_spec.rb' - './ee/spec/services/vulnerabilities/create_service_spec.rb' - './ee/spec/services/vulnerabilities/destroy_dismissal_feedback_service_spec.rb' - './ee/spec/services/vulnerabilities/dismiss_service_spec.rb' -- './ee/spec/services/vulnerabilities/finding_dismiss_service_spec.rb' - './ee/spec/services/vulnerabilities/historical_statistics/adjustment_service_spec.rb' - './ee/spec/services/vulnerabilities/historical_statistics/deletion_service_spec.rb' - './ee/spec/services/vulnerabilities/manually_create_service_spec.rb' @@ -2990,7 +2896,6 @@ - './ee/spec/services/wikis/create_attachment_service_spec.rb' - './ee/spec/services/work_items/update_service_spec.rb' - './ee/spec/services/work_items/widgets/weight_service/update_service_spec.rb' -- './ee/spec/tasks/geo/git_rake_spec.rb' - './ee/spec/tasks/geo_rake_spec.rb' - './ee/spec/tasks/gitlab/check_rake_spec.rb' - './ee/spec/tasks/gitlab/elastic_rake_spec.rb' @@ -3019,9 +2924,7 @@ - './ee/spec/views/compliance_management/compliance_framework/_project_settings.html.haml_spec.rb' - './ee/spec/views/devise/sessions/new.html.haml_spec.rb' - './ee/spec/views/groups/billings/index.html.haml_spec.rb' -- './ee/spec/views/groups/compliance_frameworks/edit.html.haml_spec.rb' - './ee/spec/views/groups/_compliance_frameworks.html.haml_spec.rb' -- './ee/spec/views/groups/compliance_frameworks/new.html.haml_spec.rb' - './ee/spec/views/groups/edit.html.haml_spec.rb' - './ee/spec/views/groups/hook_logs/show.html.haml_spec.rb' - './ee/spec/views/groups/hooks/edit.html.haml_spec.rb' @@ -3041,7 +2944,6 @@ - './ee/spec/views/operations/index.html.haml_spec.rb' - './ee/spec/views/profiles/preferences/show.html.haml_spec.rb' - './ee/spec/views/projects/edit.html.haml_spec.rb' -- './ee/spec/views/projects/issues/show.html.haml_spec.rb' - './ee/spec/views/projects/on_demand_scans/index.html.haml_spec.rb' - './ee/spec/views/projects/security/corpus_management/show.html.haml_spec.rb' - './ee/spec/views/projects/security/dast_profiles/show.html.haml_spec.rb' @@ -3137,19 +3039,13 @@ - './ee/spec/workers/elastic_remove_expired_namespace_subscriptions_from_index_cron_worker_spec.rb' - './ee/spec/workers/epics/new_epic_issue_worker_spec.rb' - './ee/spec/workers/geo/batch_event_create_worker_spec.rb' -- './ee/spec/workers/geo/batch/project_registry_scheduler_worker_spec.rb' -- './ee/spec/workers/geo/batch/project_registry_worker_spec.rb' - './ee/spec/workers/geo/container_repository_sync_worker_spec.rb' - './ee/spec/workers/geo/create_repository_updated_event_worker_spec.rb' -- './ee/spec/workers/geo/design_repository_shard_sync_worker_spec.rb' -- './ee/spec/workers/geo/design_repository_sync_worker_spec.rb' - './ee/spec/workers/geo/destroy_worker_spec.rb' - './ee/spec/workers/geo/event_worker_spec.rb' - './ee/spec/workers/geo/metrics_update_worker_spec.rb' -- './ee/spec/workers/geo/project_sync_worker_spec.rb' - './ee/spec/workers/geo/prune_event_log_worker_spec.rb' - './ee/spec/workers/geo/registry_sync_worker_spec.rb' -- './ee/spec/workers/geo/repositories_clean_up_worker_spec.rb' - './ee/spec/workers/geo/reverification_batch_worker_spec.rb' - './ee/spec/workers/geo/scheduler/scheduler_worker_spec.rb' - './ee/spec/workers/geo/secondary/registry_consistency_worker_spec.rb' @@ -3190,7 +3086,6 @@ - './ee/spec/workers/project_import_schedule_worker_spec.rb' - './ee/spec/workers/projects/disable_legacy_open_source_license_for_inactive_projects_worker_spec.rb' - './ee/spec/workers/project_template_export_worker_spec.rb' -- './ee/spec/workers/refresh_license_compliance_checks_worker_spec.rb' - './ee/spec/workers/repository_import_worker_spec.rb' - './ee/spec/workers/repository_update_mirror_worker_spec.rb' - './ee/spec/workers/requirements_management/import_requirements_csv_worker_spec.rb' @@ -3286,12 +3181,10 @@ - './spec/controllers/concerns/internal_redirect_spec.rb' - './spec/controllers/concerns/issuable_actions_spec.rb' - './spec/controllers/concerns/issuable_collections_spec.rb' -- './spec/controllers/concerns/metrics_dashboard_spec.rb' - './spec/controllers/concerns/page_limiter_spec.rb' - './spec/controllers/concerns/product_analytics_tracking_spec.rb' - './spec/controllers/concerns/project_unauthorized_spec.rb' - './spec/controllers/concerns/redirects_for_missing_path_on_tree_spec.rb' -- './spec/controllers/concerns/redis_tracking_spec.rb' - './spec/controllers/concerns/renders_commits_spec.rb' - './spec/controllers/concerns/routable_actions_spec.rb' - './spec/controllers/concerns/send_file_upload_spec.rb' @@ -3347,7 +3240,6 @@ - './spec/controllers/import/fogbugz_controller_spec.rb' - './spec/controllers/import/gitea_controller_spec.rb' - './spec/controllers/import/github_controller_spec.rb' -- './spec/controllers/import/gitlab_controller_spec.rb' - './spec/controllers/import/manifest_controller_spec.rb' - './spec/controllers/invites_controller_spec.rb' - './spec/controllers/jira_connect/app_descriptor_controller_spec.rb' @@ -3359,7 +3251,6 @@ - './spec/controllers/oauth/applications_controller_spec.rb' - './spec/controllers/oauth/authorizations_controller_spec.rb' - './spec/controllers/oauth/authorized_applications_controller_spec.rb' -- './spec/controllers/oauth/jira_dvcs/authorizations_controller_spec.rb' - './spec/controllers/oauth/token_info_controller_spec.rb' - './spec/controllers/oauth/tokens_controller_spec.rb' - './spec/controllers/omniauth_callbacks_controller_spec.rb' @@ -3377,7 +3268,6 @@ - './spec/controllers/profiles/two_factor_auths_controller_spec.rb' - './spec/controllers/profiles/webauthn_registrations_controller_spec.rb' - './spec/controllers/projects/alerting/notifications_controller_spec.rb' -- './spec/controllers/projects/alert_management_controller_spec.rb' - './spec/controllers/projects/analytics/cycle_analytics/stages_controller_spec.rb' - './spec/controllers/projects/analytics/cycle_analytics/summary_controller_spec.rb' - './spec/controllers/projects/analytics/cycle_analytics/value_streams_controller_spec.rb' @@ -3405,8 +3295,6 @@ - './spec/controllers/projects/design_management/designs/resized_image_controller_spec.rb' - './spec/controllers/projects/discussions_controller_spec.rb' - './spec/controllers/projects/environments_controller_spec.rb' -- './spec/controllers/projects/environments/prometheus_api_controller_spec.rb' -- './spec/controllers/projects/environments/sample_metrics_controller_spec.rb' - './spec/controllers/projects/error_tracking_controller_spec.rb' - './spec/controllers/projects/error_tracking/projects_controller_spec.rb' - './spec/controllers/projects/error_tracking/stack_traces_controller_spec.rb' @@ -3415,7 +3303,6 @@ - './spec/controllers/projects/feature_flags_user_lists_controller_spec.rb' - './spec/controllers/projects/find_file_controller_spec.rb' - './spec/controllers/projects/forks_controller_spec.rb' -- './spec/controllers/projects/grafana_api_controller_spec.rb' - './spec/controllers/projects/graphs_controller_spec.rb' - './spec/controllers/projects/group_links_controller_spec.rb' - './spec/controllers/projects/hooks_controller_spec.rb' @@ -3439,15 +3326,12 @@ - './spec/controllers/projects/packages/packages_controller_spec.rb' - './spec/controllers/projects/pages_controller_spec.rb' - './spec/controllers/projects/pages_domains_controller_spec.rb' -- './spec/controllers/projects/performance_monitoring/dashboards_controller_spec.rb' - './spec/controllers/projects/pipeline_schedules_controller_spec.rb' - './spec/controllers/projects/pipelines_controller_spec.rb' - './spec/controllers/projects/pipelines_settings_controller_spec.rb' - './spec/controllers/projects/pipelines/stages_controller_spec.rb' - './spec/controllers/projects/pipelines/tests_controller_spec.rb' - './spec/controllers/projects/project_members_controller_spec.rb' -- './spec/controllers/projects/prometheus/alerts_controller_spec.rb' -- './spec/controllers/projects/prometheus/metrics_controller_spec.rb' - './spec/controllers/projects/protected_branches_controller_spec.rb' - './spec/controllers/projects/protected_tags_controller_spec.rb' - './spec/controllers/projects/raw_controller_spec.rb' @@ -3458,7 +3342,6 @@ - './spec/controllers/projects/releases/evidences_controller_spec.rb' - './spec/controllers/projects/repositories_controller_spec.rb' - './spec/controllers/projects/security/configuration_controller_spec.rb' -- './spec/controllers/projects/service_desk_controller_spec.rb' - './spec/controllers/projects/service_ping_controller_spec.rb' - './spec/controllers/projects/settings/ci_cd_controller_spec.rb' - './spec/controllers/projects/settings/integration_hook_logs_controller_spec.rb' @@ -3494,17 +3377,14 @@ - './spec/controllers/users/terms_controller_spec.rb' - './spec/controllers/users/unsubscribes_controller_spec.rb' - './spec/db/development/create_base_work_item_types_spec.rb' -- './spec/db/development/import_common_metrics_spec.rb' - './spec/db/docs_spec.rb' - './spec/db/migration_spec.rb' - './spec/db/production/create_base_work_item_types_spec.rb' -- './spec/db/production/import_common_metrics_spec.rb' - './spec/db/production/settings_spec.rb' - './spec/db/schema_spec.rb' - './spec/dependencies/omniauth_saml_spec.rb' - './spec/experiments/application_experiment_spec.rb' - './spec/experiments/in_product_guidance_environments_webide_experiment_spec.rb' -- './spec/experiments/ios_specific_templates_experiment_spec.rb' - './spec/features/abuse_report_spec.rb' - './spec/features/action_cable_logging_spec.rb' - './spec/features/admin/admin_abuse_reports_spec.rb' @@ -3575,7 +3455,6 @@ - './spec/features/callouts/registration_enabled_spec.rb' - './spec/features/canonical_link_spec.rb' - './spec/features/clusters/cluster_detail_page_spec.rb' -- './spec/features/clusters/cluster_health_dashboard_spec.rb' - './spec/features/clusters/create_agent_spec.rb' - './spec/features/commit_spec.rb' - './spec/features/commits_spec.rb' @@ -3592,7 +3471,6 @@ - './spec/features/dashboard/issuables_counter_spec.rb' - './spec/features/dashboard/issues_filter_spec.rb' - './spec/features/dashboard/issues_spec.rb' -- './spec/features/dashboard/label_filter_spec.rb' - './spec/features/dashboard/merge_requests_spec.rb' - './spec/features/dashboard/milestones_spec.rb' - './spec/features/dashboard/project_member_activity_index_spec.rb' @@ -3767,7 +3645,6 @@ - './spec/features/issues/user_views_issues_spec.rb' - './spec/features/jira_connect/branches_spec.rb' - './spec/features/jira_connect/subscriptions_spec.rb' -- './spec/features/jira_oauth_provider_authorize_spec.rb' - './spec/features/labels_hierarchy_spec.rb' - './spec/features/markdown/copy_as_gfm_spec.rb' - './spec/features/markdown/gitlab_flavored_markdown_spec.rb' @@ -3776,7 +3653,6 @@ - './spec/features/markdown/kroki_spec.rb' - './spec/features/markdown/markdown_spec.rb' - './spec/features/markdown/math_spec.rb' -- './spec/features/markdown/metrics_spec.rb' - './spec/features/markdown/sandboxed_mermaid_spec.rb' - './spec/features/merge_request/batch_comments_spec.rb' - './spec/features/merge_request/close_reopen_report_toggle_spec.rb' @@ -3827,7 +3703,6 @@ - './spec/features/merge_request/user_merges_immediately_spec.rb' - './spec/features/merge_request/user_merges_merge_request_spec.rb' - './spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb' -- './spec/features/merge_request/user_merges_when_pipeline_succeeds_spec.rb' - './spec/features/merge_request/user_opens_checkout_branch_modal_spec.rb' - './spec/features/merge_request/user_opens_context_commits_modal_spec.rb' - './spec/features/merge_request/user_posts_diff_notes_spec.rb' @@ -3883,11 +3758,8 @@ - './spec/features/milestones/user_views_milestone_spec.rb' - './spec/features/milestones/user_views_milestones_spec.rb' - './spec/features/monitor_sidebar_link_spec.rb' -- './spec/features/nav/top_nav_responsive_spec.rb' -- './spec/features/nav/top_nav_tooltip_spec.rb' - './spec/features/oauth_login_spec.rb' - './spec/features/oauth_provider_authorize_spec.rb' -- './spec/features/oauth_registration_spec.rb' - './spec/features/one_trust_spec.rb' - './spec/features/participants_autocomplete_spec.rb' - './spec/features/password_reset_spec.rb' @@ -3905,16 +3777,13 @@ - './spec/features/profiles/two_factor_auths_spec.rb' - './spec/features/profiles/user_changes_notified_of_own_activity_spec.rb' - './spec/features/profiles/user_edit_preferences_spec.rb' -- './spec/features/profiles/user_edit_profile_spec.rb' - './spec/features/profiles/user_manages_applications_spec.rb' - './spec/features/profiles/user_manages_emails_spec.rb' - './spec/features/profiles/user_search_settings_spec.rb' - './spec/features/profiles/user_visits_notifications_tab_spec.rb' -- './spec/features/profiles/user_visits_profile_account_page_spec.rb' - './spec/features/profiles/user_visits_profile_authentication_log_spec.rb' - './spec/features/profiles/user_visits_profile_preferences_page_spec.rb' - './spec/features/profiles/user_visits_profile_spec.rb' -- './spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb' - './spec/features/project_group_variables_spec.rb' - './spec/features/projects/active_tabs_spec.rb' - './spec/features/projects/activity/rss_spec.rb' @@ -3967,7 +3836,6 @@ - './spec/features/projects/container_registry_spec.rb' - './spec/features/projects/deploy_keys_spec.rb' - './spec/features/projects/diffs/diff_show_spec.rb' -- './spec/features/projects/environments/environment_metrics_spec.rb' - './spec/features/projects/environments/environment_spec.rb' - './spec/features/projects/environments/environments_spec.rb' - './spec/features/projects/feature_flags/user_creates_feature_flag_spec.rb' @@ -4023,7 +3891,6 @@ - './spec/features/projects/integrations/user_activates_mattermost_slash_command_spec.rb' - './spec/features/projects/integrations/user_activates_packagist_spec.rb' - './spec/features/projects/integrations/user_activates_pivotaltracker_spec.rb' -- './spec/features/projects/integrations/user_activates_prometheus_spec.rb' - './spec/features/projects/integrations/user_activates_pushover_spec.rb' - './spec/features/projects/integrations/user_activates_slack_notifications_spec.rb' - './spec/features/projects/integrations/user_activates_slack_slash_command_spec.rb' @@ -4143,7 +4010,6 @@ - './spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb' - './spec/features/projects/show/user_uploads_files_spec.rb' - './spec/features/projects/snippets/create_snippet_spec.rb' -- './spec/features/projects/snippets/show_spec.rb' - './spec/features/projects/snippets/user_comments_on_snippet_spec.rb' - './spec/features/projects/snippets/user_deletes_snippet_spec.rb' - './spec/features/projects/snippets/user_updates_snippet_spec.rb' @@ -4214,7 +4080,6 @@ - './spec/features/snippets/private_snippets_spec.rb' - './spec/features/snippets/public_snippets_spec.rb' - './spec/features/snippets/search_snippets_spec.rb' -- './spec/features/snippets/show_spec.rb' - './spec/features/snippets/spam_snippets_spec.rb' - './spec/features/snippets_spec.rb' - './spec/features/snippets/user_creates_snippet_spec.rb' @@ -4237,12 +4102,10 @@ - './spec/features/user_opens_link_to_comment_spec.rb' - './spec/features/users/active_sessions_spec.rb' - './spec/features/users/add_email_to_existing_account_spec.rb' -- './spec/features/users/anonymous_sessions_spec.rb' - './spec/features/users/bizible_csp_spec.rb' - './spec/features/users/confirmation_spec.rb' - './spec/features/user_sees_revert_modal_spec.rb' - './spec/features/users/email_verification_on_login_spec.rb' -- './spec/features/users/google_analytics_csp_spec.rb' - './spec/features/users/login_spec.rb' - './spec/features/users/logout_spec.rb' - './spec/features/users/one_trust_csp_spec.rb' @@ -4338,7 +4201,6 @@ - './spec/finders/merge_requests_finder_spec.rb' - './spec/finders/merge_requests/oldest_per_commit_finder_spec.rb' - './spec/finders/merge_request_target_project_finder_spec.rb' -- './spec/finders/metrics/users_starred_dashboards_finder_spec.rb' - './spec/finders/milestones_finder_spec.rb' - './spec/finders/namespaces/projects_finder_spec.rb' - './spec/finders/notes_finder_spec.rb' @@ -4403,7 +4265,6 @@ - './spec/finders/users_finder_spec.rb' - './spec/finders/users_star_projects_finder_spec.rb' - './spec/finders/work_items/work_items_finder_spec.rb' -- './spec/frontend/fixtures/abuse_reports.rb' - './spec/frontend/fixtures/admin_users.rb' - './spec/frontend/fixtures/analytics.rb' - './spec/frontend/fixtures/api_deploy_keys.rb' @@ -4426,7 +4287,6 @@ - './spec/frontend/fixtures/listbox.rb' - './spec/frontend/fixtures/merge_requests_diffs.rb' - './spec/frontend/fixtures/merge_requests.rb' -- './spec/frontend/fixtures/metrics_dashboard.rb' - './spec/frontend/fixtures/namespaces.rb' - './spec/frontend/fixtures/pipeline_schedules.rb' - './spec/frontend/fixtures/pipelines.rb' @@ -4439,7 +4299,6 @@ - './spec/frontend/fixtures/search.rb' - './spec/frontend/fixtures/sessions.rb' - './spec/frontend/fixtures/snippet.rb' -- './spec/frontend/fixtures/startup_css.rb' - './spec/frontend/fixtures/tabs.rb' - './spec/frontend/fixtures/tags.rb' - './spec/frontend/fixtures/timezones.rb' @@ -4459,7 +4318,6 @@ - './spec/graphql/mutations/alert_management/prometheus_integration/reset_token_spec.rb' - './spec/graphql/mutations/alert_management/prometheus_integration/update_spec.rb' - './spec/graphql/mutations/alert_management/update_alert_status_spec.rb' -- './spec/graphql/mutations/base_mutation_spec.rb' - './spec/graphql/mutations/boards/issues/issue_move_list_spec.rb' - './spec/graphql/mutations/boards/lists/create_spec.rb' - './spec/graphql/mutations/boards/lists/update_spec.rb' @@ -4614,7 +4472,6 @@ - './spec/graphql/resolvers/merge_requests_count_resolver_spec.rb' - './spec/graphql/resolvers/merge_requests_resolver_spec.rb' - './spec/graphql/resolvers/metadata_resolver_spec.rb' -- './spec/graphql/resolvers/metrics/dashboard_resolver_spec.rb' - './spec/graphql/resolvers/metrics/dashboards/annotation_resolver_spec.rb' - './spec/graphql/resolvers/namespace_projects_resolver_spec.rb' - './spec/graphql/resolvers/package_details_resolver_spec.rb' @@ -4830,7 +4687,6 @@ - './spec/graphql/types/metadata/kas_type_spec.rb' - './spec/graphql/types/metadata_type_spec.rb' - './spec/graphql/types/metrics/dashboards/annotation_type_spec.rb' -- './spec/graphql/types/metrics/dashboard_type_spec.rb' - './spec/graphql/types/milestone_stats_type_spec.rb' - './spec/graphql/types/milestone_type_spec.rb' - './spec/graphql/types/mutation_type_spec.rb' @@ -5051,7 +4907,6 @@ - './spec/helpers/search_helper_spec.rb' - './spec/helpers/sessions_helper_spec.rb' - './spec/helpers/sidebars_helper_spec.rb' -- './spec/helpers/sidekiq_helper_spec.rb' - './spec/helpers/snippets_helper_spec.rb' - './spec/helpers/sorting_helper_spec.rb' - './spec/helpers/sourcegraph_helper_spec.rb' @@ -5082,7 +4937,6 @@ - './spec/helpers/wiki_helper_spec.rb' - './spec/helpers/wiki_page_version_helper_spec.rb' - './spec/helpers/x509_helper_spec.rb' -- './spec/initializers/00_rails_disable_joins_spec.rb' - './spec/initializers/0_postgresql_types_spec.rb' - './spec/initializers/100_patch_omniauth_oauth2_spec.rb' - './spec/initializers/100_patch_omniauth_saml_spec.rb' @@ -5092,7 +4946,6 @@ - './spec/initializers/action_mailer_hooks_spec.rb' - './spec/initializers/active_record_locking_spec.rb' - './spec/initializers/asset_proxy_setting_spec.rb' -- './spec/initializers/carrierwave_patch_spec.rb' - './spec/initializers/cookies_serializer_spec.rb' - './spec/initializers/database_config_spec.rb' - './spec/initializers/diagnostic_reports_spec.rb' @@ -5103,7 +4956,6 @@ - './spec/initializers/forbid_sidekiq_in_transactions_spec.rb' - './spec/initializers/global_id_spec.rb' - './spec/initializers/google_api_client_spec.rb' -- './spec/initializers/hangouts_chat_http_override_spec.rb' - './spec/initializers/lograge_spec.rb' - './spec/initializers/mail_encoding_patch_spec.rb' - './spec/initializers/mailer_retries_spec.rb' @@ -5172,7 +5024,6 @@ - './spec/lib/api/entities/user_spec.rb' - './spec/lib/api/entities/wiki_page_spec.rb' - './spec/lib/api/every_api_endpoint_spec.rb' -- './spec/lib/api/github/entities_spec.rb' - './spec/lib/api/helpers/authentication_spec.rb' - './spec/lib/api/helpers/caching_spec.rb' - './spec/lib/api/helpers/common_helpers_spec.rb' @@ -5246,12 +5097,7 @@ - './spec/lib/banzai/filter/html_entity_filter_spec.rb' - './spec/lib/banzai/filter/image_lazy_load_filter_spec.rb' - './spec/lib/banzai/filter/image_link_filter_spec.rb' -- './spec/lib/banzai/filter/inline_alert_metrics_filter_spec.rb' -- './spec/lib/banzai/filter/inline_cluster_metrics_filter_spec.rb' - './spec/lib/banzai/filter/inline_diff_filter_spec.rb' -- './spec/lib/banzai/filter/inline_grafana_metrics_filter_spec.rb' -- './spec/lib/banzai/filter/inline_metrics_filter_spec.rb' -- './spec/lib/banzai/filter/inline_metrics_redactor_filter_spec.rb' - './spec/lib/banzai/filter/issuable_reference_expansion_filter_spec.rb' - './spec/lib/banzai/filter/jira_import/adf_to_commonmark_filter_spec.rb' - './spec/lib/banzai/filter/kroki_filter_spec.rb' @@ -5363,7 +5209,6 @@ - './spec/lib/bulk_imports/common/pipelines/wiki_pipeline_spec.rb' - './spec/lib/bulk_imports/common/rest/get_badges_query_spec.rb' - './spec/lib/bulk_imports/common/transformers/prohibited_attributes_transformer_spec.rb' -- './spec/lib/bulk_imports/common/transformers/user_reference_transformer_spec.rb' - './spec/lib/bulk_imports/groups/extractors/subgroups_extractor_spec.rb' - './spec/lib/bulk_imports/groups/graphql/get_group_query_spec.rb' - './spec/lib/bulk_imports/groups/graphql/get_projects_query_spec.rb' @@ -5430,7 +5275,6 @@ - './spec/lib/feature_spec.rb' - './spec/lib/file_size_validator_spec.rb' - './spec/lib/forever_spec.rb' -- './spec/lib/generators/gitlab/snowplow_event_definition_generator_spec.rb' - './spec/lib/generators/gitlab/usage_metric_definition_generator_spec.rb' - './spec/lib/generators/gitlab/usage_metric_definition/redis_hll_generator_spec.rb' - './spec/lib/generators/gitlab/usage_metric_generator_spec.rb' @@ -5442,7 +5286,6 @@ - './spec/lib/gitlab/alert_management/fingerprint_spec.rb' - './spec/lib/gitlab/alert_management/payload/base_spec.rb' - './spec/lib/gitlab/alert_management/payload/generic_spec.rb' -- './spec/lib/gitlab/alert_management/payload/managed_prometheus_spec.rb' - './spec/lib/gitlab/alert_management/payload/prometheus_spec.rb' - './spec/lib/gitlab/alert_management/payload_spec.rb' - './spec/lib/gitlab/allowable_spec.rb' @@ -5531,14 +5374,8 @@ - './spec/lib/gitlab/auth/unique_ips_limiter_spec.rb' - './spec/lib/gitlab/auth/user_access_denied_reason_spec.rb' - './spec/lib/gitlab/avatar_cache_spec.rb' -- './spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_spec.rb' -- './spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex_spec.rb' -- './spec/lib/gitlab/background_migration/backfill_group_features_spec.rb' - './spec/lib/gitlab/background_migration/backfill_imported_issue_search_data_spec.rb' - './spec/lib/gitlab/background_migration/backfill_integrations_enable_ssl_verification_spec.rb' -- './spec/lib/gitlab/background_migration/backfill_issue_search_data_spec.rb' -- './spec/lib/gitlab/background_migration/backfill_member_namespace_for_group_members_spec.rb' -- './spec/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route_spec.rb' - './spec/lib/gitlab/background_migration/backfill_namespace_id_for_project_route_spec.rb' - './spec/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads_spec.rb' - './spec/lib/gitlab/background_migration/backfill_note_discussion_id_spec.rb' @@ -5546,20 +5383,17 @@ - './spec/lib/gitlab/background_migration/backfill_project_import_level_spec.rb' - './spec/lib/gitlab/background_migration/backfill_project_member_namespace_id_spec.rb' - './spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb' -- './spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb' - './spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb' - './spec/lib/gitlab/background_migration/backfill_topics_title_spec.rb' - './spec/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent_spec.rb' - './spec/lib/gitlab/background_migration/backfill_work_item_type_id_for_issues_spec.rb' - './spec/lib/gitlab/background_migration/base_job_spec.rb' - './spec/lib/gitlab/background_migration/batched_migration_job_spec.rb' -- './spec/lib/gitlab/background_migration/batching_strategies/backfill_project_namespace_per_group_batching_strategy_spec.rb' - './spec/lib/gitlab/background_migration/batching_strategies/backfill_project_statistics_with_container_registry_size_batching_strategy_spec.rb' - './spec/lib/gitlab/background_migration/batching_strategies/base_strategy_spec.rb' - './spec/lib/gitlab/background_migration/batching_strategies/dismissed_vulnerabilities_strategy_spec.rb' - './spec/lib/gitlab/background_migration/batching_strategies/loose_index_scan_batching_strategy_spec.rb' - './spec/lib/gitlab/background_migration/batching_strategies/primary_key_batching_strategy_spec.rb' -- './spec/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex_spec.rb' - './spec/lib/gitlab/background_migration/cleanup_orphaned_routes_spec.rb' - './spec/lib/gitlab/background_migration/copy_column_using_background_migration_job_spec.rb' - './spec/lib/gitlab/background_migration/destroy_invalid_group_members_spec.rb' @@ -5568,23 +5402,12 @@ - './spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects_spec.rb' - './spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb' - './spec/lib/gitlab/background_migration/expire_o_auth_tokens_spec.rb' -- './spec/lib/gitlab/background_migration/fix_duplicate_project_name_and_path_spec.rb' -- './spec/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata_spec.rb' - './spec/lib/gitlab/background_migration/job_coordinator_spec.rb' - './spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb' - './spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb' - './spec/lib/gitlab/background_migration/mailers/unconfirm_mailer_spec.rb' -- './spec/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner_spec.rb' -- './spec/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category_spec.rb' -- './spec/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds_spec.rb' -- './spec/lib/gitlab/background_migration/populate_container_repository_migration_plan_spec.rb' - './spec/lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations_spec.rb' -- './spec/lib/gitlab/background_migration/project_namespaces/backfill_project_namespaces_spec.rb' -- './spec/lib/gitlab/background_migration/remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb' - './spec/lib/gitlab/background_migration/remove_self_managed_wiki_notes_spec.rb' -- './spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb' -- './spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects_spec.rb' -- './spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects_spec.rb' - './spec/lib/gitlab/background_migration/reset_too_many_tags_skipped_registry_imports_spec.rb' - './spec/lib/gitlab/background_migration/set_correct_vulnerability_state_spec.rb' - './spec/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects_spec.rb' @@ -5597,7 +5420,6 @@ - './spec/lib/gitlab/bitbucket_import/importer_spec.rb' - './spec/lib/gitlab/bitbucket_import/project_creator_spec.rb' - './spec/lib/gitlab/bitbucket_import/wiki_formatter_spec.rb' -- './spec/lib/gitlab/bitbucket_server_import/importer_spec.rb' - './spec/lib/gitlab/blame_spec.rb' - './spec/lib/gitlab/blob_helper_spec.rb' - './spec/lib/gitlab/branch_push_merge_commit_analyzer_spec.rb' @@ -5622,7 +5444,6 @@ - './spec/lib/gitlab/chat/responder/mattermost_spec.rb' - './spec/lib/gitlab/chat/responder/slack_spec.rb' - './spec/lib/gitlab/chat/responder_spec.rb' -- './spec/lib/gitlab/chat_spec.rb' - './spec/lib/gitlab/checks/branch_check_spec.rb' - './spec/lib/gitlab/checks/changes_access_spec.rb' - './spec/lib/gitlab/checks/container_moved_spec.rb' @@ -5896,7 +5717,6 @@ - './spec/lib/gitlab/ci/status/build/skipped_spec.rb' - './spec/lib/gitlab/ci/status/build/stop_spec.rb' - './spec/lib/gitlab/ci/status/build/unschedule_spec.rb' -- './spec/lib/gitlab/ci/status/build/waiting_for_approval_spec.rb' - './spec/lib/gitlab/ci/status/build/waiting_for_resource_spec.rb' - './spec/lib/gitlab/ci/status/canceled_spec.rb' - './spec/lib/gitlab/ci/status/composite_spec.rb' @@ -5984,7 +5804,6 @@ - './spec/lib/gitlab/composer/version_index_spec.rb' - './spec/lib/gitlab/conan_token_spec.rb' - './spec/lib/gitlab/config_checker/external_database_checker_spec.rb' -- './spec/lib/gitlab/config_checker/puma_rugged_checker_spec.rb' - './spec/lib/gitlab/config/entry/attributable_spec.rb' - './spec/lib/gitlab/config/entry/boolean_spec.rb' - './spec/lib/gitlab/config/entry/composable_array_spec.rb' @@ -6029,9 +5848,6 @@ - './spec/lib/gitlab/database/background_migration/batched_migration_wrapper_spec.rb' - './spec/lib/gitlab/database/background_migration/batch_metrics_spec.rb' - './spec/lib/gitlab/database/background_migration/batch_optimizer_spec.rb' -- './spec/lib/gitlab/database/background_migration/health_status/indicators/autovacuum_active_on_table_spec.rb' -- './spec/lib/gitlab/database/background_migration/health_status/indicators/write_ahead_log_spec.rb' -- './spec/lib/gitlab/database/background_migration/health_status_spec.rb' - './spec/lib/gitlab/database/background_migration_job_spec.rb' - './spec/lib/gitlab/database/background_migration/prometheus_metrics_spec.rb' - './spec/lib/gitlab/database/batch_count_spec.rb' @@ -6047,9 +5863,6 @@ - './spec/lib/gitlab/database/each_database_spec.rb' - './spec/lib/gitlab/database/gitlab_schema_spec.rb' - './spec/lib/gitlab/database/grant_spec.rb' -- './spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb' -- './spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb' -- './spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb' - './spec/lib/gitlab/database_importers/work_items/base_type_importer_spec.rb' - './spec/lib/gitlab/database/load_balancing/action_cable_callbacks_spec.rb' - './spec/lib/gitlab/database/load_balancing/configuration_spec.rb' @@ -6116,7 +5929,6 @@ - './spec/lib/gitlab/database/postgres_partitioned_table_spec.rb' - './spec/lib/gitlab/database/postgres_partition_spec.rb' - './spec/lib/gitlab/database/postgresql_adapter/dump_schema_versions_mixin_spec.rb' -- './spec/lib/gitlab/database/postgresql_adapter/empty_query_ping_spec.rb' - './spec/lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin_spec.rb' - './spec/lib/gitlab/database/postgresql_adapter/type_map_cache_spec.rb' - './spec/lib/gitlab/database/postgresql_database_tasks/load_schema_versions_mixin_spec.rb' @@ -6132,10 +5944,6 @@ - './spec/lib/gitlab/database/reindexing/reindex_action_spec.rb' - './spec/lib/gitlab/database/reindexing/reindex_concurrently_spec.rb' - './spec/lib/gitlab/database/reindexing_spec.rb' -- './spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb' -- './spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb' -- './spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb' -- './spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb' - './spec/lib/gitlab/database/schema_cache_with_renamed_table_spec.rb' - './spec/lib/gitlab/database/schema_cleaner_spec.rb' - './spec/lib/gitlab/database/schema_migrations/context_spec.rb' @@ -6354,11 +6162,7 @@ - './spec/lib/gitlab/github_import/importer/note_importer_spec.rb' - './spec/lib/gitlab/github_import/importer/notes_importer_spec.rb' - './spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb' -- './spec/lib/gitlab/github_import/importer/pull_request_merged_by_importer_spec.rb' -- './spec/lib/gitlab/github_import/importer/pull_request_review_importer_spec.rb' - './spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb' -- './spec/lib/gitlab/github_import/importer/pull_requests_merged_by_importer_spec.rb' -- './spec/lib/gitlab/github_import/importer/pull_requests_reviews_importer_spec.rb' - './spec/lib/gitlab/github_import/importer/releases_importer_spec.rb' - './spec/lib/gitlab/github_import/importer/repository_importer_spec.rb' - './spec/lib/gitlab/github_import/importer/single_endpoint_diff_notes_importer_spec.rb' @@ -6406,7 +6210,6 @@ - './spec/lib/gitlab/git/remote_mirror_spec.rb' - './spec/lib/gitlab/git/repository_cleaner_spec.rb' - './spec/lib/gitlab/git/repository_spec.rb' -- './spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb' - './spec/lib/gitlab/git_spec.rb' - './spec/lib/gitlab/git/tag_spec.rb' - './spec/lib/gitlab/git/tree_spec.rb' @@ -6471,7 +6274,6 @@ - './spec/lib/gitlab/harbor/client_spec.rb' - './spec/lib/gitlab/harbor/query_spec.rb' - './spec/lib/gitlab/hashed_path_spec.rb' -- './spec/lib/gitlab/hashed_storage/migrator_spec.rb' - './spec/lib/gitlab/health_checks/db_check_spec.rb' - './spec/lib/gitlab/health_checks/gitaly_check_spec.rb' - './spec/lib/gitlab/health_checks/master_check_spec.rb' @@ -6535,7 +6337,6 @@ - './spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb' - './spec/lib/gitlab/import_export/json/ndjson_writer_spec.rb' - './spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb' -- './spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb' - './spec/lib/gitlab/import_export/lfs_restorer_spec.rb' - './spec/lib/gitlab/import_export/lfs_saver_spec.rb' - './spec/lib/gitlab/import_export/log_util_spec.rb' @@ -6600,7 +6401,6 @@ - './spec/lib/gitlab/jira_import/labels_importer_spec.rb' - './spec/lib/gitlab/jira_import/metadata_collector_spec.rb' - './spec/lib/gitlab/jira_import_spec.rb' -- './spec/lib/gitlab/jira/middleware_spec.rb' - './spec/lib/gitlab/job_waiter_spec.rb' - './spec/lib/gitlab/json_logger_spec.rb' - './spec/lib/gitlab/json_spec.rb' @@ -6685,27 +6485,6 @@ - './spec/lib/gitlab/merge_requests/mergeability/results_store_spec.rb' - './spec/lib/gitlab/metrics/background_transaction_spec.rb' - './spec/lib/gitlab/metrics/boot_time_tracker_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/cache_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/defaults_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/finder_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/importer_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/importers/prometheus_metrics_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/processor_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/repo_dashboard_finder_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/stages/grafana_formatter_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/stages/metric_endpoint_inserter_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/stages/track_panel_type_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/stages/url_validator_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/stages/variable_endpoint_inserter_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/transformers/yml/v1/prometheus_metrics_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/url_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/validator/client_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/validator/custom_formats_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/validator/errors_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/validator/post_schema_validator_spec.rb' -- './spec/lib/gitlab/metrics/dashboard/validator_spec.rb' - './spec/lib/gitlab/metrics/delta_spec.rb' - './spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb' - './spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb' @@ -6767,7 +6546,6 @@ - './spec/lib/gitlab/optimistic_locking_spec.rb' - './spec/lib/gitlab/other_markup_spec.rb' - './spec/lib/gitlab/otp_key_rotator_spec.rb' -- './spec/lib/gitlab/pages/cache_control_spec.rb' - './spec/lib/gitlab/pages/deployment_update_spec.rb' - './spec/lib/gitlab/pages/settings_spec.rb' - './spec/lib/gitlab/pages_spec.rb' @@ -6794,7 +6572,6 @@ - './spec/lib/gitlab/pagination/offset_header_builder_spec.rb' - './spec/lib/gitlab/pagination/offset_header_builder_with_controller_spec.rb' - './spec/lib/gitlab/pagination/offset_pagination_spec.rb' -- './spec/lib/gitlab/patch/action_cable_redis_listener_spec.rb' - './spec/lib/gitlab/patch/database_config_spec.rb' - './spec/lib/gitlab/patch/draw_route_spec.rb' - './spec/lib/gitlab/patch/prependable_spec.rb' @@ -6818,16 +6595,8 @@ - './spec/lib/gitlab/project_template_spec.rb' - './spec/lib/gitlab/project_transfer_spec.rb' - './spec/lib/gitlab/prometheus/adapter_spec.rb' -- './spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb' - './spec/lib/gitlab/prometheus_client_spec.rb' - './spec/lib/gitlab/prometheus/internal_spec.rb' -- './spec/lib/gitlab/prometheus/metric_group_spec.rb' -- './spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb' -- './spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb' -- './spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb' -- './spec/lib/gitlab/prometheus/queries/matched_metric_query_spec.rb' -- './spec/lib/gitlab/prometheus/queries/validate_query_spec.rb' -- './spec/lib/gitlab/prometheus/query_variables_spec.rb' - './spec/lib/gitlab/protocol_access_spec.rb' - './spec/lib/gitlab/puma_logging/json_formatter_spec.rb' - './spec/lib/gitlab/push_options_spec.rb' @@ -6880,7 +6649,6 @@ - './spec/lib/gitlab/robots_txt/parser_spec.rb' - './spec/lib/gitlab/route_map_spec.rb' - './spec/lib/gitlab/routing_spec.rb' -- './spec/lib/gitlab/rugged_instrumentation_spec.rb' - './spec/lib/gitlab/runtime_spec.rb' - './spec/lib/gitlab/saas_spec.rb' - './spec/lib/gitlab/safe_request_loader_spec.rb' @@ -6918,7 +6686,6 @@ - './spec/lib/gitlab/sidekiq_config/worker_matcher_spec.rb' - './spec/lib/gitlab/sidekiq_config/worker_router_spec.rb' - './spec/lib/gitlab/sidekiq_config/worker_spec.rb' -- './spec/lib/gitlab/sidekiq_daemon/memory_killer_spec.rb' - './spec/lib/gitlab/sidekiq_daemon/monitor_spec.rb' - './spec/lib/gitlab/sidekiq_death_handler_spec.rb' - './spec/lib/gitlab/sidekiq_logging/deduplication_logger_spec.rb' @@ -7006,7 +6773,6 @@ - './spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb' - './spec/lib/gitlab/template/issue_template_spec.rb' - './spec/lib/gitlab/template/merge_request_template_spec.rb' -- './spec/lib/gitlab/template/metrics_dashboard_template_spec.rb' - './spec/lib/gitlab/template_parser/ast_spec.rb' - './spec/lib/gitlab/template_parser/parser_spec.rb' - './spec/lib/gitlab/terraform_registry_token_spec.rb' @@ -7104,7 +6870,6 @@ - './spec/lib/gitlab/verify/job_artifacts_spec.rb' - './spec/lib/gitlab/verify/lfs_objects_spec.rb' - './spec/lib/gitlab/verify/uploads_spec.rb' -- './spec/lib/gitlab/version_info_spec.rb' - './spec/lib/gitlab/view/presenter/base_spec.rb' - './spec/lib/gitlab/view/presenter/delegated_spec.rb' - './spec/lib/gitlab/view/presenter/factory_spec.rb' @@ -7164,9 +6929,7 @@ - './spec/lib/peek/views/external_http_spec.rb' - './spec/lib/peek/views/memory_spec.rb' - './spec/lib/peek/views/redis_detailed_spec.rb' -- './spec/lib/peek/views/rugged_spec.rb' - './spec/lib/product_analytics/event_params_spec.rb' -- './spec/lib/product_analytics/tracker_spec.rb' - './spec/lib/prometheus/cleanup_multiproc_dir_service_spec.rb' - './spec/lib/prometheus/pid_provider_spec.rb' - './spec/lib/quality/seeders/issues_spec.rb' @@ -7254,75 +7017,7 @@ - './spec/mailers/notify_spec.rb' - './spec/mailers/repository_check_mailer_spec.rb' - './spec/metrics_server/metrics_server_spec.rb' -- './spec/migrations/20220315171129_cleanup_draft_data_from_faulty_regex_spec.rb' -- './spec/migrations/20220316202640_populate_container_repositories_migration_plan_spec.rb' -- './spec/migrations/20220321234317_remove_all_issuable_escalation_statuses_spec.rb' -- './spec/migrations/20220322132242_update_pages_onboarding_state_spec.rb' -- './spec/migrations/20220324032250_migrate_shimo_confluence_service_category_spec.rb' -- './spec/migrations/20220324165436_schedule_backfill_project_settings_spec.rb' -- './spec/migrations/20220329175119_remove_leftover_ci_job_artifact_deletions_spec.rb' -- './spec/migrations/20220331133802_schedule_backfill_topics_title_spec.rb' -- './spec/migrations/20220412143552_consume_remaining_encrypt_integration_property_jobs_spec.rb' -- './spec/migrations/20220416054011_schedule_backfill_project_member_namespace_id_spec.rb' -- './spec/migrations/20220420135946_update_batched_background_migration_arguments_spec.rb' -- './spec/migrations/20220426185933_backfill_deployments_finished_at_spec.rb' -- './spec/migrations/20220502015011_clean_up_fix_merge_request_diff_commit_users_spec.rb' -- './spec/migrations/20220502173045_reset_too_many_tags_skipped_registry_imports_spec.rb' -- './spec/migrations/20220503035221_add_gitlab_schema_to_batched_background_migrations_spec.rb' -- './spec/migrations/20220505044348_fix_automatic_iterations_cadences_start_date_spec.rb' -- './spec/migrations/20220505174658_update_index_on_alerts_to_exclude_null_fingerprints_spec.rb' -- './spec/migrations/20220506154054_create_sync_namespace_details_trigger_spec.rb' -- './spec/migrations/20220512190659_remove_web_hooks_web_hook_logs_web_hook_id_fk_spec.rb' -- './spec/migrations/20220513043344_reschedule_expire_o_auth_tokens_spec.rb' -- './spec/migrations/20220523171107_drop_deploy_tokens_token_column_spec.rb' -- './spec/migrations/20220524074947_finalize_backfill_null_note_discussion_ids_spec.rb' -- './spec/migrations/20220524184149_create_sync_project_namespace_details_trigger_spec.rb' -- './spec/migrations/20220525221133_schedule_backfill_vulnerability_reads_cluster_agent_spec.rb' -- './spec/migrations/20220601110011_schedule_remove_self_managed_wiki_notes_spec.rb' -- './spec/migrations/20220601152916_add_user_id_and_ip_address_success_index_to_authentication_events_spec.rb' -- './spec/migrations/20220606082910_add_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb' -- './spec/migrations/20220607082910_add_sync_tmp_index_for_potentially_misassociated_vulnerability_occurrences_spec.rb' -- './spec/migrations/20220620132300_update_last_run_date_for_iterations_cadences_spec.rb' -- './spec/migrations/20220622080547_backfill_project_statistics_with_container_registry_size_spec.rb' -- './spec/migrations/20220627090231_schedule_disable_legacy_open_source_license_for_inactive_public_projects_spec.rb' -- './spec/migrations/20220627152642_queue_update_delayed_project_removal_to_null_for_user_namespace_spec.rb' -- './spec/migrations/20220628012902_finalise_project_namespace_members_spec.rb' -- './spec/migrations/20220715163254_update_notes_in_past_spec.rb' -- './spec/migrations/20220721031446_schedule_disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb' -- './spec/migrations/20220722084543_schedule_disable_legacy_open_source_license_for_no_issues_no_repo_projects_spec.rb' -- './spec/migrations/20220722110026_reschedule_set_legacy_open_source_license_available_for_non_public_projects_spec.rb' -- './spec/migrations/20220725150127_update_jira_tracker_data_deployment_type_based_on_url_spec.rb' -- './spec/migrations/20220801155858_schedule_disable_legacy_open_source_licence_for_recent_public_projects_spec.rb' -- './spec/migrations/20220802114351_reschedule_backfill_container_registry_size_into_project_statistics_spec.rb' -- './spec/migrations/20220802204737_remove_deactivated_user_highest_role_stats_spec.rb' - './spec/migrations/active_record/schema_spec.rb' -- './spec/migrations/add_epics_relative_position_spec.rb' -- './spec/migrations/add_web_hook_calls_to_plan_limits_paid_tiers_spec.rb' -- './spec/migrations/backfill_integrations_enable_ssl_verification_spec.rb' -- './spec/migrations/backfill_namespace_id_for_project_routes_spec.rb' -- './spec/migrations/backfill_project_import_level_spec.rb' -- './spec/migrations/bulk_insert_cluster_enabled_grants_spec.rb' -- './spec/migrations/change_public_projects_cost_factor_spec.rb' -- './spec/migrations/cleanup_after_fixing_issue_when_admin_changed_primary_email_spec.rb' -- './spec/migrations/cleanup_after_fixing_regression_with_new_users_emails_spec.rb' -- './spec/migrations/cleanup_backfill_integrations_enable_ssl_verification_spec.rb' -- './spec/migrations/cleanup_mr_attention_request_todos_spec.rb' -- './spec/migrations/cleanup_orphaned_routes_spec.rb' -- './spec/migrations/finalize_orphaned_routes_cleanup_spec.rb' -- './spec/migrations/finalize_project_namespaces_backfill_spec.rb' -- './spec/migrations/finalize_routes_backfilling_for_projects_spec.rb' -- './spec/migrations/fix_and_backfill_project_namespaces_for_projects_with_duplicate_name_spec.rb' -- './spec/migrations/populate_operation_visibility_permissions_spec.rb' -- './spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb' -- './spec/migrations/remove_invalid_integrations_spec.rb' -- './spec/migrations/remove_wiki_notes_spec.rb' -- './spec/migrations/reschedule_backfill_imported_issue_search_data_spec.rb' -- './spec/migrations/schedule_backfill_draft_status_on_merge_requests_corrected_regex_spec.rb' -- './spec/migrations/schedule_backfilling_the_namespace_id_for_vulnerability_reads_spec.rb' -- './spec/migrations/schedule_populate_requirements_issue_id_spec.rb' -- './spec/migrations/schedule_purging_stale_security_scans_spec.rb' -- './spec/migrations/schedule_set_correct_vulnerability_state_spec.rb' -- './spec/migrations/toggle_vsa_aggregations_enable_spec.rb' - './spec/models/ability_spec.rb' - './spec/models/abuse_report_spec.rb' - './spec/models/active_session_spec.rb' @@ -7361,7 +7056,6 @@ - './spec/models/blob_viewer/go_mod_spec.rb' - './spec/models/blob_viewer/license_spec.rb' - './spec/models/blob_viewer/markup_spec.rb' -- './spec/models/blob_viewer/metrics_dashboard_yml_spec.rb' - './spec/models/blob_viewer/package_json_spec.rb' - './spec/models/blob_viewer/podspec_json_spec.rb' - './spec/models/blob_viewer/podspec_spec.rb' @@ -7530,7 +7224,6 @@ - './spec/models/concerns/project_api_compatibility_spec.rb' - './spec/models/concerns/project_features_compatibility_spec.rb' - './spec/models/concerns/prometheus_adapter_spec.rb' -- './spec/models/concerns/protected_ref_access_spec.rb' - './spec/models/concerns/reactive_caching_spec.rb' - './spec/models/concerns/redactable_spec.rb' - './spec/models/concerns/redis_cacheable_spec.rb' @@ -7615,7 +7308,6 @@ - './spec/models/event_spec.rb' - './spec/models/exported_protected_branch_spec.rb' - './spec/models/external_issue_spec.rb' -- './spec/models/external_pull_request_spec.rb' - './spec/models/fork_network_member_spec.rb' - './spec/models/fork_network_spec.rb' - './spec/models/generic_commit_status_spec.rb' @@ -7745,8 +7437,6 @@ - './spec/models/merge_request/metrics_spec.rb' - './spec/models/merge_request_reviewer_spec.rb' - './spec/models/merge_request_spec.rb' -- './spec/models/metrics/dashboard/annotation_spec.rb' -- './spec/models/metrics/users_starred_dashboard_spec.rb' - './spec/models/milestone_note_spec.rb' - './spec/models/milestone_release_spec.rb' - './spec/models/milestone_spec.rb' @@ -7818,10 +7508,6 @@ - './spec/models/pages_domain_spec.rb' - './spec/models/pages/lookup_path_spec.rb' - './spec/models/pages/virtual_domain_spec.rb' -- './spec/models/performance_monitoring/prometheus_dashboard_spec.rb' -- './spec/models/performance_monitoring/prometheus_metric_spec.rb' -- './spec/models/performance_monitoring/prometheus_panel_group_spec.rb' -- './spec/models/performance_monitoring/prometheus_panel_spec.rb' - './spec/models/personal_access_token_spec.rb' - './spec/models/personal_snippet_spec.rb' - './spec/models/plan_limits_spec.rb' @@ -7847,13 +7533,10 @@ - './spec/models/project_deploy_token_spec.rb' - './spec/models/project_export_job_spec.rb' - './spec/models/project_feature_spec.rb' -- './spec/models/project_feature_usage_spec.rb' - './spec/models/project_group_link_spec.rb' - './spec/models/project_import_data_spec.rb' - './spec/models/project_import_state_spec.rb' - './spec/models/project_label_spec.rb' -- './spec/models/project_metrics_setting_spec.rb' -- './spec/models/project_pages_metadatum_spec.rb' - './spec/models/project_repository_spec.rb' - './spec/models/projects/build_artifacts_size_refresh_spec.rb' - './spec/models/projects/ci_feature_usage_spec.rb' @@ -7922,7 +7605,6 @@ - './spec/models/token_with_iv_spec.rb' - './spec/models/tree_spec.rb' - './spec/models/trending_project_spec.rb' -- './spec/models/u2f_registration_spec.rb' - './spec/models/uploads/fog_spec.rb' - './spec/models/uploads/local_spec.rb' - './spec/models/upload_spec.rb' @@ -8005,7 +7687,6 @@ - './spec/policies/issuable_policy_spec.rb' - './spec/policies/issue_policy_spec.rb' - './spec/policies/merge_request_policy_spec.rb' -- './spec/policies/metrics/dashboard/annotation_policy_spec.rb' - './spec/policies/namespace/root_storage_statistics_policy_spec.rb' - './spec/policies/namespaces/project_namespace_policy_spec.rb' - './spec/policies/namespaces/user_namespace_policy_spec.rb' @@ -8064,7 +7745,6 @@ - './spec/presenters/packages/conan/package_presenter_spec.rb' - './spec/presenters/packages/detail/package_presenter_spec.rb' - './spec/presenters/packages/helm/index_presenter_spec.rb' -- './spec/presenters/packages/npm/package_presenter_spec.rb' - './spec/presenters/packages/nuget/package_metadata_presenter_spec.rb' - './spec/presenters/packages/nuget/packages_metadata_presenter_spec.rb' - './spec/presenters/packages/nuget/packages_versions_presenter_spec.rb' @@ -8214,8 +7894,6 @@ - './spec/requests/api/graphql/issue_status_counts_spec.rb' - './spec/requests/api/graphql/merge_request/merge_request_spec.rb' - './spec/requests/api/graphql/metadata_query_spec.rb' -- './spec/requests/api/graphql/metrics/dashboard/annotations_spec.rb' -- './spec/requests/api/graphql/metrics/dashboard_query_spec.rb' - './spec/requests/api/graphql/milestone_spec.rb' - './spec/requests/api/graphql/multiplexed_queries_spec.rb' - './spec/requests/api/graphql/mutations/admin/sidekiq_queues/delete_jobs_spec.rb' @@ -8342,7 +8020,6 @@ - './spec/requests/api/graphql/packages/pypi_spec.rb' - './spec/requests/api/graphql/project/alert_management/alert/assignees_spec.rb' - './spec/requests/api/graphql/project/alert_management/alert/issue_spec.rb' -- './spec/requests/api/graphql/project/alert_management/alert/metrics_dashboard_url_spec.rb' - './spec/requests/api/graphql/project/alert_management/alert/notes_spec.rb' - './spec/requests/api/graphql/project/alert_management/alerts_spec.rb' - './spec/requests/api/graphql/project/alert_management/alert_status_counts_spec.rb' @@ -8520,7 +8197,6 @@ - './spec/requests/api/user_counts_spec.rb' - './spec/requests/api/users_preferences_spec.rb' - './spec/requests/api/users_spec.rb' -- './spec/requests/api/v3/github_spec.rb' - './spec/requests/api/wikis_spec.rb' - './spec/requests/concerns/planning_hierarchy_spec.rb' - './spec/requests/content_security_policy_spec.rb' @@ -8544,7 +8220,6 @@ - './spec/requests/import/gitlab_groups_controller_spec.rb' - './spec/requests/import/gitlab_projects_controller_spec.rb' - './spec/requests/import/url_controller_spec.rb' -- './spec/requests/jira_authorizations_spec.rb' - './spec/requests/jira_connect/installations_controller_spec.rb' - './spec/requests/jira_connect/oauth_application_ids_controller_spec.rb' - './spec/requests/jira_connect/oauth_callbacks_controller_spec.rb' @@ -8588,9 +8263,6 @@ - './spec/requests/projects/merge_requests/diffs_spec.rb' - './spec/requests/projects/merge_requests_discussions_spec.rb' - './spec/requests/projects/merge_requests_spec.rb' -- './spec/requests/projects/metrics/dashboards/builder_spec.rb' -- './spec/requests/projects/metrics_dashboard_spec.rb' -- './spec/requests/projects/noteable_notes_spec.rb' - './spec/requests/projects/pipelines_controller_spec.rb' - './spec/requests/projects/redirect_controller_spec.rb' - './spec/requests/projects/releases_controller_spec.rb' @@ -8786,7 +8458,6 @@ - './spec/serializers/project_mirror_serializer_spec.rb' - './spec/serializers/project_note_entity_spec.rb' - './spec/serializers/project_serializer_spec.rb' -- './spec/serializers/prometheus_alert_entity_spec.rb' - './spec/serializers/release_serializer_spec.rb' - './spec/serializers/remote_mirror_entity_spec.rb' - './spec/serializers/request_aware_entity_spec.rb' @@ -8861,7 +8532,6 @@ - './spec/services/branches/validate_new_service_spec.rb' - './spec/services/bulk_create_integration_service_spec.rb' - './spec/services/bulk_imports/archive_extraction_service_spec.rb' -- './spec/services/bulk_imports/create_pipeline_trackers_service_spec.rb' - './spec/services/bulk_imports/create_service_spec.rb' - './spec/services/bulk_imports/export_service_spec.rb' - './spec/services/bulk_imports/file_decompression_service_spec.rb' @@ -9028,10 +8698,8 @@ - './spec/services/dependency_proxy/request_token_service_spec.rb' - './spec/services/deploy_keys/create_service_spec.rb' - './spec/services/deployments/archive_in_project_service_spec.rb' -- './spec/services/deployments/create_for_build_service_spec.rb' - './spec/services/deployments/create_service_spec.rb' - './spec/services/deployments/link_merge_requests_service_spec.rb' -- './spec/services/deployments/older_deployments_drop_service_spec.rb' - './spec/services/deployments/update_environment_service_spec.rb' - './spec/services/deployments/update_service_spec.rb' - './spec/services/design_management/copy_design_collection/copy_service_spec.rb' @@ -9089,7 +8757,6 @@ - './spec/services/google_cloud/setup_cloudsql_instance_service_spec.rb' - './spec/services/gpg_keys/create_service_spec.rb' - './spec/services/gpg_keys/destroy_service_spec.rb' -- './spec/services/grafana/proxy_service_spec.rb' - './spec/services/gravatar_service_spec.rb' - './spec/services/groups/autocomplete_service_spec.rb' - './spec/services/groups/auto_devops_service_spec.rb' @@ -9212,7 +8879,6 @@ - './spec/services/merge_requests/delete_non_latest_diffs_service_spec.rb' - './spec/services/merge_requests/execute_approval_hooks_service_spec.rb' - './spec/services/merge_requests/export_csv_service_spec.rb' -- './spec/services/merge_requests/ff_merge_service_spec.rb' - './spec/services/merge_requests/get_urls_service_spec.rb' - './spec/services/merge_requests/handle_assignees_change_service_spec.rb' - './spec/services/merge_requests/link_lfs_objects_service_spec.rb' @@ -9246,25 +8912,6 @@ - './spec/services/merge_requests/update_assignees_service_spec.rb' - './spec/services/merge_requests/update_reviewers_service_spec.rb' - './spec/services/merge_requests/update_service_spec.rb' -- './spec/services/metrics/dashboard/annotations/create_service_spec.rb' -- './spec/services/metrics/dashboard/annotations/delete_service_spec.rb' -- './spec/services/metrics/dashboard/clone_dashboard_service_spec.rb' -- './spec/services/metrics/dashboard/cluster_dashboard_service_spec.rb' -- './spec/services/metrics/dashboard/cluster_metrics_embed_service_spec.rb' -- './spec/services/metrics/dashboard/custom_dashboard_service_spec.rb' -- './spec/services/metrics/dashboard/custom_metric_embed_service_spec.rb' -- './spec/services/metrics/dashboard/default_embed_service_spec.rb' -- './spec/services/metrics/dashboard/dynamic_embed_service_spec.rb' -- './spec/services/metrics/dashboard/gitlab_alert_embed_service_spec.rb' -- './spec/services/metrics/dashboard/grafana_metric_embed_service_spec.rb' -- './spec/services/metrics/dashboard/panel_preview_service_spec.rb' -- './spec/services/metrics/dashboard/pod_dashboard_service_spec.rb' -- './spec/services/metrics/dashboard/system_dashboard_service_spec.rb' -- './spec/services/metrics/dashboard/transient_embed_service_spec.rb' -- './spec/services/metrics/dashboard/update_dashboard_service_spec.rb' -- './spec/services/metrics/sample_metrics_service_spec.rb' -- './spec/services/metrics/users_starred_dashboards/create_service_spec.rb' -- './spec/services/metrics/users_starred_dashboards/delete_service_spec.rb' - './spec/services/milestones/closed_issues_count_service_spec.rb' - './spec/services/milestones/close_service_spec.rb' - './spec/services/milestones/create_service_spec.rb' @@ -9310,11 +8957,9 @@ - './spec/services/packages/debian/extract_deb_metadata_service_spec.rb' - './spec/services/packages/debian/extract_metadata_service_spec.rb' - './spec/services/packages/debian/find_or_create_incoming_service_spec.rb' -- './spec/services/packages/debian/find_or_create_package_service_spec.rb' - './spec/services/packages/debian/generate_distribution_key_service_spec.rb' - './spec/services/packages/debian/generate_distribution_service_spec.rb' - './spec/services/packages/debian/parse_debian822_service_spec.rb' -- './spec/services/packages/debian/process_changes_service_spec.rb' - './spec/services/packages/debian/sign_distribution_service_spec.rb' - './spec/services/packages/debian/update_distribution_service_spec.rb' - './spec/services/packages/generic/create_package_file_service_spec.rb' @@ -9353,7 +8998,6 @@ - './spec/services/pages_domains/create_acme_order_service_spec.rb' - './spec/services/pages_domains/obtain_lets_encrypt_certificate_service_spec.rb' - './spec/services/pages_domains/retry_acme_order_service_spec.rb' -- './spec/services/pages/zip_directory_service_spec.rb' - './spec/services/personal_access_tokens/create_service_spec.rb' - './spec/services/personal_access_tokens/last_used_service_spec.rb' - './spec/services/personal_access_tokens/revoke_service_spec.rb' @@ -9395,7 +9039,6 @@ - './spec/services/projects/group_links/update_service_spec.rb' - './spec/services/projects/hashed_storage/base_attachment_service_spec.rb' - './spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb' -- './spec/services/projects/hashed_storage/migrate_repository_service_spec.rb' - './spec/services/projects/hashed_storage/migration_service_spec.rb' - './spec/services/projects/import_error_filter_spec.rb' - './spec/services/projects/import_export/export_service_spec.rb' @@ -9435,8 +9078,6 @@ - './spec/services/projects/update_repository_storage_service_spec.rb' - './spec/services/projects/update_service_spec.rb' - './spec/services/projects/update_statistics_service_spec.rb' -- './spec/services/prometheus/proxy_service_spec.rb' -- './spec/services/prometheus/proxy_variable_substitution_service_spec.rb' - './spec/services/protected_branches/cache_service_spec.rb' - './spec/services/protected_branches/create_service_spec.rb' - './spec/services/protected_branches/destroy_service_spec.rb' @@ -9560,7 +9201,6 @@ - './spec/services/users/saved_replies/destroy_service_spec.rb' - './spec/services/users/saved_replies/update_service_spec.rb' - './spec/services/users/set_status_service_spec.rb' -- './spec/services/users/signup_service_spec.rb' - './spec/services/users/unban_service_spec.rb' - './spec/services/users/update_canonical_email_service_spec.rb' - './spec/services/users/update_highest_member_role_service_spec.rb' @@ -9614,8 +9254,6 @@ - './spec/support_specs/matchers/be_sorted_spec.rb' - './spec/support_specs/matchers/exceed_query_limit_helpers_spec.rb' - './spec/tasks/admin_mode_spec.rb' -- './spec/tasks/cache/clear/redis_spec.rb' -- './spec/tasks/config_lint_spec.rb' - './spec/tasks/dev_rake_spec.rb' - './spec/tasks/gitlab/artifacts/check_rake_spec.rb' - './spec/tasks/gitlab/artifacts/migrate_rake_spec.rb' @@ -9630,13 +9268,11 @@ - './spec/tasks/gitlab/db/validate_config_rake_spec.rb' - './spec/tasks/gitlab/dependency_proxy/migrate_rake_spec.rb' - './spec/tasks/gitlab/external_diffs_rake_spec.rb' -- './spec/tasks/gitlab/generate_sample_prometheus_data_spec.rb' - './spec/tasks/gitlab/gitaly_rake_spec.rb' - './spec/tasks/gitlab/git_rake_spec.rb' - './spec/tasks/gitlab/ldap_rake_spec.rb' - './spec/tasks/gitlab/lfs/check_rake_spec.rb' - './spec/tasks/gitlab/lfs/migrate_rake_spec.rb' -- './spec/tasks/gitlab/packages/events_rake_spec.rb' - './spec/tasks/gitlab/packages/migrate_rake_spec.rb' - './spec/tasks/gitlab/pages_rake_spec.rb' - './spec/tasks/gitlab/password_rake_spec.rb' @@ -9648,7 +9284,6 @@ - './spec/tasks/gitlab/sidekiq_rake_spec.rb' - './spec/tasks/gitlab/smtp_rake_spec.rb' - './spec/tasks/gitlab/snippets_rake_spec.rb' -- './spec/tasks/gitlab/task_helpers_spec.rb' - './spec/tasks/gitlab/terraform/migrate_rake_spec.rb' - './spec/tasks/gitlab/update_templates_rake_spec.rb' - './spec/tasks/gitlab/uploads/check_rake_spec.rb' @@ -9660,14 +9295,6 @@ - './spec/tasks/gitlab/x509/update_rake_spec.rb' - './spec/tasks/migrate/schema_check_rake_spec.rb' - './spec/tasks/rubocop_rake_spec.rb' -- './spec/tasks/tokens_spec.rb' -- './spec/tooling/danger/customer_success_spec.rb' -- './spec/tooling/danger/datateam_spec.rb' -- './spec/tooling/danger/feature_flag_spec.rb' -- './spec/tooling/danger/analytics_instrumentation_spec.rb' -- './spec/tooling/danger/project_helper_spec.rb' -- './spec/tooling/danger/sidekiq_queues_spec.rb' -- './spec/tooling/danger/specs_spec.rb' - './spec/tooling/docs/deprecation_handling_spec.rb' - './spec/tooling/graphql/docs/renderer_spec.rb' - './spec/tooling/lib/tooling/crystalball/coverage_lines_execution_detector_spec.rb' @@ -9817,7 +9444,6 @@ - './spec/views/projects/hooks/edit.html.haml_spec.rb' - './spec/views/projects/hooks/index.html.haml_spec.rb' - './spec/views/projects/imports/new.html.haml_spec.rb' -- './spec/views/projects/issues/_issue.html.haml_spec.rb' - './spec/views/projects/issues/_related_branches.html.haml_spec.rb' - './spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb' - './spec/views/projects/issues/show.html.haml_spec.rb' @@ -9832,7 +9458,6 @@ - './spec/views/projects/pages_domains/show.html.haml_spec.rb' - './spec/views/projects/pages/new.html.haml_spec.rb' - './spec/views/projects/pages/show.html.haml_spec.rb' -- './spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb' - './spec/views/projects/pipelines/show.html.haml_spec.rb' - './spec/views/projects/project_members/index.html.haml_spec.rb' - './spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb' @@ -9840,7 +9465,6 @@ - './spec/views/projects/settings/operations/show.html.haml_spec.rb' - './spec/views/projects/tags/index.html.haml_spec.rb' - './spec/views/projects/tree/show.html.haml_spec.rb' -- './spec/views/registrations/welcome/show.html.haml_spec.rb' - './spec/views/search/_results.html.haml_spec.rb' - './spec/views/search/show.html.haml_spec.rb' - './spec/views/shared/groups/_dropdown.html.haml_spec.rb' @@ -9851,7 +9475,6 @@ - './spec/views/shared/_milestones_sort_dropdown.html.haml_spec.rb' - './spec/views/shared/milestones/_top.html.haml_spec.rb' - './spec/views/shared/nav/_sidebar.html.haml_spec.rb' -- './spec/views/shared/notes/_form.html.haml_spec.rb' - './spec/views/shared/projects/_inactive_project_deletion_alert.html.haml_spec.rb' - './spec/views/shared/projects/_list.html.haml_spec.rb' - './spec/views/shared/projects/_project.html.haml_spec.rb' @@ -9875,7 +9498,6 @@ - './spec/workers/background_migration_worker_spec.rb' - './spec/workers/build_hooks_worker_spec.rb' - './spec/workers/build_queue_worker_spec.rb' -- './spec/workers/build_success_worker_spec.rb' - './spec/workers/bulk_imports/entity_worker_spec.rb' - './spec/workers/bulk_imports/export_request_worker_spec.rb' - './spec/workers/bulk_imports/pipeline_worker_spec.rb' @@ -9924,21 +9546,18 @@ - './spec/workers/clusters/applications/deactivate_integration_worker_spec.rb' - './spec/workers/clusters/cleanup/project_namespace_worker_spec.rb' - './spec/workers/clusters/cleanup/service_account_worker_spec.rb' -- './spec/workers/clusters/integrations/check_prometheus_health_worker_spec.rb' - './spec/workers/concerns/application_worker_spec.rb' - './spec/workers/concerns/cluster_agent_queue_spec.rb' - './spec/workers/concerns/cronjob_queue_spec.rb' - './spec/workers/concerns/gitlab/github_import/object_importer_spec.rb' - './spec/workers/concerns/gitlab/github_import/rescheduling_methods_spec.rb' - './spec/workers/concerns/gitlab/github_import/stage_methods_spec.rb' -- './spec/workers/concerns/gitlab/notify_upon_death_spec.rb' - './spec/workers/concerns/limited_capacity/job_tracker_spec.rb' - './spec/workers/concerns/limited_capacity/worker_spec.rb' - './spec/workers/concerns/packages/cleanup_artifact_worker_spec.rb' - './spec/workers/concerns/project_import_options_spec.rb' - './spec/workers/concerns/reenqueuer_spec.rb' - './spec/workers/concerns/repository_check_queue_spec.rb' -- './spec/workers/concerns/waitable_worker_spec.rb' - './spec/workers/concerns/worker_attributes_spec.rb' - './spec/workers/concerns/worker_context_spec.rb' - './spec/workers/container_expiration_policies/cleanup_container_repository_worker_spec.rb' @@ -9955,7 +9574,6 @@ - './spec/workers/database/ci_project_mirrors_consistency_check_worker_spec.rb' - './spec/workers/database/drop_detached_partitions_worker_spec.rb' - './spec/workers/database/partition_management_worker_spec.rb' -- './spec/workers/delete_container_repository_worker_spec.rb' - './spec/workers/delete_diff_files_worker_spec.rb' - './spec/workers/delete_merged_branches_worker_spec.rb' - './spec/workers/delete_user_worker_spec.rb' @@ -9991,8 +9609,6 @@ - './spec/workers/gitlab/github_import/import_issue_event_worker_spec.rb' - './spec/workers/gitlab/github_import/import_issue_worker_spec.rb' - './spec/workers/gitlab/github_import/import_note_worker_spec.rb' -- './spec/workers/gitlab/github_import/import_pull_request_merged_by_worker_spec.rb' -- './spec/workers/gitlab/github_import/import_pull_request_review_worker_spec.rb' - './spec/workers/gitlab/github_import/import_pull_request_worker_spec.rb' - './spec/workers/gitlab/github_import/refresh_import_jid_worker_spec.rb' - './spec/workers/gitlab/github_import/stage/finish_import_worker_spec.rb' @@ -10017,7 +9633,6 @@ - './spec/workers/gitlab/jira_import/stuck_jira_import_jobs_worker_spec.rb' - './spec/workers/gitlab_performance_bar_stats_worker_spec.rb' - './spec/workers/gitlab_service_ping_worker_spec.rb' -- './spec/workers/gitlab_shell_worker_spec.rb' - './spec/workers/google_cloud/create_cloudsql_instance_worker_spec.rb' - './spec/workers/group_destroy_worker_spec.rb' - './spec/workers/group_export_worker_spec.rb' @@ -10061,9 +9676,6 @@ - './spec/workers/merge_requests/resolve_todos_worker_spec.rb' - './spec/workers/merge_requests/update_head_pipeline_worker_spec.rb' - './spec/workers/merge_worker_spec.rb' -- './spec/workers/metrics/dashboard/prune_old_annotations_worker_spec.rb' -- './spec/workers/metrics/dashboard/schedule_annotations_prune_worker_spec.rb' -- './spec/workers/metrics/dashboard/sync_dashboards_worker_spec.rb' - './spec/workers/migrate_external_diffs_worker_spec.rb' - './spec/workers/namespaces/process_sync_events_worker_spec.rb' - './spec/workers/namespaces/prune_aggregation_schedules_worker_spec.rb' @@ -10082,7 +9694,6 @@ - './spec/workers/packages/composer/cache_cleanup_worker_spec.rb' - './spec/workers/packages/composer/cache_update_worker_spec.rb' - './spec/workers/packages/debian/generate_distribution_worker_spec.rb' -- './spec/workers/packages/debian/process_changes_worker_spec.rb' - './spec/workers/packages/go/sync_packages_worker_spec.rb' - './spec/workers/packages/helm/extraction_worker_spec.rb' - './spec/workers/packages/mark_package_files_for_destruction_worker_spec.rb' @@ -10094,7 +9705,6 @@ - './spec/workers/pages_domain_ssl_renewal_worker_spec.rb' - './spec/workers/pages_domain_verification_cron_worker_spec.rb' - './spec/workers/pages_domain_verification_worker_spec.rb' -- './spec/workers/pages/invalidate_domain_cache_worker_spec.rb' - './spec/workers/pages_worker_spec.rb' - './spec/workers/partition_creation_worker_spec.rb' - './spec/workers/personal_access_tokens/expired_notification_worker_spec.rb' diff --git a/spec/support/shared_contexts/ci/catalog/resources/version_shared_context.rb b/spec/support/shared_contexts/ci/catalog/resources/version_shared_context.rb new file mode 100644 index 00000000000..3c9bb980b46 --- /dev/null +++ b/spec/support/shared_contexts/ci/catalog/resources/version_shared_context.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +RSpec.shared_context 'when there are catalog resources with versions' do + let_it_be(:current_user) { create(:user) } + + let_it_be(:project1) { create(:project, :repository) } + let_it_be(:project2) { create(:project, :repository) } + let_it_be(:project3) { create(:project, :repository) } + let_it_be_with_reload(:resource1) { create(:ci_catalog_resource, project: project1) } + let_it_be_with_reload(:resource2) { create(:ci_catalog_resource, project: project2) } + let_it_be(:resource3) { create(:ci_catalog_resource, project: project3) } + + let_it_be(:release_v1_0) { create(:release, project: project1, tag: 'v1.0', released_at: 4.days.ago) } + let_it_be(:release_v1_1) { create(:release, project: project1, tag: 'v1.1', released_at: 3.days.ago) } + let_it_be(:release_v2_0) { create(:release, project: project2, tag: 'v2.0', released_at: 2.days.ago) } + let_it_be(:release_v2_1) { create(:release, project: project2, tag: 'v2.1', released_at: 1.day.ago) } + + let_it_be(:v1_0) do + create(:ci_catalog_resource_version, catalog_resource: resource1, release: release_v1_0, created_at: 1.day.ago) + end + + let_it_be(:v1_1) do + create(:ci_catalog_resource_version, catalog_resource: resource1, release: release_v1_1, created_at: 2.days.ago) + end + + let_it_be(:v2_0) do + create(:ci_catalog_resource_version, catalog_resource: resource2, release: release_v2_0, created_at: 3.days.ago) + end + + let_it_be(:v2_1) do + create(:ci_catalog_resource_version, catalog_resource: resource2, release: release_v2_1, created_at: 4.days.ago) + end +end diff --git a/spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb b/spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb new file mode 100644 index 00000000000..8ad7edee1a1 --- /dev/null +++ b/spec/support/shared_contexts/controllers/ambiguous_ref_controller_shared_context.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +RSpec.shared_context 'with ambiguous refs for controllers' do + let(:ambiguous_ref_modal) { false } + + before do + expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original # rubocop:disable RSpec/ExpectInHook + project.repository.add_tag(project.creator, 'ambiguous_ref', RepoHelpers.sample_commit.id) + project.repository.add_branch(project.creator, 'ambiguous_ref', RepoHelpers.another_sample_commit.id) + + stub_feature_flags(redirect_with_ref_type: redirect_with_ref_type) + stub_feature_flags(ambiguous_ref_modal: ambiguous_ref_modal) + end + + after do + project.repository.rm_tag(project.creator, 'ambiguous_ref') + project.repository.rm_branch(project.creator, 'ambiguous_ref') + end +end diff --git a/spec/support/shared_contexts/features/integrations/project_integrations_shared_context.rb b/spec/support/shared_contexts/features/integrations/project_integrations_shared_context.rb index c3da9435e05..743a7cd26e0 100644 --- a/spec/support/shared_contexts/features/integrations/project_integrations_shared_context.rb +++ b/spec/support/shared_contexts/features/integrations/project_integrations_shared_context.rb @@ -4,7 +4,7 @@ RSpec.shared_context 'project integration activation' do include_context 'with integration activation' let_it_be(:project) { create(:project) } - let_it_be(:user) { create(:user, :no_super_sidebar) } + let_it_be(:user) { create(:user) } before do project.add_maintainer(user) diff --git a/spec/support/shared_contexts/graphql/resolvers/runners_resolver_shared_context.rb b/spec/support/shared_contexts/graphql/resolvers/runners_resolver_shared_context.rb index 1480b5f98e7..2dbb903a272 100644 --- a/spec/support/shared_contexts/graphql/resolvers/runners_resolver_shared_context.rb +++ b/spec/support/shared_contexts/graphql/resolvers/runners_resolver_shared_context.rb @@ -9,14 +9,14 @@ RSpec.shared_context 'runners resolver setup' do let_it_be(:project) { create(:project, :public, group: group) } let_it_be(:inactive_project_runner) do - create(:ci_runner, :project, projects: [project], description: 'inactive project runner', token: 'abcdef', active: false, contacted_at: 1.minute.ago, tag_list: %w(project_runner)) + create(:ci_runner, :project, projects: [project], description: 'inactive project runner', token: 'abcdef', active: false, contacted_at: 1.minute.ago, tag_list: %w[project_runner]) end let_it_be(:offline_project_runner) do - create(:ci_runner, :project, projects: [project], description: 'offline project runner', token: 'defghi', contacted_at: 1.day.ago, tag_list: %w(project_runner active_runner)) + create(:ci_runner, :project, projects: [project], description: 'offline project runner', token: 'defghi', contacted_at: 1.day.ago, tag_list: %w[project_runner active_runner]) end let_it_be(:group_runner) { create(:ci_runner, :group, groups: [group], token: 'mnopqr', description: 'group runner', contacted_at: 2.seconds.ago) } let_it_be(:subgroup_runner) { create(:ci_runner, :group, groups: [subgroup], token: '123456', description: 'subgroup runner', contacted_at: 1.second.ago) } - let_it_be(:instance_runner) { create(:ci_runner, :instance, description: 'shared runner', token: 'stuvxz', contacted_at: 2.minutes.ago, tag_list: %w(instance_runner active_runner)) } + let_it_be(:instance_runner) { create(:ci_runner, :instance, description: 'shared runner', token: 'stuvxz', contacted_at: 2.minutes.ago, tag_list: %w[instance_runner active_runner]) } end diff --git a/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb b/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb index 434592ccd38..257ccc553fe 100644 --- a/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb +++ b/spec/support/shared_contexts/graphql/types/query_type_shared_context.rb @@ -13,6 +13,8 @@ RSpec.shared_context 'with FOSS query type fields' do :current_user, :design_management, :echo, + :frecent_groups, + :frecent_projects, :gitpod_enabled, :group, :groups, diff --git a/spec/support/shared_contexts/lib/gitlab/sidekiq_middleware/server_metrics_shared_context.rb b/spec/support/shared_contexts/lib/gitlab/sidekiq_middleware/server_metrics_shared_context.rb index d9b2b44980c..85ee3ed4183 100644 --- a/spec/support/shared_contexts/lib/gitlab/sidekiq_middleware/server_metrics_shared_context.rb +++ b/spec/support/shared_contexts/lib/gitlab/sidekiq_middleware/server_metrics_shared_context.rb @@ -19,6 +19,12 @@ RSpec.shared_context 'server metrics with mocked prometheus' do let(:load_balancing_metric) { double('load balancing metric') } let(:sidekiq_mem_total_bytes) { double('sidekiq mem total bytes') } let(:completion_seconds_sum_metric) { double('sidekiq completion seconds sum metric') } + let(:completion_count_metric) { double('sidekiq completion seconds count metric') } + let(:cpu_seconds_sum_metric) { double('cpu seconds sum metric') } + let(:db_seconds_sum_metric) { double('db seconds sum metric') } + let(:gitaly_seconds_sum_metric) { double('gitaly seconds sum metric') } + let(:redis_seconds_sum_metric) { double('redis seconds sum metric') } + let(:elasticsearch_seconds_sum_metric) { double('elasticsearch seconds sum metric') } before do allow(Gitlab::Metrics).to receive(:histogram).and_call_original @@ -38,6 +44,12 @@ RSpec.shared_context 'server metrics with mocked prometheus' do allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_elasticsearch_requests_total, anything).and_return(elasticsearch_requests_total) allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_load_balancing_count, anything).and_return(load_balancing_metric) allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_jobs_completion_seconds_sum, anything).and_return(completion_seconds_sum_metric) + allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_jobs_completion_count, anything).and_return(completion_count_metric) + allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_jobs_cpu_seconds_sum, anything).and_return(cpu_seconds_sum_metric) + allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_jobs_db_seconds_sum, anything).and_return(db_seconds_sum_metric) + allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_jobs_gitaly_seconds_sum, anything).and_return(gitaly_seconds_sum_metric) + allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_redis_requests_duration_seconds_sum, anything).and_return(redis_seconds_sum_metric) + allow(Gitlab::Metrics).to receive(:counter).with(:sidekiq_elasticsearch_requests_duration_seconds_sum, anything).and_return(elasticsearch_seconds_sum_metric) allow(Gitlab::Metrics).to receive(:gauge).with(:sidekiq_running_jobs, anything, {}, :all).and_return(running_jobs_metric) allow(Gitlab::Metrics).to receive(:gauge).with(:sidekiq_concurrency, anything, {}, :all).and_return(concurrency_metric) allow(Gitlab::Metrics).to receive(:gauge).with(:sidekiq_mem_total_bytes, anything, {}, :all).and_return(sidekiq_mem_total_bytes) @@ -78,12 +90,8 @@ RSpec.shared_context 'server metrics call' do } end - let(:stub_subject) { true } - before do - if stub_subject - allow(subject).to receive(:get_thread_cputime).and_return(thread_cputime_before, thread_cputime_after) - end + allow(subject).to receive(:get_thread_cputime).and_return(thread_cputime_before, thread_cputime_after) allow(Gitlab::Metrics::System).to receive(:monotonic_time).and_return(monotonic_time_before, monotonic_time_after) allow(Gitlab::InstrumentationHelper).to receive(:queue_duration_for_job).with(job).and_return(queue_duration_for_job) @@ -101,9 +109,16 @@ RSpec.shared_context 'server metrics call' do allow(redis_requests_total).to receive(:increment) allow(elasticsearch_requests_total).to receive(:increment) allow(completion_seconds_sum_metric).to receive(:increment) + allow(completion_count_metric).to receive(:increment) + allow(cpu_seconds_sum_metric).to receive(:increment) + allow(db_seconds_sum_metric).to receive(:increment) + allow(gitaly_seconds_sum_metric).to receive(:increment) + allow(redis_seconds_sum_metric).to receive(:increment) + allow(elasticsearch_seconds_sum_metric).to receive(:increment) allow(queue_duration_seconds).to receive(:observe) allow(user_execution_seconds_metric).to receive(:observe) allow(db_seconds_metric).to receive(:observe) + allow(db_seconds_sum_metric).to receive(:increment) allow(gitaly_seconds_metric).to receive(:observe) allow(completion_seconds_metric).to receive(:observe) allow(redis_seconds_metric).to receive(:observe) diff --git a/spec/support/shared_contexts/models/ci/job_token_scope.rb b/spec/support/shared_contexts/models/ci/job_token_scope.rb index d0fee23b57c..a33a3e09c71 100644 --- a/spec/support/shared_contexts/models/ci/job_token_scope.rb +++ b/spec/support/shared_contexts/models/ci/job_token_scope.rb @@ -16,12 +16,14 @@ end RSpec.shared_context 'with inaccessible projects' do let_it_be(:inbound_allowlist_project) { create_project_in_allowlist(source_project, direction: :inbound) } + include_context 'with unscoped projects' end RSpec.shared_context 'with unscoped projects' do let_it_be(:unscoped_project1) { create(:project) } let_it_be(:unscoped_project2) { create(:project) } + let_it_be(:unscoped_public_project) { create(:project, :public) } let_it_be(:link_out_of_scope) { create(:ci_job_token_project_scope_link, target_project: unscoped_project1) } end diff --git a/spec/support/shared_contexts/navbar_structure_context.rb b/spec/support/shared_contexts/navbar_structure_context.rb index a09319b4980..a5ccce27aa5 100644 --- a/spec/support/shared_contexts/navbar_structure_context.rb +++ b/spec/support/shared_contexts/navbar_structure_context.rb @@ -3,9 +3,9 @@ RSpec.shared_context 'project navbar structure' do include NavbarStructureHelper - let(:security_and_compliance_nav_item) do + let(:secure_nav_item) do { - nav_item: _('Security and Compliance'), + nav_item: _('Secure'), nav_sub_items: [ (_('Audit events') if Gitlab.ee?), _('Security configuration') @@ -16,65 +16,58 @@ RSpec.shared_context 'project navbar structure' do let(:structure) do [ { - nav_item: "#{project.name[0, 1].upcase} #{project.name}", - nav_sub_items: [] + nav_item: _('Manage'), + nav_sub_items: [ + _('Activity'), + _('Members'), + _('Labels') + ] }, { - nav_item: _('Project information'), + nav_item: _('Plan'), nav_sub_items: [ - _('Activity'), - _('Labels'), - _('Members') + _('Issues'), + _('Issue boards'), + _('Milestones'), + _('Wiki') ] }, { - nav_item: _('Repository'), + nav_item: _('Code'), nav_sub_items: [ - _('Files'), - _('Commits'), + _('Merge requests'), + _('Repository'), _('Branches'), + _('Commits'), _('Tags'), - _('Contributor statistics'), - _('Graph'), + _('Repository graph'), _('Compare revisions'), + _('Snippets'), (_('Locked files') if Gitlab.ee?) ] }, { - nav_item: _('Issues'), - nav_sub_items: [ - _('List'), - _('Boards'), - _('Service Desk'), - _('Milestones') - ] - }, - { - nav_item: _('Merge requests'), - nav_sub_items: [] - }, - { - nav_item: _('CI/CD'), + nav_item: _('Build'), nav_sub_items: [ _('Pipelines'), - s_('Pipelines|Editor'), _('Jobs'), - _('Artifacts'), - _('Schedules') + _('Pipeline editor'), + _('Pipeline schedules'), + _('Artifacts') ] }, - security_and_compliance_nav_item, + secure_nav_item, { - nav_item: _('Deployments'), + nav_item: _('Deploy'), nav_sub_items: [ - _('Environments'), - s_('FeatureFlags|Feature flags'), - _('Releases') + _('Releases'), + s_('FeatureFlags|Feature flags') ] }, { - nav_item: _('Infrastructure'), + nav_item: _('Operate'), nav_sub_items: [ + _('Environments'), _('Kubernetes clusters'), s_('Terraform|Terraform states') ] @@ -84,22 +77,15 @@ RSpec.shared_context 'project navbar structure' do nav_sub_items: [ _('Error Tracking'), _('Alerts'), - _('Incidents') + _('Incidents'), + _('Service Desk') ] }, { - nav_item: _('Analytics'), + nav_item: _('Analyze'), nav_sub_items: project_analytics_sub_nav_item }, { - nav_item: _('Wiki'), - nav_sub_items: [] - }, - { - nav_item: _('Snippets'), - nav_sub_items: [] - }, - { nav_item: _('Settings'), nav_sub_items: [ _('General'), @@ -120,9 +106,9 @@ RSpec.shared_context 'project navbar structure' do end RSpec.shared_context 'group navbar structure' do - let(:analytics_nav_item) do + let(:analyze_nav_item) do { - nav_item: _('Analytics'), + nav_item: _("Analyze"), nav_sub_items: group_analytics_sub_nav_item } end @@ -148,65 +134,46 @@ RSpec.shared_context 'group navbar structure' do let(:settings_for_maintainer_nav_item) do { - nav_item: _('Settings'), - nav_sub_items: [ - _('Repository') - ] + nav_item: _("Settings"), + nav_sub_items: [_("Repository")] } end - let(:security_and_compliance_nav_item) do + let(:secure_nav_item) do { - nav_item: _('Security and Compliance'), - nav_sub_items: [ - _('Audit events') - ] + nav_item: _("Secure"), + nav_sub_items: [_("Audit events")] } end - let(:issues_nav_items) do - [ - _('List'), - _('Board'), - _('Milestones'), - (_('Iterations') if Gitlab.ee?) - ] + let(:plan_nav_items) do + [_("Issues"), _("Issue board"), _("Milestones"), (_('Iterations') if Gitlab.ee?)] end let(:structure) do [ { - nav_item: "#{group.name[0, 1].upcase} #{group.name}", - nav_sub_items: [] - }, - { - nav_item: group.root? ? _('Group information') : _('Subgroup information'), - nav_sub_items: [ - _('Activity'), - _('Labels'), - _('Members') - ] + nav_item: _("Manage"), + nav_sub_items: [_("Activity"), _("Members"), _("Labels")] }, { - nav_item: _('Issues'), - nav_sub_items: issues_nav_items + nav_item: _("Plan"), + nav_sub_items: plan_nav_items }, { - nav_item: _('Merge requests'), - nav_sub_items: [] + nav_item: _("Code"), + nav_sub_items: [_("Merge requests")] }, - (security_and_compliance_nav_item if Gitlab.ee?), { - nav_item: _('CI/CD'), - nav_sub_items: [ - s_('Runners|Runners') - ] + nav_item: _("Build"), + nav_sub_items: [_("Runners")] }, + (secure_nav_item if Gitlab.ee?), { - nav_item: _('Kubernetes'), - nav_sub_items: [] + nav_item: _("Operate"), + nav_sub_items: [_("Kubernetes")] }, - (analytics_nav_item if Gitlab.ee?) + (analyze_nav_item if Gitlab.ee?) ] end end @@ -215,10 +182,6 @@ RSpec.shared_context 'dashboard navbar structure' do let(:structure) do [ { - nav_item: "Your work", - nav_sub_items: [] - }, - { nav_item: _("Projects"), nav_sub_items: [] }, @@ -237,8 +200,8 @@ RSpec.shared_context 'dashboard navbar structure' do { nav_item: _("Merge requests"), nav_sub_items: [ - _('Assigned 0'), - _('Review requests 0') + _('Assigned'), + _('Review requests') ] }, { @@ -265,10 +228,29 @@ RSpec.shared_context '"Explore" navbar structure' do let(:structure) do [ { - nav_item: "Explore", + nav_item: _("Projects"), + nav_sub_items: [] + }, + { + nav_item: _("Groups"), nav_sub_items: [] }, { + nav_item: _("Topics"), + nav_sub_items: [] + }, + { + nav_item: _("Snippets"), + nav_sub_items: [] + } + ] + end +end + +RSpec.shared_context '"Explore" navbar structure with global_ci_catalog FF' do + let(:structure) do + [ + { nav_item: _("Projects"), nav_sub_items: [] }, @@ -277,6 +259,10 @@ RSpec.shared_context '"Explore" navbar structure' do nav_sub_items: [] }, { + nav_item: _("CI/CD Catalog"), + nav_sub_items: [] + }, + { nav_item: _("Topics"), nav_sub_items: [] }, diff --git a/spec/support/shared_contexts/policies/project_policy_shared_context.rb b/spec/support/shared_contexts/policies/project_policy_shared_context.rb index 5014a810f35..68eb3539813 100644 --- a/spec/support/shared_contexts/policies/project_policy_shared_context.rb +++ b/spec/support/shared_contexts/policies/project_policy_shared_context.rb @@ -54,7 +54,7 @@ RSpec.shared_context 'ProjectPolicy context' do create_environment create_merge_request_from admin_metrics_dashboard_annotation create_pipeline create_release create_wiki destroy_container_image push_code read_pod_logs - read_terraform_state resolve_note update_build update_commit_status + read_terraform_state resolve_note update_build cancel_build update_commit_status update_container_image update_deployment update_environment update_merge_request update_pipeline update_release destroy_release read_resource_group update_resource_group update_escalation_status diff --git a/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb b/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb index 0cf026749ee..01b91cd5db4 100644 --- a/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb +++ b/spec/support/shared_contexts/services/projects/container_repository/delete_tags_service_shared_context.rb @@ -16,11 +16,11 @@ RSpec.shared_context 'container repository delete tags service shared context' d stub_container_registry_tags( repository: repository.path, - tags: %w(latest A Ba Bb C D E)) + tags: %w[latest A Ba Bb C D E]) end def stub_delete_reference_request(tag, status = 200) - stub_request(:delete, "http://registry.gitlab/v2/#{repository.path}/tags/reference/#{tag}") + stub_request(:delete, "http://registry.gitlab/v2/#{repository.path}/manifests/#{tag}") .to_return(status: status, body: '') end @@ -28,7 +28,7 @@ RSpec.shared_context 'container repository delete tags service shared context' d tags = Array.wrap(tags).index_with { 200 } unless tags.is_a?(Hash) tags.each do |tag, status| - stub_request(:delete, "http://registry.gitlab/v2/#{repository.path}/tags/reference/#{tag}") + stub_request(:delete, "http://registry.gitlab/v2/#{repository.path}/manifests/#{tag}") .to_return(status: status, body: '') end end @@ -58,23 +58,11 @@ RSpec.shared_context 'container repository delete tags service shared context' d .with(repository.path, content, digest) { double(success?: success ) } end - def expect_delete_tag_by_digest(digest) - expect_any_instance_of(ContainerRegistry::Client) - .to receive(:delete_repository_tag_by_digest) - .with(repository.path, digest) { true } - - expect_any_instance_of(ContainerRegistry::Client) - .not_to receive(:delete_repository_tag_by_name) - end - - def expect_delete_tag_by_names(names) + def expect_delete_tags(names) Array.wrap(names).each do |name| expect_any_instance_of(ContainerRegistry::Client) - .to receive(:delete_repository_tag_by_name) + .to receive(:delete_repository_tag_by_digest) .with(repository.path, name) { true } - - expect_any_instance_of(ContainerRegistry::Client) - .not_to receive(:delete_repository_tag_by_digest) end end end diff --git a/spec/support/shared_examples/analytics/cycle_analytics/request_params_examples.rb b/spec/support/shared_examples/analytics/cycle_analytics/request_params_examples.rb index 0e7b909fce9..cf539174587 100644 --- a/spec/support/shared_examples/analytics/cycle_analytics/request_params_examples.rb +++ b/spec/support/shared_examples/analytics/cycle_analytics/request_params_examples.rb @@ -45,9 +45,19 @@ RSpec.shared_examples 'unlicensed cycle analytics request params' do end end + context 'when the date range is exactly 180 days' do + before do + params[:created_before] = '2019-06-30' + end + + it 'is valid' do + expect(subject).to be_valid + end + end + context 'when the date range exceeds 180 days' do before do - params[:created_before] = '2019-07-15' + params[:created_before] = '2019-07-01' end it 'is invalid' do diff --git a/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb b/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb index c86fcf5ae20..9bd10d56d8c 100644 --- a/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb +++ b/spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb @@ -5,7 +5,6 @@ RSpec.shared_examples 'multiple issue boards' do context 'authorized user' do before do - stub_feature_flags(apollo_boards: false) parent.add_maintainer(user) login_as(user) @@ -124,7 +123,6 @@ RSpec.shared_examples 'multiple issue boards' do context 'unauthorized user' do before do - stub_feature_flags(apollo_boards: false) visit boards_path wait_for_requests end @@ -174,6 +172,8 @@ RSpec.shared_examples 'multiple issue boards' do end def assert_boards_nav_active - expect(find('.nav-sidebar .active .active')).to have_selector('a', text: 'Boards') + within_testid('super-sidebar') do + expect(page).to have_selector('[aria-current="page"]', text: 'Issue boards') + end end end diff --git a/spec/support/shared_examples/ci/deployable_policy_shared_examples.rb b/spec/support/shared_examples/ci/deployable_policy_shared_examples.rb index 73bdc094237..1f164a66026 100644 --- a/spec/support/shared_examples/ci/deployable_policy_shared_examples.rb +++ b/spec/support/shared_examples/ci/deployable_policy_shared_examples.rb @@ -20,6 +20,7 @@ RSpec.shared_examples 'a deployable job policy' do |factory_type| end it { expect(policy).not_to be_allowed :update_build } + it { expect(policy).not_to be_allowed :cancel_build } end end end diff --git a/spec/support/shared_examples/ci/deployable_policy_shared_examples_ee.rb b/spec/support/shared_examples/ci/deployable_policy_shared_examples_ee.rb index b1057b3f67a..10f334a6e23 100644 --- a/spec/support/shared_examples/ci/deployable_policy_shared_examples_ee.rb +++ b/spec/support/shared_examples/ci/deployable_policy_shared_examples_ee.rb @@ -20,6 +20,12 @@ RSpec.shared_examples 'a deployable job policy in EE' do |factory_type| it_behaves_like 'protected environments access', direct_access: true end + describe '#cancel_build?' do + subject { user.can?(:cancel_build, job) } + + it_behaves_like 'protected environments access', direct_access: true + end + describe '#update_commit_status?' do subject { user.can?(:update_commit_status, job) } diff --git a/spec/support/shared_examples/ci/redis_shared_examples.rb b/spec/support/shared_examples/ci/redis_shared_examples.rb new file mode 100644 index 00000000000..bc9826a8968 --- /dev/null +++ b/spec/support/shared_examples/ci/redis_shared_examples.rb @@ -0,0 +1,222 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'CI build trace chunk redis' do |redis_store| + describe '#data' do + subject { data_store.data(model) } + + context 'when data exists' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: 'sample data in redis') } + + it 'returns the data' do + is_expected.to eq('sample data in redis') + end + end + + context 'when data does not exist' do + let(:model) { create(:ci_build_trace_chunk, store_trait_without_data) } + + it 'returns nil' do + is_expected.to be_nil + end + end + end + + describe '#set_data' do + subject { data_store.set_data(model, data) } + + let(:data) { 'abc123' } + + context 'when data exists' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: 'sample data in redis') } + + it 'overwrites data' do + expect(data_store.data(model)).to eq('sample data in redis') + + subject + + expect(data_store.data(model)).to eq('abc123') + end + end + + context 'when data does not exist' do + let(:model) { create(:ci_build_trace_chunk, store_trait_without_data) } + + it 'sets new data' do + expect(data_store.data(model)).to be_nil + + subject + + expect(data_store.data(model)).to eq('abc123') + end + end + end + + describe '#append_data' do + context 'when valid offset is used with existing data' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: 'abcd') } + + it 'appends data' do + expect(data_store.data(model)).to eq('abcd') + + length = data_store.append_data(model, '12345', 4) + + expect(length).to eq 9 + expect(data_store.data(model)).to eq('abcd12345') + end + end + + context 'when data does not exist yet' do + let(:model) { create(:ci_build_trace_chunk, store_trait_without_data) } + + it 'sets new data' do + expect(data_store.data(model)).to be_nil + + length = data_store.append_data(model, 'abc', 0) + + expect(length).to eq 3 + expect(data_store.data(model)).to eq('abc') + end + end + + context 'when data needs to be truncated' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: '12345678') } + + it 'appends data and truncates stored value' do + expect(data_store.data(model)).to eq('12345678') + + length = data_store.append_data(model, 'ab', 4) + + expect(length).to eq 6 + expect(data_store.data(model)).to eq('1234ab') + end + end + + context 'when invalid offset is provided' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: 'abc') } + + it 'raises an exception' do + length = data_store.append_data(model, '12345', 4) + + expect(length).to be_negative + end + end + + context 'when trace contains multi-byte UTF8 characters' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: 'aüc') } + + it 'appends data' do + length = data_store.append_data(model, '1234', 4) + + data_store.data(model).then do |new_data| + expect(new_data.bytesize).to eq 8 + expect(new_data).to eq 'aüc1234' + end + + expect(length).to eq 8 + end + end + + context 'when trace contains non-UTF8 characters' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: "a\255c") } + + it 'appends data' do + length = data_store.append_data(model, '1234', 3) + + data_store.data(model).then do |new_data| + expect(new_data.bytesize).to eq 7 + end + + expect(length).to eq 7 + end + end + end + + describe '#delete_data' do + subject { data_store.delete_data(model) } + + context 'when data exists' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: 'sample data in redis') } + + it 'deletes data' do + expect(data_store.data(model)).to eq('sample data in redis') + + subject + + expect(data_store.data(model)).to be_nil + end + end + + context 'when data does not exist' do + let(:model) { create(:ci_build_trace_chunk, store_trait_without_data) } + + it 'does nothing' do + expect(data_store.data(model)).to be_nil + + subject + + expect(data_store.data(model)).to be_nil + end + end + end + + describe '#size' do + context 'when data exists' do + let(:model) { create(:ci_build_trace_chunk, store_trait_with_data, initial_data: 'üabcd') } + + it 'returns data bytesize correctly' do + expect(data_store.size(model)).to eq 6 + end + end + + context 'when data does not exist' do + let(:model) { create(:ci_build_trace_chunk, store_trait_without_data) } + + it 'returns zero' do + expect(data_store.size(model)).to be_zero + end + end + end + + describe '#keys' do + subject { data_store.keys(relation) } + + let(:build) { create(:ci_build) } + let(:relation) { build.trace_chunks } + + before do + create(:ci_build_trace_chunk, store_trait_with_data, chunk_index: 0, build: build) + create(:ci_build_trace_chunk, store_trait_with_data, chunk_index: 1, build: build) + end + + it 'returns keys' do + is_expected.to eq([[build.id, 0], [build.id, 1]]) + end + end + + describe '#delete_keys' do + subject { data_store.delete_keys(keys) } + + let(:build) { create(:ci_build) } + let(:relation) { build.trace_chunks } + let(:keys) { data_store.keys(relation) } + + before do + create(:ci_build_trace_chunk, store_trait_with_data, chunk_index: 0, build: build) + create(:ci_build_trace_chunk, store_trait_with_data, chunk_index: 1, build: build) + end + + it 'deletes multiple data' do + redis_store.with do |redis| + expect(redis.exists?("gitlab:ci:trace:#{build.id}:chunks:0")).to eq(true) + expect(redis.exists?("gitlab:ci:trace:#{build.id}:chunks:1")).to eq(true) + end + + subject + + redis_store.with do |redis| + expect(redis.exists?("gitlab:ci:trace:#{build.id}:chunks:0")).to eq(false) + expect(redis.exists?("gitlab:ci:trace:#{build.id}:chunks:1")).to eq(false) + end + end + end +end diff --git a/spec/support/shared_examples/controllers/base_action_controller_shared_examples.rb b/spec/support/shared_examples/controllers/base_action_controller_shared_examples.rb deleted file mode 100644 index 5f236f25d35..00000000000 --- a/spec/support/shared_examples/controllers/base_action_controller_shared_examples.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Requires `request` subject to be defined -# -# subject(:request) { get root_path } -RSpec.shared_examples 'Base action controller' do - describe 'security headers' do - describe 'Cross-Origin-Opener-Policy' do - it 'sets the header' do - request - - expect(response.headers['Cross-Origin-Opener-Policy']).to eq('same-origin') - end - - context 'when coop_header feature flag is disabled' do - it 'does not set the header' do - stub_feature_flags(coop_header: false) - - request - - expect(response.headers['Cross-Origin-Opener-Policy']).to be_nil - end - end - end - end -end diff --git a/spec/support/shared_examples/controllers/is_ambiguous_ref_examples.rb b/spec/support/shared_examples/controllers/is_ambiguous_ref_examples.rb new file mode 100644 index 00000000000..24a656514c4 --- /dev/null +++ b/spec/support/shared_examples/controllers/is_ambiguous_ref_examples.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +RSpec.shared_examples '#set_is_ambiguous_ref when ref is ambiguous' do + context 'when the ref_type is nil' do + let(:ref_type) { nil } + + it '@ambiguous_ref return false when ff is disabled' do + expect(controller.instance_variable_get(:@is_ambiguous_ref)).to eq(false) + end + + context 'when the ambiguous_ref_modal ff is enabled' do + let(:ambiguous_ref_modal) { true } + + it '@ambiguous_ref return true' do + expect(controller.instance_variable_get(:@is_ambiguous_ref)).to eq(true) + end + end + end + + context 'when the ref_type is empty' do + let(:ref_type) { '' } + + it '@ambiguous_ref return false when ff is disabled' do + expect(controller.instance_variable_get(:@is_ambiguous_ref)).to eq(false) + end + + context 'when the ambiguous_ref_modal ff is enabled' do + let(:ambiguous_ref_modal) { true } + + it '@ambiguous_ref return true' do + expect(controller.instance_variable_get(:@is_ambiguous_ref)).to eq(true) + end + end + end + + context 'when the ref_type is present' do + let(:ref_type) { 'heads' } + let(:ambiguous_ref_modal) { true } + + it '@ambiguous_ref return false' do + expect(controller.instance_variable_get(:@is_ambiguous_ref)).to eq(false) + end + end +end + +RSpec.shared_examples '#set_is_ambiguous_ref when ref is not ambiguous' do + context 'when the ref_type is nil' do + let(:ref_type) { nil } + let(:ambiguous_ref_modal) { true } + + it '@ambiguous_ref return false' do + expect(controller.instance_variable_get(:@is_ambiguous_ref)).to eq(false) + end + end +end diff --git a/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb b/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb index 32aa566c27e..8cec0cdfbf5 100644 --- a/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb +++ b/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb @@ -324,7 +324,7 @@ RSpec.shared_examples 'wiki controller actions' do post :preview_markdown, params: routing_params.merge(id: 'page/path', text: '*Markdown* text') expect(response).to have_gitlab_http_status(:ok) - expect(json_response.keys).to match_array(%w(body references)) + expect(json_response.keys).to match_array(%w[body references]) end end diff --git a/spec/support/shared_examples/database_health_status_indicators/prometheus_alert_based_shared_examples.rb b/spec/support/shared_examples/database_health_status_indicators/prometheus_alert_based_shared_examples.rb index 109a349a652..ddc438cb652 100644 --- a/spec/support/shared_examples/database_health_status_indicators/prometheus_alert_based_shared_examples.rb +++ b/spec/support/shared_examples/database_health_status_indicators/prometheus_alert_based_shared_examples.rb @@ -2,7 +2,7 @@ RSpec.shared_examples 'Prometheus Alert based health indicator' do let(:schema) { :main } - let(:connection) { Gitlab::Database.database_base_models[schema].connection } + let(:connection) { Gitlab::Database.database_base_models_with_gitlab_shared[schema].connection } around do |example| Gitlab::Database::SharedModel.using_connection(connection) do @@ -124,7 +124,7 @@ RSpec.shared_examples 'Prometheus Alert based health indicator' do end end - Gitlab::Database.database_base_models.each do |database_base_model, connection| + Gitlab::Database.database_base_models_with_gitlab_shared.each do |database_base_model, connection| next unless connection.present? it_behaves_like 'Patroni Apdex Evaluator', database_base_model.to_sym diff --git a/spec/support/shared_examples/features/2fa_shared_examples.rb b/spec/support/shared_examples/features/2fa_shared_examples.rb index f50874b6b05..8744259488f 100644 --- a/spec/support/shared_examples/features/2fa_shared_examples.rb +++ b/spec/support/shared_examples/features/2fa_shared_examples.rb @@ -14,7 +14,7 @@ RSpec.shared_examples 'hardware device for 2fa' do |device_type| end describe "registration" do - let(:user) { create(:user, :no_super_sidebar) } + let(:user) { create(:user) } before do gitlab_sign_in(user) @@ -66,8 +66,8 @@ RSpec.shared_examples 'hardware device for 2fa' do |device_type| end end - describe 'fallback code authentication' do - let(:user) { create(:user, :no_super_sidebar) } + describe 'fallback code authentication', :js do + let(:user) { create(:user) } before do # Register and logout diff --git a/spec/support/shared_examples/features/content_editor_shared_examples.rb b/spec/support/shared_examples/features/content_editor_shared_examples.rb index 3e81f969462..6bfb60c3f34 100644 --- a/spec/support/shared_examples/features/content_editor_shared_examples.rb +++ b/spec/support/shared_examples/features/content_editor_shared_examples.rb @@ -2,7 +2,10 @@ require 'spec_helper' -RSpec.shared_examples 'edits content using the content editor' do |params = { with_expanded_references: true }| +RSpec.shared_examples 'edits content using the content editor' do |params = { + with_expanded_references: true, + with_quick_actions: true +}| include ContentEditorHelpers let(:content_editor_testid) { '[data-testid="content-editor"] [contenteditable].ProseMirror' } @@ -463,6 +466,15 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi end end + it 'does not show a loading indicator after undo paste' do + type_in_content_editor [modifier_key, 'v'] + type_in_content_editor [modifier_key, 'z'] + + page.within content_editor_testid do + expect(page).not_to have_css('.gl-dots-loader') + end + end + it 'pastes raw text without formatting if shift + ctrl + v is pressed' do type_in_content_editor [modifier_key, :shift, 'v'] @@ -546,6 +558,42 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi end end + if params[:with_quick_actions] + it 'shows suggestions for quick actions' do + type_in_content_editor '/a' + + expect(find(suggestions_dropdown)).to have_text('/assign') + expect(find(suggestions_dropdown)).to have_text('/label') + end + + it 'adds the correct prefix for /assign' do + type_in_content_editor '/assign' + + expect(find(suggestions_dropdown)).to have_text('/assign') + send_keys [:arrow_down, :enter] + + expect(page).to have_text('/assign @') + end + + it 'adds the correct prefix for /label' do + type_in_content_editor '/label' + + expect(find(suggestions_dropdown)).to have_text('/label') + send_keys [:arrow_down, :enter] + + expect(page).to have_text('/label ~') + end + + it 'adds the correct prefix for /milestone' do + type_in_content_editor '/milestone' + + expect(find(suggestions_dropdown)).to have_text('/milestone') + send_keys [:arrow_down, :enter] + + expect(page).to have_text('/milestone %') + end + end + it 'shows suggestions for members with descriptions' do type_in_content_editor '@a' @@ -561,6 +609,39 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi expect(page).to have_text('@abc123') end + it 'allows dismissing the suggestion popup and typing more text' do + type_in_content_editor '@ab' + + expect(find(suggestions_dropdown)).to have_text('abc123') + + send_keys :escape + + expect(page).not_to have_css(suggestions_dropdown) + + type_in_content_editor :enter + type_in_content_editor 'foobar' + + # ensure that the texts are in separate paragraphs + expect(page).to have_selector('p', text: '@ab') + expect(page).to have_selector('p', text: 'foobar') + expect(page).not_to have_selector('p', text: '@abfoobar') + end + + it 'allows typing more text after the popup has disappeared because no suggestions match' do + type_in_content_editor '@ab' + + expect(find(suggestions_dropdown)).to have_text('abc123') + + type_in_content_editor 'foo' + type_in_content_editor :enter + type_in_content_editor 'bar' + + # ensure that the texts are in separate paragraphs + expect(page).to have_selector('p', text: '@abfoo') + expect(page).to have_selector('p', text: 'bar') + expect(page).not_to have_selector('p', text: '@abfoobar') + end + context 'when `disable_all_mention` is enabled' do before do stub_feature_flags(disable_all_mention: true) @@ -617,14 +698,14 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi it 'shows suggestions for emojis' do type_in_content_editor ':smile' - expect(find(suggestions_dropdown)).to have_text('🙂 slight_smile') + expect(find(suggestions_dropdown)).to have_text('😃 smiley') expect(find(suggestions_dropdown)).to have_text('😸 smile_cat') send_keys [:arrow_down, :enter] expect(page).not_to have_css(suggestions_dropdown) - expect(page).to have_text('🙂') + expect(page).to have_text('😃') end it 'doesn\'t show suggestions dropdown if there are no suggestions to show' do @@ -640,7 +721,7 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { wi it 'scrolls selected item into view when navigating with keyboard' do type_in_content_editor ':' - expect(find(suggestions_dropdown)).to have_text('hundred points symbol') + expect(find(suggestions_dropdown)).to have_text('grinning') expect(dropdown_scroll_top).to be 0 diff --git a/spec/support/shared_examples/features/dashboard/sidebar_shared_examples.rb b/spec/support/shared_examples/features/dashboard/sidebar_shared_examples.rb index 9b5d9d66890..0dbf186e9b3 100644 --- a/spec/support/shared_examples/features/dashboard/sidebar_shared_examples.rb +++ b/spec/support/shared_examples/features/dashboard/sidebar_shared_examples.rb @@ -6,23 +6,19 @@ RSpec.shared_examples 'a "Your work" page with sidebar and breadcrumbs' do |page visit send(page_path) end - let(:sidebar_css) { "aside.nav-sidebar[aria-label=\"Your work\"]" } - let(:active_menu_item_css) { "li.active[data-track-label=\"#{menu_label}_menu\"]" } - it "shows the \"Your work\" sidebar" do - expect(page).to have_css(sidebar_css) + expect(page).to have_css('#super-sidebar-context-header', text: 'Your work') end it "shows the correct sidebar menu item as active" do - within(sidebar_css) do - expect(page).to have_css(active_menu_item_css) + within_testid('super-sidebar') do + expect(page).to have_css("a[data-track-label='#{menu_label}_menu'][aria-current='page']") end end describe "breadcrumbs" do it 'has "Your work" as its root breadcrumb' do - breadcrumbs = page.find('[data-testid="breadcrumb-links"]') - within breadcrumbs do + within_testid('breadcrumb-links') do expect(page).to have_css("li:first-child a[href=\"#{root_path}\"]", text: "Your work") end end diff --git a/spec/support/shared_examples/features/explore/sidebar_shared_examples.rb b/spec/support/shared_examples/features/explore/sidebar_shared_examples.rb deleted file mode 100644 index 1754c8bf53d..00000000000 --- a/spec/support/shared_examples/features/explore/sidebar_shared_examples.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -RSpec.shared_examples 'an "Explore" page with sidebar and breadcrumbs' do |page_path, menu_label| - before do - visit send(page_path) - end - - let(:sidebar_css) { 'aside.nav-sidebar[aria-label="Explore"]' } - let(:active_menu_item_css) { "li.active[data-track-label=\"#{menu_label}_menu\"]" } - - it 'shows the "Explore" sidebar' do - expect(page).to have_css(sidebar_css) - end - - it 'shows the correct sidebar menu item as active' do - within(sidebar_css) do - expect(page).to have_css(active_menu_item_css) - end - end - - describe 'breadcrumbs' do - it 'has "Explore" as its root breadcrumb' do - within '.breadcrumbs-list' do - expect(page).to have_css("li:first a[href=\"#{explore_root_path}\"]", text: 'Explore') - end - end - end -end diff --git a/spec/support/shared_examples/features/issuable_invite_members_shared_examples.rb b/spec/support/shared_examples/features/issuable_invite_members_shared_examples.rb index b8c6b85adb2..f53aaa4514d 100644 --- a/spec/support/shared_examples/features/issuable_invite_members_shared_examples.rb +++ b/spec/support/shared_examples/features/issuable_invite_members_shared_examples.rb @@ -4,22 +4,17 @@ RSpec.shared_examples 'issuable invite members' do include Features::InviteMembersModalHelpers context 'when a privileged user can invite' do - before do - project.add_maintainer(user) - end - it 'shows a link for inviting members and launches invite modal' do + project.add_maintainer(user) visit issuable_path - find('.block.assignee .edit-link').click - - wait_for_requests + open_assignees_dropdown page.within '.dropdown-menu-user' do - expect(page).to have_link('Invite Members') - end + expect(page).to have_link('Invite members') - click_link 'Invite Members' + click_link 'Invite members' + end page.within invite_modal_selector do expect(page).to have_content("You're inviting members to the #{project.name} project") @@ -28,19 +23,14 @@ RSpec.shared_examples 'issuable invite members' do end context 'when user cannot invite members in assignee dropdown' do - before do - project.add_developer(user) - end - it 'shows author in assignee dropdown and no invite link' do + project.add_developer(user) visit issuable_path - find('.block.assignee .edit-link').click - - wait_for_requests + open_assignees_dropdown page.within '.dropdown-menu-user' do - expect(page).not_to have_link('Invite Members') + expect(page).not_to have_link('Invite members') end end end diff --git a/spec/support/shared_examples/features/nav_sidebar_shared_examples.rb b/spec/support/shared_examples/features/nav_sidebar_shared_examples.rb index 34821fb9eda..8c668ae9a87 100644 --- a/spec/support/shared_examples/features/nav_sidebar_shared_examples.rb +++ b/spec/support/shared_examples/features/nav_sidebar_shared_examples.rb @@ -2,15 +2,16 @@ RSpec.shared_examples 'page has active tab' do |title| it "activates #{title} tab" do - expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) - expect(find('.sidebar-top-level-items > li.active')).to have_content(title) + within_testid('super-sidebar') do + expect(page).to have_selector('button[aria-expanded="true"]', text: title) + end end end RSpec.shared_examples 'page has active sub tab' do |title| it "activates #{title} sub tab" do - expect(page).to have_selector('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)', count: 1) - expect(find('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)')) - .to have_content(title) + within_testid('super-sidebar') do + expect(page).to have_selector('a[aria-current="page"]', text: title) + end end end diff --git a/spec/support/shared_examples/features/navbar_shared_examples.rb b/spec/support/shared_examples/features/navbar_shared_examples.rb index 9b89a3b5e54..af601c2b8e5 100644 --- a/spec/support/shared_examples/features/navbar_shared_examples.rb +++ b/spec/support/shared_examples/features/navbar_shared_examples.rb @@ -8,17 +8,12 @@ RSpec.shared_examples 'verified navigation bar' do end it 'renders correctly' do - # we are using * here in the selectors to prevent a regression where we added a non 'li' inside an 'ul' - current_structure = page.all('.sidebar-top-level-items > *', class: ['!hidden']).map do |item| - next if item.find_all('a').empty? - - nav_item = item.find_all('a').first.text.gsub(/\s+\d+$/, '') # remove counts at the end - - nav_sub_items = item.all('.sidebar-sub-level-items > *', class: ['!fly-out-top-item']).map do |list_item| - list_item.all('a').first.text + current_structure = page.all('[data-testid="non-static-items-section"] > li').map do |item| + nav_sub_items = item.all('li', visible: :all).map do |list_item| + list_item.all('a', visible: :all).first.text(:all).gsub(/\s+\d+$/, '') # remove counts at the end end - { nav_item: nav_item, nav_sub_items: nav_sub_items } + { nav_item: item.text, nav_sub_items: nav_sub_items } end.compact expect(current_structure).to eq(expected_structure) diff --git a/spec/support/shared_examples/features/packages_shared_examples.rb b/spec/support/shared_examples/features/packages_shared_examples.rb index 8e8e7e8ad05..6d283113e85 100644 --- a/spec/support/shared_examples/features/packages_shared_examples.rb +++ b/spec/support/shared_examples/features/packages_shared_examples.rb @@ -158,7 +158,7 @@ def click_sort_option(option, ascending) wait_for_requests # Reset the sort direction - if page.has_selector?('button[aria-label="Sorting Direction: Ascending"]', wait: 0) && !ascending + if page.has_selector?('button[aria-label="Sort direction: Ascending"]', wait: 0) && !ascending click_button 'Sort direction' wait_for_requests diff --git a/spec/support/shared_examples/features/page_description_shared_examples.rb b/spec/support/shared_examples/features/page_description_shared_examples.rb index e3ea36633d1..163c65915ba 100644 --- a/spec/support/shared_examples/features/page_description_shared_examples.rb +++ b/spec/support/shared_examples/features/page_description_shared_examples.rb @@ -2,7 +2,7 @@ RSpec.shared_examples 'page meta description' do |expected_description| it 'renders the page with description, og:description, and twitter:description meta tags that contains a plain-text version of the markdown', :aggregate_failures do - %w(name='description' property='og:description' property='twitter:description').each do |selector| + %w[name='description' property='og:description' property='twitter:description'].each do |selector| expect(page).to have_selector("meta[#{selector}][content='#{expected_description}']", visible: false) end end @@ -12,7 +12,7 @@ RSpec.shared_examples 'default brand title page meta description' do include AppearancesHelper it 'renders the page with description, og:description, and twitter:description meta tags with the default brand title', :aggregate_failures do - %w(name='description' property='og:description' property='twitter:description').each do |selector| + %w[name='description' property='og:description' property='twitter:description'].each do |selector| expect(page).to have_selector("meta[#{selector}][content='#{default_brand_title}']", visible: false) end end diff --git a/spec/support/shared_examples/features/project_features_apply_to_issuables_shared_examples.rb b/spec/support/shared_examples/features/project_features_apply_to_issuables_shared_examples.rb index 58bf461c733..d410653ca43 100644 --- a/spec/support/shared_examples/features/project_features_apply_to_issuables_shared_examples.rb +++ b/spec/support/shared_examples/features/project_features_apply_to_issuables_shared_examples.rb @@ -4,8 +4,8 @@ RSpec.shared_examples 'project features apply to issuables' do |klass| let(:described_class) { klass } let(:group) { create(:group) } - let(:user_in_group) { create(:group_member, :developer, user: create(:user, :no_super_sidebar), group: group ).user } - let(:user_outside_group) { create(:user, :no_super_sidebar) } + let(:user_in_group) { create(:group_member, :developer, user: create(:user), group: group ).user } + let(:user_outside_group) { create(:user) } let(:project) { create(:project, :public, project_args) } diff --git a/spec/support/shared_examples/features/search/search_timeouts_shared_examples.rb b/spec/support/shared_examples/features/search/search_timeouts_shared_examples.rb index b73f40ff28c..1e7f75d2ac0 100644 --- a/spec/support/shared_examples/features/search/search_timeouts_shared_examples.rb +++ b/spec/support/shared_examples/features/search/search_timeouts_shared_examples.rb @@ -17,7 +17,7 @@ RSpec.shared_examples 'search timeouts' do |scope| end it 'sets tab count to 0' do - expect(page.find('[data-testid="search-filter"] .active')).to have_text('0') + expect(page.find('[data-testid="search-filter"] [aria-current="page"]')).to have_text('0') end end end diff --git a/spec/support/shared_examples/features/snippets_shared_examples.rb b/spec/support/shared_examples/features/snippets_shared_examples.rb index 383f81d048f..0f830fa125a 100644 --- a/spec/support/shared_examples/features/snippets_shared_examples.rb +++ b/spec/support/shared_examples/features/snippets_shared_examples.rb @@ -52,30 +52,24 @@ RSpec.shared_examples 'tabs with counts' do end RSpec.shared_examples 'does not show New Snippet button' do - let(:user) { create(:user, :external, :no_super_sidebar) } - specify do - sign_in(user) - - subject - - wait_for_requests - + expect(page).to have_link(text: "$#{snippet.id}") expect(page).not_to have_link('New snippet') end end -RSpec.shared_examples 'show and render proper snippet blob' do - before do - allow_any_instance_of(Snippet).to receive(:blobs).and_return([snippet.repository.blob_at('master', file_path)]) +RSpec.shared_examples 'does show New Snippet button' do + specify do + expect(page).to have_link(text: "$#{snippet.id}") + expect(page).to have_link('New snippet') end +end +RSpec.shared_examples 'show and render proper snippet blob' do context 'Ruby file' do let(:file_path) { 'files/ruby/popen.rb' } it 'displays the blob' do - subject - aggregate_failures do # shows highlighted Ruby code expect(page).to have_content("require 'fileutils'") @@ -99,10 +93,6 @@ RSpec.shared_examples 'show and render proper snippet blob' do let(:file_path) { 'files/markdown/ruby-style-guide.md' } context 'visiting directly' do - before do - subject - end - it 'displays the blob using the rich viewer' do aggregate_failures do # hides the simple viewer @@ -171,8 +161,6 @@ RSpec.shared_examples 'show and render proper snippet blob' do let(:anchor) { 'LC1' } it 'displays the blob using the simple viewer' do - subject - aggregate_failures do # hides the rich viewer expect(page).to have_selector('.blob-viewer[data-type="simple"]') diff --git a/spec/support/shared_examples/features/variable_list_env_scope_shared_examples.rb b/spec/support/shared_examples/features/variable_list_env_scope_shared_examples.rb new file mode 100644 index 00000000000..c40d70b85d3 --- /dev/null +++ b/spec/support/shared_examples/features/variable_list_env_scope_shared_examples.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'variable list env scope' do + include ListboxHelpers + + let(:user) { create(:user) } + let(:project) { build(:project) } + let(:page_path) { project_settings_ci_cd_path(project) } + + before do + sign_in(user) + project.add_maintainer(user) + + visit page_path + wait_for_requests + end + + it 'adds a new variable with an environment scope' do + open_drawer + + page.within('[data-testid="ci-variable-drawer"]') do + fill_in 'Key', with: 'akey' + fill_in 'Value', with: 'akey_value' + + click_button('All (default)') + fill_in 'Search', with: 'review/*' + find('[data-testid="create-wildcard-button"]').click + + click_button('Add variable') + end + + wait_for_requests + + page.within('[data-testid="ci-variable-table"]') do + expect(find('.js-ci-variable-row:first-child [data-label="Environments"]').text).to eq('review/*') + end + end + + it 'resets environment scope list after closing the form' do + project.environments.create!(name: 'dev') + project.environments.create!(name: 'env_1') + project.environments.create!(name: 'env_2') + + open_drawer + + page.within('[data-testid="ci-variable-drawer"]') do + click_button('All (default)') + + # default list of env scopes + expect_env_scope_items(['*', 'dev', 'env_1', 'env_2']) + + fill_in 'Search', with: 'env' + sleep 0.5 # wait for debounce + wait_for_requests + + # search filters the list of env scopes + expect_env_scope_items(%w[env_1 env_2]) + + find('.gl-drawer-close-button').click + end + + # Re-open drawer + open_drawer + + page.within('[data-testid="ci-variable-drawer"]') do + click_button('All (default)') + + # dropdown should reset back to default list of env scopes + expect_env_scope_items(['*', 'dev', 'env_1', 'env_2']) + end + end + + private + + def open_drawer + page.within('[data-testid="ci-variable-table"]') do + click_button('Add variable') + wait_for_requests + end + end + + def expect_env_scope_items(items) + page.within('[data-testid="environment-scope"]') do + expect_listbox_items(items) + end + end +end diff --git a/spec/support/shared_examples/features/variable_list_shared_examples.rb b/spec/support/shared_examples/features/variable_list_shared_examples.rb deleted file mode 100644 index 5951d3e781b..00000000000 --- a/spec/support/shared_examples/features/variable_list_shared_examples.rb +++ /dev/null @@ -1,292 +0,0 @@ -# frozen_string_literal: true - -RSpec.shared_examples 'variable list' do - it 'shows a list of variables' do - page.within('[data-testid="ci-variable-table"]') do - expect(find('.js-ci-variable-row:nth-child(1) td[data-label="Key"]')).to have_content(variable.key) - end - end - - it 'adds a new CI variable' do - click_button('Add variable') - - fill_variable('key', 'key_value') do - click_button('Add variable') - end - - wait_for_requests - - page.within('[data-testid="ci-variable-table"]') do - expect(find('.js-ci-variable-row:nth-child(1) td[data-label="Key"]')).to have_content('key') - end - end - - it 'adds a new protected variable' do - click_button('Add variable') - - fill_variable('key', 'key_value') do - click_button('Add variable') - end - - wait_for_requests - - page.within('[data-testid="ci-variable-table"]') do - expect(find(".js-ci-variable-row:nth-child(1) td[data-label='#{s_('CiVariables|Key')}']")).to have_content('key') - expect(find(".js-ci-variable-row:nth-child(1) td[data-label='#{s_('CiVariables|Key')}']")).to have_content(s_('CiVariables|Protected')) - end - end - - it 'defaults to unmasked' do - click_button('Add variable') - - fill_variable('key', 'key_value') do - click_button('Add variable') - end - - wait_for_requests - - page.within('[data-testid="ci-variable-table"]') do - expect(find(".js-ci-variable-row:nth-child(1) td[data-label='#{s_('CiVariables|Key')}']")).to have_content('key') - expect(find(".js-ci-variable-row:nth-child(1) td[data-label='#{s_('CiVariables|Key')}']")).not_to have_content(s_('CiVariables|Masked')) - end - end - - it 'reveals and hides variables' do - page.within('[data-testid="ci-variable-table"]') do - expect(first('.js-ci-variable-row td[data-label="Key"]')).to have_content(variable.key) - expect(page).to have_content('*' * 5) - - click_button('Reveal value') - - expect(first('.js-ci-variable-row td[data-label="Key"]')).to have_content(variable.key) - expect(first('.js-ci-variable-row td[data-label="Value"]')).to have_content(variable.value) - expect(page).not_to have_content('*' * 5) - - click_button('Hide value') - - expect(first('.js-ci-variable-row td[data-label="Key"]')).to have_content(variable.key) - expect(page).to have_content('*' * 5) - end - end - - it 'deletes a variable' do - expect(page).to have_selector('.js-ci-variable-row', count: 1) - - page.within('[data-testid="ci-variable-table"]') do - click_button('Edit') - end - - page.within('#add-ci-variable') do - click_button('Delete variable') - end - - wait_for_requests - - expect(first('.js-ci-variable-row').text).to eq('There are no variables yet.') - end - - it 'edits a variable' do - page.within('[data-testid="ci-variable-table"]') do - click_button('Edit') - end - - page.within('#add-ci-variable') do - find('[data-testid="pipeline-form-ci-variable-key"] input').set('new_key') - - click_button('Update variable') - end - - wait_for_requests - - expect(first('.js-ci-variable-row td[data-label="Key"]')).to have_content('new_key') - end - - it 'edits a variable to be unmasked' do - page.within('[data-testid="ci-variable-table"]') do - click_button('Edit') - end - - page.within('#add-ci-variable') do - find('[data-testid="ci-variable-protected-checkbox"]').click - find('[data-testid="ci-variable-masked-checkbox"]').click - - click_button('Update variable') - end - - wait_for_requests - - page.within('[data-testid="ci-variable-table"]') do - expect(find(".js-ci-variable-row:nth-child(1) td[data-label='#{s_('CiVariables|Key')}']")).to have_content(s_('CiVariables|Protected')) - expect(find(".js-ci-variable-row:nth-child(1) td[data-label='#{s_('CiVariables|Key')}']")).not_to have_content(s_('CiVariables|Masked')) - end - end - - it 'edits a variable to be masked' do - page.within('[data-testid="ci-variable-table"]') do - click_button('Edit') - end - - page.within('#add-ci-variable') do - find('[data-testid="ci-variable-masked-checkbox"]').click - - click_button('Update variable') - end - - wait_for_requests - - page.within('[data-testid="ci-variable-table"]') do - click_button('Edit') - end - - page.within('#add-ci-variable') do - find('[data-testid="ci-variable-masked-checkbox"]').click - - click_button('Update variable') - end - - page.within('[data-testid="ci-variable-table"]') do - expect(find(".js-ci-variable-row:nth-child(1) td[data-label='#{s_('CiVariables|Key')}']")).to have_content(s_('CiVariables|Masked')) - end - end - - it 'shows a validation error box about duplicate keys' do - click_button('Add variable') - - fill_variable('key', 'key_value') do - click_button('Add variable') - end - - wait_for_requests - - click_button('Add variable') - - fill_variable('key', 'key_value') do - click_button('Add variable') - end - - wait_for_requests - - expect(find('.flash-container')).to be_present - expect(find('[data-testid="alert-danger"]').text).to have_content('(key) has already been taken') - end - - it 'allows variable to be added even if no value is provided' do - click_button('Add variable') - - page.within('#add-ci-variable') do - find('[data-testid="pipeline-form-ci-variable-key"] input').set('empty_mask_key') - - expect(find_button('Add variable', disabled: false)).to be_present - end - end - - it 'shows validation error box about unmaskable values' do - click_button('Add variable') - - fill_variable('empty_mask_key', '???', protected: true, masked: true) do - expect(page).to have_content('This variable value does not meet the masking requirements.') - expect(find_button('Add variable', disabled: true)).to be_present - end - end - - it 'handles multiple edits and a deletion' do - # Create two variables - click_button('Add variable') - - fill_variable('akey', 'akeyvalue') do - click_button('Add variable') - end - - wait_for_requests - - click_button('Add variable') - - fill_variable('zkey', 'zkeyvalue') do - click_button('Add variable') - end - - wait_for_requests - - expect(page).to have_selector('.js-ci-variable-row', count: 3) - - # Remove the `akey` variable - page.within('[data-testid="ci-variable-table"]') do - page.within('.js-ci-variable-row:first-child') do - click_button('Edit') - end - end - - page.within('#add-ci-variable') do - click_button('Delete variable') - end - - wait_for_requests - - # Add another variable - click_button('Add variable') - - fill_variable('ckey', 'ckeyvalue') do - click_button('Add variable') - end - - wait_for_requests - - # expect to find 3 rows of variables in alphabetical order - expect(page).to have_selector('.js-ci-variable-row', count: 3) - rows = all('.js-ci-variable-row') - expect(rows[0].find('td[data-label="Key"]')).to have_content('ckey') - expect(rows[1].find('td[data-label="Key"]')).to have_content('test_key') - expect(rows[2].find('td[data-label="Key"]')).to have_content('zkey') - end - - context 'defaults to the application setting' do - context 'application setting is true' do - before do - stub_application_setting(protected_ci_variables: true) - - visit page_path - end - - it 'defaults to protected' do - click_button('Add variable') - - page.within('#add-ci-variable') do - expect(find('[data-testid="ci-variable-protected-checkbox"]')).to be_checked - end - end - end - - context 'application setting is false' do - before do - stub_application_setting(protected_ci_variables: false) - - visit page_path - end - - it 'defaults to unprotected' do - click_button('Add variable') - - page.within('#add-ci-variable') do - expect(find('[data-testid="ci-variable-protected-checkbox"]')).not_to be_checked - end - end - - it 'does not show a message regarding the default' do - expect(page).not_to have_content 'Environment variables are configured by your administrator to be protected by default' - end - end - end - - def fill_variable(key, value, protected: false, masked: false) - wait_for_requests - - page.within('#add-ci-variable') do - find('[data-testid="pipeline-form-ci-variable-key"] input').set(key) - find('[data-testid="pipeline-form-ci-variable-value"]').set(value) if value.present? - find('[data-testid="ci-variable-protected-checkbox"]').click if protected - find('[data-testid="ci-variable-masked-checkbox"]').click if masked - - yield - end - end -end diff --git a/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb index ed885d7a226..dfad11f3170 100644 --- a/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb @@ -56,7 +56,7 @@ RSpec.shared_examples 'User creates wiki page' do click_on("Create page") end - expect(page).to have_current_path(%r(one/two/three-test), ignore_query: true) + expect(page).to have_current_path(%r{one/two/three-test}, ignore_query: true) expect(page).to have_link(href: wiki_page_path(wiki, 'one/two/three-test')) end diff --git a/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb index 784de102f4f..a48ff8a5f77 100644 --- a/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb @@ -40,7 +40,7 @@ RSpec.shared_examples 'User updates wiki page' do click_on('Create page') end - expect(page).to have_current_path(%r(one/two/three-test), ignore_query: true) + expect(page).to have_current_path(%r{one/two/three-test}, ignore_query: true) expect(find('.wiki-pages')).to have_content('three') first(:link, text: 'three').click @@ -49,7 +49,7 @@ RSpec.shared_examples 'User updates wiki page' do click_on('Edit') - expect(page).to have_current_path(%r(one/two/three-test), ignore_query: true) + expect(page).to have_current_path(%r{one/two/three-test}, ignore_query: true) expect(page).to have_content('Edit Page') fill_in('Content', with: 'Updated Wiki Content') @@ -149,7 +149,10 @@ RSpec.shared_examples 'User updates wiki page' do end end - it_behaves_like 'edits content using the content editor', { with_expanded_references: false } + it_behaves_like 'edits content using the content editor', { + with_expanded_references: false, + with_quick_actions: false + } it_behaves_like 'inserts diagrams.net diagram using the content editor' it_behaves_like 'autocompletes items' end diff --git a/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb index 254682e1a3a..3fac7e7093c 100644 --- a/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb @@ -39,12 +39,12 @@ RSpec.shared_examples 'User views a wiki page' do end it 'shows the history of a page that has a path' do - expect(page).to have_current_path(%r(one/two/three-test)) + expect(page).to have_current_path(%r{one/two/three-test}) first(:link, text: 'three').click click_on('Page history') - expect(page).to have_current_path(%r(one/two/three-test)) + expect(page).to have_current_path(%r{one/two/three-test}) page.within(:css, '.wiki-page-header') do expect(page).to have_content('History') @@ -52,7 +52,7 @@ RSpec.shared_examples 'User views a wiki page' do end it 'shows an old version of a page', :js do - expect(page).to have_current_path(%r(one/two/three-test)) + expect(page).to have_current_path(%r{one/two/three-test}) expect(find('.wiki-pages')).to have_content('three') first(:link, text: 'three').click @@ -61,7 +61,7 @@ RSpec.shared_examples 'User views a wiki page' do click_on('Edit') - expect(page).to have_current_path(%r(one/two/three-test)) + expect(page).to have_current_path(%r{one/two/three-test}) expect(page).to have_content('Edit Page') fill_in('Content', with: 'Updated Wiki Content') @@ -100,7 +100,7 @@ RSpec.shared_examples 'User views a wiki page' do click_on('image') - expect(page).to have_current_path(%r(wikis/#{path})) + expect(page).to have_current_path(%r{wikis/#{path}}) end end @@ -109,7 +109,7 @@ RSpec.shared_examples 'User views a wiki page' do click_on('image') - expect(page).to have_current_path(%r(wikis/#{path})) + expect(page).to have_current_path(%r{wikis/#{path}}) expect(page).to have_content('Create New Page') end end @@ -264,7 +264,10 @@ RSpec.shared_examples 'User views a wiki page' do it 'opens a default wiki page', :js do visit wiki.container.web_url - find('.shortcuts-wiki').click + within_testid('super-sidebar') do + click_button 'Plan' + click_link 'Wiki' + end wait_for_svg_to_be_loaded diff --git a/spec/support/shared_examples/features/work_items_shared_examples.rb b/spec/support/shared_examples/features/work_items_shared_examples.rb index ff79f180c64..30605c81312 100644 --- a/spec/support/shared_examples/features/work_items_shared_examples.rb +++ b/spec/support/shared_examples/features/work_items_shared_examples.rb @@ -8,7 +8,6 @@ RSpec.shared_examples 'work items title' do find(title_selector).set("Work item title") find(title_selector).native.send_keys(:return) - wait_for_requests expect(work_item.reload.title).to eq 'Work item title' @@ -16,54 +15,37 @@ RSpec.shared_examples 'work items title' do end RSpec.shared_examples 'work items toggle status button' do - let(:state_button) { '[data-testid="work-item-state-toggle"]' } - it 'successfully shows and changes the status of the work item' do - expect(find(state_button, match: :first)).to have_content 'Close' - - find(state_button, match: :first).click - - wait_for_requests + click_button 'Close', match: :first - expect(find(state_button, match: :first)).to have_content 'Reopen' + expect(page).to have_button 'Reopen' expect(work_item.reload.state).to eq('closed') end end RSpec.shared_examples 'work items comments' do |type| - let(:form_selector) { '[data-testid="work-item-add-comment"]' } - let(:edit_button) { '[data-testid="edit-work-item-note"]' } - let(:textarea_selector) { '[data-testid="work-item-add-comment"] #work-item-add-or-edit-comment' } let(:is_mac) { page.evaluate_script('navigator.platform').include?('Mac') } let(:modifier_key) { is_mac ? :command : :control } - let(:comment) { 'Test comment' } def set_comment - find(form_selector).fill_in(with: comment) + fill_in _('Add a reply'), with: 'Test comment' end it 'successfully creates and shows comments' do set_comment - click_button "Comment" - wait_for_requests - page.within(".main-notes-list") do - expect(page).to have_content comment + expect(page).to have_text 'Test comment' end end it 'successfully updates existing comments' do set_comment click_button "Comment" - wait_for_all_requests - - find(edit_button).click + click_button _('Edit comment') send_keys(" updated") - click_button "Save comment" - - wait_for_all_requests + click_button _('Save comment') page.within(".main-notes-list") do expect(page).to have_content "Test comment updated" @@ -79,39 +61,31 @@ RSpec.shared_examples 'work items comments' do |type| it 'shows work item note actions' do set_comment - send_keys([modifier_key, :enter]) - wait_for_requests page.within(".main-notes-list") do - expect(page).to have_content comment + expect(page).to have_text 'Test comment' end page.within('.timeline-entry.note.note-wrapper.note-comment:last-child') do - expect(page).to have_selector('[data-testid="work-item-note-actions"]') + click_button _('More actions') - find('[data-testid="work-item-note-actions"]').click - - expect(page).to have_selector('[data-testid="copy-link-action"]') - expect(page).to have_selector('[data-testid="assign-note-action"]') - expect(page).to have_selector('[data-testid="delete-note-action"]') - expect(page).to have_selector('[data-testid="edit-work-item-note"]') + expect(page).to have_button _('Copy link') + expect(page).to have_button _('Assign to commenting user') + expect(page).to have_button _('Delete comment') + expect(page).to have_button _('Edit comment') end end end it 'successfully posts comments using shortcut and checks if textarea is blank when reinitiated' do set_comment - send_keys([modifier_key, :enter]) - wait_for_requests - page.within(".main-notes-list") do - expect(page).to have_content comment + expect(page).to have_content 'Test comment' end - - expect(find(textarea_selector)).to have_content "" + expect(page).to have_field _('Add a reply'), with: '' end context 'when using quick actions' do @@ -158,9 +132,7 @@ RSpec.shared_examples 'work items comments' do |type| end def click_reply_and_enter_slash - find(form_selector).fill_in(with: "/") - - wait_for_all_requests + fill_in _('Add a reply'), with: '/' end end end @@ -171,7 +143,6 @@ RSpec.shared_examples 'work items assignees' do # The button is only when the mouse is over the input find('[data-testid="work-item-assignees-input"]').fill_in(with: user.username) wait_for_requests - # submit and simulate blur to save send_keys(:enter) find("body").click @@ -182,21 +153,19 @@ RSpec.shared_examples 'work items assignees' do it 'successfully assigns the current user by clicking `Assign myself` button' do find('[data-testid="work-item-assignees-input"]').hover - find('[data-testid="assign-self"]').click - wait_for_requests + click_button _('Assign yourself') expect(work_item.reload.assignees).to include(user) end it 'successfully removes all users on clear all button click' do find('[data-testid="work-item-assignees-input"]').hover - find('[data-testid="assign-self"]').click - wait_for_requests + click_button _('Assign yourself') expect(work_item.reload.assignees).to include(user) find('[data-testid="work-item-assignees-input"]').click - find('[data-testid="clear-all-button"]').click + click_button 'Clear all' find("body").click wait_for_requests @@ -205,13 +174,12 @@ RSpec.shared_examples 'work items assignees' do it 'successfully removes user on clicking badge cross button' do find('[data-testid="work-item-assignees-input"]').hover - find('[data-testid="assign-self"]').click - wait_for_requests + click_button _('Assign yourself') expect(work_item.reload.assignees).to include(user) within('[data-testid="work-item-assignees-input"]') do - find('[data-testid="close-icon"]').click + click_button 'Close' end find("body").click wait_for_requests @@ -228,11 +196,9 @@ RSpec.shared_examples 'work items assignees' do end find('[data-testid="work-item-assignees-input"]').hover - find('[data-testid="assign-self"]').click - wait_for_requests + click_button _('Assign yourself') expect(work_item.reload.assignees).to include(user) - using_session :other_session do expect(work_item.reload.assignees).to include(user) end @@ -246,7 +212,6 @@ RSpec.shared_examples 'work items labels' do it 'successfully assigns a label' do find(labels_input_selector).fill_in(with: label.title) wait_for_requests - # submit and simulate blur to save send_keys(:enter) find(label_title_selector).click @@ -276,7 +241,6 @@ RSpec.shared_examples 'work items labels' do it 'removes all labels on clear all button click' do find(labels_input_selector).fill_in(with: label.title) wait_for_requests - send_keys(:enter) find(label_title_selector).click wait_for_requests @@ -285,9 +249,8 @@ RSpec.shared_examples 'work items labels' do within(labels_input_selector) do find('input').click - find('[data-testid="clear-all-button"]').click + click_button 'Clear all' end - find(label_title_selector).click wait_for_requests @@ -297,7 +260,6 @@ RSpec.shared_examples 'work items labels' do it 'removes label on clicking badge cross button' do find(labels_input_selector).fill_in(with: label.title) wait_for_requests - send_keys(:enter) find(label_title_selector).click wait_for_requests @@ -305,9 +267,8 @@ RSpec.shared_examples 'work items labels' do expect(page).to have_text(label.title) within(labels_input_selector) do - find('[data-testid="close-icon"]').click + click_button 'Remove label' end - find(label_title_selector).click wait_for_requests @@ -324,7 +285,6 @@ RSpec.shared_examples 'work items labels' do find(labels_input_selector).fill_in(with: label.title) wait_for_requests - send_keys(:enter) find(label_title_selector).click wait_for_requests @@ -341,10 +301,7 @@ end RSpec.shared_examples 'work items description' do it 'shows GFM autocomplete', :aggregate_failures do click_button "Edit description" - - find('[aria-label="Description"]').send_keys("@#{user.username}") - - wait_for_requests + fill_in _('Description'), with: "@#{user.username}" page.within('.atwho-container') do expect(page).to have_text(user.name) @@ -353,10 +310,7 @@ RSpec.shared_examples 'work items description' do it 'autocompletes available quick actions', :aggregate_failures do click_button "Edit description" - - find('[aria-label="Description"]').send_keys("/") - - wait_for_requests + fill_in _('Description'), with: '/' page.within('#at-view-commands') do expect(page).to have_text("title") @@ -378,8 +332,6 @@ RSpec.shared_examples 'work items description' do it 'shows conflict message when description changes', :aggregate_failures do click_button "Edit description" - wait_for_requests - ::WorkItems::UpdateService.new( container: work_item.project, current_user: other_user, @@ -388,11 +340,11 @@ RSpec.shared_examples 'work items description' do wait_for_requests - find('[aria-label="Description"]').send_keys("oh yeah!") + fill_in _('Description'), with: 'oh yeah!' - expect(page.find('[data-testid="work-item-description-conflicts"]')).to have_text(expected_warning) + expect(page).to have_text(expected_warning) - click_button "Save and overwrite" + click_button s_('WorkItem|Save and overwrite') expect(page.find('[data-testid="work-item-description"]')).to have_text("oh yeah!") end @@ -410,32 +362,23 @@ RSpec.shared_examples 'work items invite members' do click_button('Invite members') page.within invite_modal_selector do - expect(page).to have_content("You're inviting members to the #{work_item.project.name} project") + expect(page).to have_text("You're inviting members to the #{work_item.project.name} project") end end end RSpec.shared_examples 'work items milestone' do - def set_milestone(milestone_dropdown, milestone_text) - milestone_dropdown.click - - find('[data-testid="work-item-milestone-dropdown"] .gl-form-input', visible: true).send_keys "\"#{milestone_text}\"" - wait_for_requests - - click_button(milestone_text) - wait_for_requests - end - - let(:milestone_dropdown_selector) { '[data-testid="work-item-milestone-dropdown"]' } - it 'searches and sets or removes milestone for the work item' do - set_milestone(find(milestone_dropdown_selector), milestone.title) + click_button s_('WorkItem|Add to milestone') + send_keys "\"#{milestone.title}\"" + select_listbox_item(milestone.title, exact_text: true) - expect(page.find(milestone_dropdown_selector)).to have_text(milestone.title) + expect(page).to have_button(milestone.title) - set_milestone(find(milestone_dropdown_selector), 'No milestone') + click_button milestone.title + select_listbox_item(s_('WorkItem|No milestone'), exact_text: true) - expect(page.find(milestone_dropdown_selector)).to have_text('Add to milestone') + expect(page).to have_button(s_('WorkItem|Add to milestone')) end end @@ -443,70 +386,52 @@ RSpec.shared_examples 'work items comment actions for guest users' do context 'for guest user' do it 'hides other actions other than copy link' do page.within(".main-notes-list") do - expect(page).to have_selector('[data-testid="work-item-note-actions"]') + click_button _('More actions'), match: :first - find('[data-testid="work-item-note-actions"]', match: :first).click - expect(page).to have_selector('[data-testid="copy-link-action"]') - expect(page).not_to have_selector('[data-testid="assign-note-action"]') + expect(page).to have_button _('Copy link') + expect(page).not_to have_button _('Assign to commenting user') end end end end RSpec.shared_examples 'work items notifications' do - let(:actions_dropdown_selector) { '[data-testid="work-item-actions-dropdown"]' } - let(:notifications_toggle_selector) { '[data-testid="notifications-toggle-action"] button[role="switch"]' } - it 'displays toast when notification is toggled' do - find(actions_dropdown_selector).click + click_button _('More actions'), match: :first - page.within('[data-testid="notifications-toggle-form"]') do - expect(page).not_to have_css(".is-checked") + within_testid('notifications-toggle-form') do + expect(page).not_to have_button(class: 'gl-toggle is-checked') - find(notifications_toggle_selector).click - wait_for_requests + click_button(class: 'gl-toggle') - expect(page).to have_css(".is-checked") + expect(page).to have_button(class: 'gl-toggle is-checked') end - page.within('.gl-toast') do - expect(find('.toast-body')).to have_content(_('Notifications turned on.')) - end + expect(page).to have_css('.gl-toast', text: _('Notifications turned on.')) end end RSpec.shared_examples 'work items todos' do - let(:todos_action_selector) { '[data-testid="work-item-todos-action"]' } - let(:todos_icon_selector) { '[data-testid="work-item-todos-icon"]' } - let(:header_section_selector) { '[data-testid="work-item-body"]' } - - def toggle_todo_action - find(todos_action_selector).click - wait_for_requests - end - it 'adds item to the list' do - page.within(header_section_selector) do - expect(find(todos_action_selector)['aria-label']).to eq('Add a to do') + expect(page).to have_button s_('WorkItem|Add a to do') - toggle_todo_action + click_button s_('WorkItem|Add a to do') - expect(find(todos_action_selector)['aria-label']).to eq('Mark as done') - end + expect(page).to have_button s_('WorkItem|Mark as done') - page.within ".header-content span[aria-label='#{_('Todos count')}']" do + within_testid('todos-shortcut-button') do expect(page).to have_content '1' end end it 'marks a todo as done' do - page.within(header_section_selector) do - toggle_todo_action - toggle_todo_action - end + click_button s_('WorkItem|Add a to do') + click_button s_('WorkItem|Mark as done') - expect(find(todos_action_selector)['aria-label']).to eq('Add a to do') - expect(page).to have_selector(".header-content span[aria-label='#{_('Todos count')}']", visible: :hidden) + expect(page).to have_button s_('WorkItem|Add a to do') + within_testid('todos-shortcut-button') do + expect(page).to have_content("") + end end end @@ -514,8 +439,7 @@ RSpec.shared_examples 'work items award emoji' do let(:award_section_selector) { '.awards' } let(:award_button_selector) { '[data-testid="award-button"]' } let(:selected_award_button_selector) { '[data-testid="award-button"].selected' } - let(:emoji_picker_button_selector) { '[data-testid="emoji-picker"]' } - let(:basketball_emoji_selector) { 'gl-emoji[data-name="basketball"]' } + let(:grinning_emoji_selector) { 'gl-emoji[data-name="grinning"]' } let(:tooltip_selector) { '.gl-tooltip' } def select_emoji @@ -560,10 +484,41 @@ RSpec.shared_examples 'work items award emoji' do it 'add custom award to the work item for current user' do within(award_section_selector) do - find(emoji_picker_button_selector).click - find(basketball_emoji_selector).click + click_button _('Add reaction') + find(grinning_emoji_selector).click + + expect(page).to have_selector(grinning_emoji_selector) + end + end +end + +RSpec.shared_examples 'work items parent' do |type| + let(:work_item_parent) { create(:work_item, type, project: project) } + + def set_parent(parent_dropdown, parent_text) + parent_dropdown.click + + find('[data-testid="listbox-search-input"] .gl-listbox-search-input', + visible: true).send_keys "\"#{parent_text}\"" + wait_for_requests + + find('.gl-new-dropdown-item').click + wait_for_requests + end + + let(:parent_dropdown_selector) { 'work-item-parent-listbox' } + + it 'searches and sets or removes parent for the work item' do + within_testid('work-item-parent-form') do + set_parent(find_by_testid(parent_dropdown_selector), work_item_parent.title) + + expect(find_by_testid(parent_dropdown_selector)).to have_text(work_item_parent.title) + + find_by_testid(parent_dropdown_selector).click + + click_button('Unassign') - expect(page).to have_selector(basketball_emoji_selector) + expect(find_by_testid(parent_dropdown_selector)).to have_text('None') end end end diff --git a/spec/support/shared_examples/finders/issues_finder_shared_examples.rb b/spec/support/shared_examples/finders/issues_finder_shared_examples.rb index ed8feebf1f6..043d6db66d3 100644 --- a/spec/support/shared_examples/finders/issues_finder_shared_examples.rb +++ b/spec/support/shared_examples/finders/issues_finder_shared_examples.rb @@ -956,7 +956,7 @@ RSpec.shared_examples 'issues or work items finder' do |factory, execute_context end context 'multiple params' do - let(:params) { { issue_types: %w(issue incident) } } + let(:params) { { issue_types: %w[issue incident] } } it 'returns all items' do expect(items).to contain_exactly(incident_item, item1, item2, item3, item4, item5) diff --git a/spec/support/shared_examples/graphql/notes_quick_actions_for_work_items_shared_examples.rb b/spec/support/shared_examples/graphql/notes_quick_actions_for_work_items_shared_examples.rb index 0577ac329e6..9af9aaef483 100644 --- a/spec/support/shared_examples/graphql/notes_quick_actions_for_work_items_shared_examples.rb +++ b/spec/support/shared_examples/graphql/notes_quick_actions_for_work_items_shared_examples.rb @@ -70,7 +70,7 @@ RSpec.shared_examples 'work item supports labels widget updates via quick action let(:add_label_ids) { [] } let(:remove_label_ids) { [] } - before_all do + before do noteable.update!(labels: [existing_label]) end diff --git a/spec/support/shared_examples/graphql/resolvers/data_transfer_resolver_shared_examples.rb b/spec/support/shared_examples/graphql/resolvers/data_transfer_resolver_shared_examples.rb index 8551bd052ce..c50e0434eb1 100644 --- a/spec/support/shared_examples/graphql/resolvers/data_transfer_resolver_shared_examples.rb +++ b/spec/support/shared_examples/graphql/resolvers/data_transfer_resolver_shared_examples.rb @@ -1,16 +1,6 @@ # frozen_string_literal: true RSpec.shared_examples 'Data transfer resolver' do - it 'returns mock data' do |_query_object| - mocked_data = ['mocked_data'] - - allow_next_instance_of(DataTransfer::MockedTransferFinder) do |instance| - allow(instance).to receive(:execute).and_return(mocked_data) - end - - expect(resolve_egress[:egress_nodes]).to eq(mocked_data) - end - context 'when data_transfer_monitoring is disabled' do before do stub_feature_flags(data_transfer_monitoring: false) diff --git a/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb b/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb index aadc061f175..98eadc507d7 100644 --- a/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb +++ b/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb @@ -52,6 +52,18 @@ RSpec.shared_examples 'group and projects packages resolver' do it { is_expected.to eq([conan_package]) } end + context 'filter by package_version' do + let(:args) { { package_version: '1.0.0', sort: 'CREATED_DESC' } } + + it { is_expected.to eq([conan_package]) } + + it 'includes_versionless has no effect' do + args[:include_versionless] = true + + is_expected.to eq([conan_package]) + end + end + context 'filter by status' do let(:args) { { status: 'error', sort: 'CREATED_DESC' } } diff --git a/spec/support/shared_examples/graphql/resolvers/users/pages_visits_resolvers_shared_examples.rb b/spec/support/shared_examples/graphql/resolvers/users/pages_visits_resolvers_shared_examples.rb new file mode 100644 index 00000000000..0dca28a4e74 --- /dev/null +++ b/spec/support/shared_examples/graphql/resolvers/users/pages_visits_resolvers_shared_examples.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'namespace visits resolver' do + include GraphqlHelpers + + describe '#resolve' do + context 'when user is not logged in' do + let_it_be(:current_user) { nil } + + it 'returns nil' do + expect(resolve_items).to eq(nil) + end + end + + context 'when user is logged in' do + let_it_be(:current_user) { create(:user) } + + context 'when the frecent_namespaces_suggestions feature flag is disabled' do + before do + stub_feature_flags(frecent_namespaces_suggestions: false) + end + + it 'raises a "Resource not available" exception' do + expect(resolve_items).to be_a(::Gitlab::Graphql::Errors::ResourceNotAvailable) + end + end + + it 'returns frecent groups' do + expect(resolve_items).to be_an_instance_of(Array) + end + end + end + + private + + def resolve_items + sync(resolve(described_class, ctx: { current_user: current_user })) + end +end diff --git a/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb b/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb index c32e758d921..7a3b3d6924c 100644 --- a/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb +++ b/spec/support/shared_examples/graphql/types/merge_request_interactions_type_shared_examples.rb @@ -28,6 +28,7 @@ RSpec.shared_examples "a user type with merge request interaction type" do authoredMergeRequests assignedMergeRequests reviewRequestedMergeRequests + organizations groupMemberships groupCount projectMemberships @@ -50,6 +51,7 @@ RSpec.shared_examples "a user type with merge request interaction type" do organization jobTitle createdAt + lastActivityOn pronouns ide ] diff --git a/spec/support/shared_examples/lib/banzai/filters/sanitization_filter_shared_examples.rb b/spec/support/shared_examples/lib/banzai/filters/sanitization_filter_shared_examples.rb index e6433f963f4..e335255e426 100644 --- a/spec/support/shared_examples/lib/banzai/filters/sanitization_filter_shared_examples.rb +++ b/spec/support/shared_examples/lib/banzai/filters/sanitization_filter_shared_examples.rb @@ -2,14 +2,14 @@ RSpec.shared_examples 'default allowlist' do it 'sanitizes tags that are not allowed' do - act = %q{<textarea>no inputs</textarea> and <blink>no blinks</blink>} + act = %q(<textarea>no inputs</textarea> and <blink>no blinks</blink>) exp = 'no inputs and no blinks' expect(filter(act).to_html).to eq exp end it 'sanitizes tag attributes' do - act = %q{<a href="http://example.com/bar.html" onclick="bar">Text</a>} - exp = %q{<a href="http://example.com/bar.html">Text</a>} + act = %q(<a href="http://example.com/bar.html" onclick="bar">Text</a>) + exp = %q(<a href="http://example.com/bar.html">Text</a>) expect(filter(act).to_html).to eq exp end @@ -31,13 +31,13 @@ RSpec.shared_examples 'default allowlist' do end it 'sanitizes `class` attribute on any element' do - act = %q{<strong class="foo">Strong</strong>} - expect(filter(act).to_html).to eq %q{<strong>Strong</strong>} + act = %q(<strong class="foo">Strong</strong>) + expect(filter(act).to_html).to eq %q(<strong>Strong</strong>) end it 'sanitizes `id` attribute on any element' do - act = %q{<em id="foo">Emphasis</em>} - expect(filter(act).to_html).to eq %q{<em>Emphasis</em>} + act = %q(<em id="foo">Emphasis</em>) + expect(filter(act).to_html).to eq %q(<em>Emphasis</em>) end end @@ -150,8 +150,8 @@ end RSpec.shared_examples 'sanitize link' do it 'removes `rel` attribute from `a` elements' do - act = %q{<a href="#" rel="nofollow">Link</a>} - exp = %q{<a href="#">Link</a>} + act = %q(<a href="#" rel="nofollow">Link</a>) + exp = %q(<a href="#">Link</a>) expect(filter(act).to_html).to eq exp end @@ -167,14 +167,14 @@ RSpec.shared_examples 'sanitize link' do end it 'allows non-standard anchor schemes' do - exp = %q{<a href="irc://irc.freenode.net/git">IRC</a>} + exp = %q(<a href="irc://irc.freenode.net/git">IRC</a>) act = filter(exp) expect(act.to_html).to eq exp end it 'allows relative links' do - exp = %q{<a href="foo/bar.md">foo/bar.md</a>} + exp = %q(<a href="foo/bar.md">foo/bar.md</a>) act = filter(exp) expect(act.to_html).to eq exp diff --git a/spec/support/shared_examples/lib/gitlab/import/advance_stage_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/import/advance_stage_shared_examples.rb index effa6a6f6f0..c172e73ce9e 100644 --- a/spec/support/shared_examples/lib/gitlab/import/advance_stage_shared_examples.rb +++ b/spec/support/shared_examples/lib/gitlab/import/advance_stage_shared_examples.rb @@ -4,7 +4,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:| let_it_be(:project) { create(:project) } let_it_be_with_reload(:import_state) { create(factory, :started, project: project, jid: '123') } let(:worker) { described_class.new } - let(:next_stage) { :finish } + let(:next_stage) { 'finish' } describe '#perform', :clean_gitlab_redis_shared_state do context 'when the project no longer exists' do @@ -60,7 +60,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:| end it 'schedules the next stage' do - next_worker = described_class::STAGES[next_stage] + next_worker = described_class::STAGES[next_stage.to_sym] expect_next_found_instance_of(import_state.class) do |state| expect(state).to receive(:refresh_jid_expiration) @@ -72,7 +72,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:| end it 'raises KeyError when the stage name is invalid' do - expect { worker.perform(project.id, { '123' => 2 }, :kittens) } + expect { worker.perform(project.id, { '123' => 2 }, 'kittens') } .to raise_error(KeyError) end end @@ -106,7 +106,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:| it 'advances to next stage' do freeze_time do - next_worker = described_class::STAGES[next_stage] + next_worker = described_class::STAGES[next_stage.to_sym] expect(next_worker).to receive(:perform_async).with(project.id) @@ -122,7 +122,7 @@ RSpec.shared_examples Gitlab::Import::AdvanceStage do |factory:| it 'logs error and fails import' do freeze_time do - next_worker = described_class::STAGES[next_stage] + next_worker = described_class::STAGES[next_stage.to_sym] expect(next_worker).not_to receive(:perform_async).with(project.id) expect_next_instance_of(described_class) do |klass| diff --git a/spec/support/shared_examples/lib/gitlab/middleware/multipart_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/middleware/multipart_shared_examples.rb index 16b048ae325..c17d022293d 100644 --- a/spec/support/shared_examples/lib/gitlab/middleware/multipart_shared_examples.rb +++ b/spec/support/shared_examples/lib/gitlab/middleware/multipart_shared_examples.rb @@ -8,7 +8,7 @@ RSpec.shared_examples 'handling all upload parameters conditions' do let(:params) { upload_parameters_for(filepath: uploaded_filepath, key: 'file', mode: mode, filename: filename, remote_id: remote_id) } it 'builds an UploadedFile' do - expect_uploaded_files(filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w(file)) + expect_uploaded_files(filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w[file]) subject end @@ -27,8 +27,8 @@ RSpec.shared_examples 'handling all upload parameters conditions' do it 'builds UploadedFiles' do expect_uploaded_files( [ - { filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w(file1) }, - { filepath: uploaded_filepath2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w(file2) } + { filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w[file1] }, + { filepath: uploaded_filepath2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w[file2] } ] ) @@ -43,7 +43,7 @@ RSpec.shared_examples 'handling all upload parameters conditions' do let(:params) { { 'user' => { 'avatar' => upload_parameters_for(filepath: uploaded_filepath, mode: mode, filename: filename, remote_id: remote_id) } } } it 'builds an UploadedFile' do - expect_uploaded_files(filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w(user avatar)) + expect_uploaded_files(filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w[user avatar]) subject end @@ -65,8 +65,8 @@ RSpec.shared_examples 'handling all upload parameters conditions' do it 'builds UploadedFiles' do expect_uploaded_files( [ - { filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w(user avatar) }, - { filepath: uploaded_filepath2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w(user screenshot) } + { filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w[user avatar] }, + { filepath: uploaded_filepath2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w[user screenshot] } ] ) @@ -81,7 +81,7 @@ RSpec.shared_examples 'handling all upload parameters conditions' do let(:params) { { 'user' => { 'avatar' => { 'bananas' => upload_parameters_for(filepath: uploaded_filepath, mode: mode, filename: filename, remote_id: remote_id) } } } } it 'builds an UploadedFile' do - expect_uploaded_files(filepath: uploaded_file, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w(user avatar bananas)) + expect_uploaded_files(filepath: uploaded_file, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w[user avatar bananas]) subject end @@ -107,8 +107,8 @@ RSpec.shared_examples 'handling all upload parameters conditions' do it 'builds UploadedFiles' do expect_uploaded_files( [ - { filepath: uploaded_file, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w(user avatar bananas) }, - { filepath: uploaded_file2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w(user friend ananas) } + { filepath: uploaded_file, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w[user avatar bananas] }, + { filepath: uploaded_file2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w[user friend ananas] } ] ) @@ -141,9 +141,9 @@ RSpec.shared_examples 'handling all upload parameters conditions' do it 'builds UploadedFiles' do expect_uploaded_files( [ - { filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w(file) }, - { filepath: uploaded_filepath2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w(user avatar) }, - { filepath: uploaded_filepath3, original_filename: filename3, remote_id: remote_id3, size: uploaded_file3.size, params_path: %w(user friend avatar) } + { filepath: uploaded_filepath, original_filename: filename, remote_id: remote_id, size: uploaded_file.size, params_path: %w[file] }, + { filepath: uploaded_filepath2, original_filename: filename2, remote_id: remote_id2, size: uploaded_file2.size, params_path: %w[user avatar] }, + { filepath: uploaded_filepath3, original_filename: filename3, remote_id: remote_id3, size: uploaded_file3.size, params_path: %w[user friend avatar] } ] ) diff --git a/spec/support/shared_examples/lib/sbom/package_url_shared_examples.rb b/spec/support/shared_examples/lib/sbom/package_url_shared_examples.rb new file mode 100644 index 00000000000..84faba20d31 --- /dev/null +++ b/spec/support/shared_examples/lib/sbom/package_url_shared_examples.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'purl_types enum' do + let(:purl_types) do + { + composer: 1, + conan: 2, + gem: 3, + golang: 4, + maven: 5, + npm: 6, + nuget: 7, + pypi: 8, + apk: 9, + rpm: 10, + deb: 11, + 'cbl-mariner': 12, + wolfi: 13 + } + end + + it { is_expected.to define_enum_for(:purl_type).with_values(purl_types) } +end diff --git a/spec/support/shared_examples/lib/wikis_api_examples.rb b/spec/support/shared_examples/lib/wikis_api_examples.rb index c57ac328a60..162a2b8ea49 100644 --- a/spec/support/shared_examples/lib/wikis_api_examples.rb +++ b/spec/support/shared_examples/lib/wikis_api_examples.rb @@ -53,7 +53,7 @@ RSpec.shared_examples_for 'wikis API returns wiki page' do specify do expect(response).to have_gitlab_http_status(:ok) - expect(json_response.size).to eq(5) + expect(json_response.size).to eq(6) expect(json_response.keys).to match_array(expected_keys_with_content) expect(json_response['content']).to eq(expected_content) expect(json_response['slug']).to eq(page.slug) @@ -118,7 +118,7 @@ RSpec.shared_examples_for 'wikis API creates wiki page' do post(api(url, user), params: payload) expect(response).to have_gitlab_http_status(:created) - expect(json_response.size).to eq(5) + expect(json_response.size).to eq(6) expect(json_response.keys).to match_array(expected_keys_with_content) expect(json_response['content']).to eq(payload[:content]) expect(json_response['slug']).to eq(payload[:title].tr(' ', '-')) @@ -145,7 +145,7 @@ RSpec.shared_examples_for 'wikis API updates wiki page' do put(api(url, user), params: payload) expect(response).to have_gitlab_http_status(:ok) - expect(json_response.size).to eq(5) + expect(json_response.size).to eq(6) expect(json_response.keys).to match_array(expected_keys_with_content) expect(json_response['content']).to eq(payload[:content]) expect(json_response['slug']).to eq(payload[:title].tr(' ', '-')) diff --git a/spec/support/shared_examples/mailers/notify_shared_examples.rb b/spec/support/shared_examples/mailers/notify_shared_examples.rb index 987060d73b9..f0d89f6ffaa 100644 --- a/spec/support/shared_examples/mailers/notify_shared_examples.rb +++ b/spec/support/shared_examples/mailers/notify_shared_examples.rb @@ -230,6 +230,8 @@ end RSpec.shared_examples 'an email with a labels subscriptions link in its footer' do it { is_expected.to have_body_text('label subscriptions') } + + it { is_expected.to have_body_text(%(href="#{project_labels_url(project, subscribed: true)}")) } end RSpec.shared_examples 'a note email' do diff --git a/spec/support/shared_examples/metrics/transaction_metrics_with_labels_shared_examples.rb b/spec/support/shared_examples/metrics/transaction_metrics_with_labels_shared_examples.rb index 286c60f1f4f..3fc52cdd86e 100644 --- a/spec/support/shared_examples/metrics/transaction_metrics_with_labels_shared_examples.rb +++ b/spec/support/shared_examples/metrics/transaction_metrics_with_labels_shared_examples.rb @@ -95,7 +95,7 @@ RSpec.shared_examples 'transaction metrics with labels' do expect(prometheus_metric).to receive(:increment).with(labels.merge(sane: 'yes'), 1) transaction_obj.increment(:block_labels, 1, sane: 'yes') do - label_keys %i(sane) + label_keys %i[sane] end end @@ -145,7 +145,7 @@ RSpec.shared_examples 'transaction metrics with labels' do expect(prometheus_metric).to receive(:set).with(labels.merge(sane: 'yes'), 99) transaction_obj.set(:block_labels_set, 99, sane: 'yes') do - label_keys %i(sane) + label_keys %i[sane] end end @@ -195,7 +195,7 @@ RSpec.shared_examples 'transaction metrics with labels' do expect(prometheus_metric).to receive(:observe).with(labels.merge(sane: 'yes'), 2.0) transaction_obj.observe(:block_labels_observe, 2.0, sane: 'yes') do - label_keys %i(sane) + label_keys %i[sane] end end diff --git a/spec/support/shared_examples/models/application_setting_shared_examples.rb b/spec/support/shared_examples/models/application_setting_shared_examples.rb index 6e7d04d3cba..70179dd7fc7 100644 --- a/spec/support/shared_examples/models/application_setting_shared_examples.rb +++ b/spec/support/shared_examples/models/application_setting_shared_examples.rb @@ -246,7 +246,7 @@ RSpec.shared_examples 'application settings examples' do context 'in FIPS mode', :fips_mode do it 'excludes DSA from supported key types' do - expect(setting.allowed_key_types).to contain_exactly(*Gitlab::SSHPublicKey.supported_types - %i(dsa)) + expect(setting.allowed_key_types).to contain_exactly(*Gitlab::SSHPublicKey.supported_types - %i[dsa]) end end @@ -297,7 +297,7 @@ RSpec.shared_examples 'application settings examples' do describe '#pick_repository_storage' do before do - allow(Gitlab.config.repositories.storages).to receive(:keys).and_return(%w(default backup)) + allow(Gitlab.config.repositories.storages).to receive(:keys).and_return(%w[default backup]) allow(setting).to receive(:repository_storages_weighted).and_return({ 'default' => 20, 'backup' => 80 }) end @@ -314,13 +314,13 @@ RSpec.shared_examples 'application settings examples' do using RSpec::Parameterized::TableSyntax where(:config_storages, :storages, :normalized) do - %w(default backup) | { 'default' => 0, 'backup' => 100 } | { 'default' => 0.0, 'backup' => 1.0 } - %w(default backup) | { 'default' => 100, 'backup' => 100 } | { 'default' => 0.5, 'backup' => 0.5 } - %w(default backup) | { 'default' => 20, 'backup' => 80 } | { 'default' => 0.2, 'backup' => 0.8 } - %w(default backup) | { 'default' => 0, 'backup' => 0 } | { 'default' => 0.0, 'backup' => 0.0 } - %w(default) | { 'default' => 0, 'backup' => 100 } | { 'default' => 0.0 } - %w(default) | { 'default' => 100, 'backup' => 100 } | { 'default' => 1.0 } - %w(default) | { 'default' => 20, 'backup' => 80 } | { 'default' => 1.0 } + %w[default backup] | { 'default' => 0, 'backup' => 100 } | { 'default' => 0.0, 'backup' => 1.0 } + %w[default backup] | { 'default' => 100, 'backup' => 100 } | { 'default' => 0.5, 'backup' => 0.5 } + %w[default backup] | { 'default' => 20, 'backup' => 80 } | { 'default' => 0.2, 'backup' => 0.8 } + %w[default backup] | { 'default' => 0, 'backup' => 0 } | { 'default' => 0.0, 'backup' => 0.0 } + %w[default] | { 'default' => 0, 'backup' => 100 } | { 'default' => 0.0 } + %w[default] | { 'default' => 100, 'backup' => 100 } | { 'default' => 1.0 } + %w[default] | { 'default' => 20, 'backup' => 80 } | { 'default' => 1.0 } end with_them do diff --git a/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb b/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb index 8deeecea30d..77327e9b539 100644 --- a/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb +++ b/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb @@ -42,6 +42,12 @@ RSpec.shared_examples 'can move repository storage' do .to change { container.repository_read_only? } .from(true).to(false) end + + it 'raises an error when the update fails' do + expect(container).to receive(:update_repository_read_only_column).and_return(false) + + expect { container.set_repository_writable! }.to raise_error(ActiveRecord::RecordNotSaved, /Database update failed/) + end end describe '#reference_counter' do diff --git a/spec/support/shared_examples/models/concerns/repository_storage_movable_shared_examples.rb b/spec/support/shared_examples/models/concerns/repository_storage_movable_shared_examples.rb index a9a13ddcd60..d8a8d1e1cea 100644 --- a/spec/support/shared_examples/models/concerns/repository_storage_movable_shared_examples.rb +++ b/spec/support/shared_examples/models/concerns/repository_storage_movable_shared_examples.rb @@ -5,6 +5,19 @@ RSpec.shared_examples 'handles repository moves' do it { is_expected.to belong_to(:container) } end + describe 'scopes' do + describe '.scheduled_or_started' do + subject { described_class.scheduled_or_started } + + let!(:initial) { create(repository_storage_factory_key, state: 1) } + let!(:scheduled) { create(repository_storage_factory_key, state: 2) } + let!(:started) { create(repository_storage_factory_key, state: 3) } + let!(:finished) { create(repository_storage_factory_key, state: 4) } + + it { is_expected.to contain_exactly(scheduled, started) } + end + end + describe 'validations' do it { is_expected.to validate_presence_of(:container) } it { is_expected.to validate_presence_of(:state) } @@ -59,9 +72,9 @@ RSpec.shared_examples 'handles repository moves' do end context 'when in the default state' do - subject(:storage_move) { create(repository_storage_factory_key, container: container, destination_storage_name: 'test_second_storage') } + let!(:storage_move) { create(repository_storage_factory_key, container: container, destination_storage_name: 'test_second_storage') } - context 'and transits to scheduled' do + context 'and transitions to scheduled' do it 'triggers the corresponding repository storage worker' do expect(repository_storage_worker).to receive(:perform_async).with(container.id, 'test_second_storage', storage_move.id) @@ -77,31 +90,37 @@ RSpec.shared_examples 'handles repository moves' do it 'does not trigger the corresponding repository storage worker and adds an error' do expect(repository_storage_worker).not_to receive(:perform_async) + storage_move.schedule! + expect(storage_move.errors[error_key]).to include('foobar') end it 'sets the state to failed' do expect(storage_move).to receive(:do_fail!).and_call_original + storage_move.schedule! + expect(storage_move.state_name).to eq(:failed) + expect(container).not_to be_repository_read_only end end end - context 'and transits to started' do + context 'and transitions to started' do it 'does not allow the transition' do - expect { storage_move.start! } - .to raise_error(StateMachines::InvalidTransition) + expect { storage_move.start! }.to raise_error(StateMachines::InvalidTransition) end end end context 'when started' do - subject(:storage_move) { create(repository_storage_factory_key, :started, container: container, destination_storage_name: 'test_second_storage') } + let!(:storage_move) { create(repository_storage_factory_key, :started, container: container, destination_storage_name: 'test_second_storage') } - context 'and transits to replicated' do + context 'and transitions to replicated' do it 'marks the container as writable' do + container.set_repository_read_only! + storage_move.finish_replication! expect(container).not_to be_repository_read_only @@ -109,12 +128,29 @@ RSpec.shared_examples 'handles repository moves' do it 'updates the updated_at column of the container', :aggregate_failures do expect { storage_move.finish_replication! }.to change { container.updated_at } + expect(storage_move.container.updated_at).to be >= storage_move.updated_at end end - context 'and transits to failed' do + context 'and transitions to failed' do it 'marks the container as writable' do + container.set_repository_read_only! + + storage_move.do_fail! + + expect(container).not_to be_repository_read_only + end + end + end + + context 'when replicated' do + let!(:storage_move) { create(repository_storage_factory_key, :replicated, container: container, destination_storage_name: 'test_second_storage') } + + context 'and transitions to cleanup_failed' do + it 'marks the container as writable' do + container.set_repository_read_only! + storage_move.do_fail! expect(container).not_to be_repository_read_only diff --git a/spec/support/shared_examples/models/diff_positionable_note_shared_examples.rb b/spec/support/shared_examples/models/diff_positionable_note_shared_examples.rb index eafa589a1d3..a6fcea62aba 100644 --- a/spec/support/shared_examples/models/diff_positionable_note_shared_examples.rb +++ b/spec/support/shared_examples/models/diff_positionable_note_shared_examples.rb @@ -48,7 +48,7 @@ RSpec.shared_examples 'a valid diff positionable note' do |factory_on_commit| end end - %i(original_position position change_position).each do |method| + %i[original_position position change_position].each do |method| describe "#{method}=" do it "doesn't accept non-hash JSON passed as a string" do subject.send(:"#{method}=", "true") diff --git a/spec/support/shared_examples/models/project_ci_cd_settings_shared_examples.rb b/spec/support/shared_examples/models/project_ci_cd_settings_shared_examples.rb index f1af1760e8d..3ecf58168b3 100644 --- a/spec/support/shared_examples/models/project_ci_cd_settings_shared_examples.rb +++ b/spec/support/shared_examples/models/project_ci_cd_settings_shared_examples.rb @@ -5,7 +5,7 @@ RSpec.shared_examples 'ci_cd_settings delegation' do context 'when ci_cd_settings is destroyed but project is not' do it 'allows methods delegated to ci_cd_settings to be nil', :aggregate_failures do - attributes = project.ci_cd_settings.attributes.keys - %w(id project_id) - exclude_attributes + attributes = project.ci_cd_settings.attributes.keys - %w[id project_id] - exclude_attributes expect(attributes).to match_array(attributes_with_prefix.keys) diff --git a/spec/support/shared_examples/models/users/pages_visits_shared_examples.rb b/spec/support/shared_examples/models/users/pages_visits_shared_examples.rb index 0b3e8516d25..ec7dc1fb8b9 100644 --- a/spec/support/shared_examples/models/users/pages_visits_shared_examples.rb +++ b/spec/support/shared_examples/models/users/pages_visits_shared_examples.rb @@ -6,6 +6,10 @@ RSpec.shared_examples 'namespace visits model' do it { is_expected.to validate_presence_of(:visited_at) } describe '#visited_around?' do + before do + described_class.create!(entity_id: entity.id, user_id: user.id, visited_at: base_time) + end + context 'when the checked time matches a recent visit' do [-15.minutes, 15.minutes].each do |time_diff| it 'returns true' do @@ -24,4 +28,104 @@ RSpec.shared_examples 'namespace visits model' do end end end + + describe '#frecent_visits_scores' do + def frecent_visits_scores_to_array(visits) + visits.map { |visit| [visit["entity_id"], visit["score"]] } + end + + context 'when there is lots of data' do + before do + create_visit_records + end + + it 'returns the frecent items, sorted by their frecency score' do + expect(frecent_visits_scores_to_array(described_class.frecent_visits_scores(user_id: user.id, + limit: 10))).to eq([[2, 31], [1, 30], [3, 28], [6, 6], [7, 6], [8, 6], [4, 6], [5, 6]]) + end + + it 'limits the amount of returned entries' do + expect(frecent_visits_scores_to_array(described_class.frecent_visits_scores(user_id: user.id, + limit: 2))).to eq([ + [2, 31], [1, 30] + ]) + end + end + + context 'when there is few data' do + before do + [ + # Multiplier: 4 + [1, Time.current], + + # Multiplier: 3 + [2, 2.weeks.ago], + [3, 2.weeks.ago], + + # Multiplier: 2 + [1, 3.weeks.ago], + [1, 3.weeks.ago], + + # Multiplier: 1 + [2, 5.weeks.ago] + ].each do |id, datetime| + described_class.create!(entity_id: id, user_id: user.id, visited_at: datetime) + end + end + + it 'returns the frecent items, sorted by their frecency score' do + expect(frecent_visits_scores_to_array(described_class.frecent_visits_scores(user_id: user.id, + limit: 5))).to eq([ + [1, 8], # Entity 1 gets a score of (1 * 4) + (2 * 2) = 8 + [2, 4], # Entity 2 gets a score of (1 * 3) + (1 * 1) = 4 + [3, 3] # Entity 3 gets a score of 1 * 3 = 3 + ]) + end + end + end + + private + + # rubocop: disable Metrics/AbcSize -- Despite being long, this method is quite straightforward. Splitting it in smaller chunks would likely harm readability more than anything. + def create_visit_records + [ + [1, Time.current], + + [2, 1.week.ago], + [2, 1.week.ago], + + [2, 2.weeks.ago], + [3, 2.weeks.ago], + [3, 2.weeks.ago], + [4, 2.weeks.ago], + [5, 2.weeks.ago], + [6, 2.weeks.ago], + [7, 2.weeks.ago], + [8, 2.weeks.ago], + + [1, 3.weeks.ago], + [1, 3.weeks.ago], + [3, 3.weeks.ago], + [3, 3.weeks.ago], + + [1, 4.weeks.ago], + [2, 4.weeks.ago], + [2, 4.weeks.ago], + + [3, 7.weeks.ago], + [3, 7.weeks.ago], + + [1, 8.weeks.ago], + [1, 8.weeks.ago], + [1, 8.weeks.ago], + [1, 8.weeks.ago], + + [2, 9.weeks.ago], + [2, 9.weeks.ago], + [2, 9.weeks.ago] + ].each do |id, datetime| + described_class.create!(entity_id: id, user_id: user.id, visited_at: datetime) + end + end + # rubocop: enable Metrics/AbcSize end diff --git a/spec/support/shared_examples/models/wiki_shared_examples.rb b/spec/support/shared_examples/models/wiki_shared_examples.rb index a0187252108..d731eec5680 100644 --- a/spec/support/shared_examples/models/wiki_shared_examples.rb +++ b/spec/support/shared_examples/models/wiki_shared_examples.rb @@ -14,7 +14,7 @@ RSpec.shared_examples 'wiki model' do subject { wiki } it 'VALID_USER_MARKUPS contains all valid markups' do - expect(described_class::VALID_USER_MARKUPS.keys).to match_array(%i(markdown rdoc asciidoc org)) + expect(described_class::VALID_USER_MARKUPS.keys).to match_array(%i[markdown rdoc asciidoc org]) end it 'container class includes HasWiki' do diff --git a/spec/support/shared_examples/path_extraction_shared_examples.rb b/spec/support/shared_examples/path_extraction_shared_examples.rb index d76348aa26a..5ceaf182d03 100644 --- a/spec/support/shared_examples/path_extraction_shared_examples.rb +++ b/spec/support/shared_examples/path_extraction_shared_examples.rb @@ -114,12 +114,12 @@ RSpec.shared_examples 'extracts refs' do it 'extracts a valid commit SHA' do expect(extract_ref('f4b14494ef6abf3d144c28e4af0c20143383e062/CHANGELOG')).to eq( - %w(f4b14494ef6abf3d144c28e4af0c20143383e062 CHANGELOG) + %w[f4b14494ef6abf3d144c28e4af0c20143383e062 CHANGELOG] ) end it 'falls back to a primitive split for an invalid ref' do - expect(extract_ref('stable/CHANGELOG')).to eq(%w(stable CHANGELOG)) + expect(extract_ref('stable/CHANGELOG')).to eq(%w[stable CHANGELOG]) end it 'extracts the longest matching ref' do diff --git a/spec/support/shared_examples/quick_actions/commit/tag_quick_action_shared_examples.rb b/spec/support/shared_examples/quick_actions/commit/tag_quick_action_shared_examples.rb index 14b384b149d..78b667cfe56 100644 --- a/spec/support/shared_examples/quick_actions/commit/tag_quick_action_shared_examples.rb +++ b/spec/support/shared_examples/quick_actions/commit/tag_quick_action_shared_examples.rb @@ -5,7 +5,7 @@ RSpec.shared_examples 'tag quick action' do it 'tags this commit' do add_note("/tag #{tag_name} #{tag_message}") - expect(page).to have_content %{Tagged this commit to #{tag_name} with "#{tag_message}".} + expect(page).to have_content %(Tagged this commit to #{tag_name} with "#{tag_message}".) expect(page).to have_content "tagged commit #{truncated_commit_sha}" expect(page).to have_content tag_name @@ -21,7 +21,7 @@ RSpec.shared_examples 'tag quick action' do preview_note("/tag #{tag_name} #{tag_message}") expect(page).not_to have_content '/tag' - expect(page).to have_content %{Tags this commit to #{tag_name} with "#{tag_message}"} + expect(page).to have_content %(Tags this commit to #{tag_name} with "#{tag_message}") expect(page).to have_content tag_name end end diff --git a/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb b/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb index 7cbaf40721a..71a8e2a15ce 100644 --- a/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb +++ b/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb @@ -54,7 +54,7 @@ RSpec.shared_examples 'close quick action' do |issuable_type| expect(issuable).to be_closed end - context "when current user cannot close #{issuable_type}" do + context "when current user cannot close #{issuable_type}", :js do before do guest = create(:user) project.add_guest(guest) diff --git a/spec/support/shared_examples/quick_actions/issue/create_merge_request_quick_action_shared_examples.rb b/spec/support/shared_examples/quick_actions/issue/create_merge_request_quick_action_shared_examples.rb index 9dc39c6cf73..27d850b8522 100644 --- a/spec/support/shared_examples/quick_actions/issue/create_merge_request_quick_action_shared_examples.rb +++ b/spec/support/shared_examples/quick_actions/issue/create_merge_request_quick_action_shared_examples.rb @@ -41,7 +41,7 @@ RSpec.shared_examples 'create_merge_request quick action' do expect(created_mr.source_branch).to eq(issue.to_branch_name) visit project_merge_request_path(project, created_mr) - expect(page).to have_content %{Draft: Resolve "#{issue.title}"} + expect(page).to have_content %(Draft: Resolve "#{issue.title}") end it 'creates a merge request using the given branch name' do @@ -54,7 +54,7 @@ RSpec.shared_examples 'create_merge_request quick action' do expect(created_mr.source_branch).to eq(branch_name) visit project_merge_request_path(project, created_mr) - expect(page).to have_content %{Draft: Resolve "#{issue.title}"} + expect(page).to have_content %(Draft: Resolve "#{issue.title}") end end end diff --git a/spec/support/shared_examples/redis/redis_shared_examples.rb b/spec/support/shared_examples/redis/redis_shared_examples.rb index 1270efd4701..f184f678283 100644 --- a/spec/support/shared_examples/redis/redis_shared_examples.rb +++ b/spec/support/shared_examples/redis/redis_shared_examples.rb @@ -365,6 +365,21 @@ RSpec.shared_examples "redis_shared_examples" do end end + describe '#secret_file' do + context 'when explicitly specified in config file' do + it 'returns the absolute path of specified file inside Rails root' do + allow(subject).to receive(:raw_config_hash).and_return({ secret_file: '/etc/gitlab/redis_secret.enc' }) + expect(subject.send(:secret_file)).to eq('/etc/gitlab/redis_secret.enc') + end + end + + context 'when not explicitly specified' do + it 'returns the default path in the encrypted settings shared directory' do + expect(subject.send(:secret_file)).to eq(Rails.root.join("shared/encrypted_settings/redis.yaml.enc").to_s) + end + end + end + describe "#parse_client_tls_options" do let(:dummy_certificate) { OpenSSL::X509::Certificate.new } let(:dummy_key) { OpenSSL::PKey::RSA.new } diff --git a/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb b/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb index 3ff52166990..e7fdf143887 100644 --- a/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb @@ -39,8 +39,8 @@ RSpec.shared_examples 'returns tags for allowed users' do |user_type, scope| let(:url) { "/#{scope}s/#{object.id}/registry/repositories?tags=true" } before do - stub_container_registry_tags(repository: root_repository.path, tags: %w(rootA latest), with_manifest: true) - stub_container_registry_tags(repository: test_repository.path, tags: %w(rootA latest), with_manifest: true) + stub_container_registry_tags(repository: root_repository.path, tags: %w[rootA latest], with_manifest: true) + stub_container_registry_tags(repository: test_repository.path, tags: %w[rootA latest], with_manifest: true) end it 'returns a list of repositories and their tags' do @@ -64,8 +64,8 @@ RSpec.shared_examples 'returns tags for allowed users' do |user_type, scope| let(:url) { "/#{scope}s/#{object.id}/registry/repositories?tags_count=true" } before do - stub_container_registry_tags(repository: root_repository.path, tags: %w(rootA latest), with_manifest: true) - stub_container_registry_tags(repository: test_repository.path, tags: %w(rootA latest), with_manifest: true) + stub_container_registry_tags(repository: root_repository.path, tags: %w[rootA latest], with_manifest: true) + stub_container_registry_tags(repository: test_repository.path, tags: %w[rootA latest], with_manifest: true) end it 'returns a list of repositories and their tags_count' do diff --git a/spec/support/shared_examples/requests/api/graphql/issue_list_shared_examples.rb b/spec/support/shared_examples/requests/api/graphql/issue_list_shared_examples.rb index c6e4aba6968..90fa0c98376 100644 --- a/spec/support/shared_examples/requests/api/graphql/issue_list_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/graphql/issue_list_shared_examples.rb @@ -5,7 +5,7 @@ RSpec.shared_examples 'graphql issue list request spec' do let(:fields) do <<~QUERY nodes { - #{all_graphql_fields_for('issues'.classify, excluded: ['relatedMergeRequests'])} + #{all_graphql_fields_for('issues'.classify, excluded: %w[relatedMergeRequests productAnalyticsState])} } QUERY end @@ -26,6 +26,18 @@ RSpec.shared_examples 'graphql issue list request spec' do issue_b.assignee_ids = another_user.id end + context 'when filtering by state' do + context 'when filtering by locked state' do + let(:issue_filter_params) { { state: :locked } } + + it 'returns an error message' do + post_query + + expect_graphql_errors_to_include(Types::IssuableStateEnum::INVALID_LOCKED_MESSAGE) + end + end + end + context 'when filtering by assignees' do context 'when both assignee_username filters are provided' do let(:issue_filter_params) do diff --git a/spec/support/shared_examples/requests/api/graphql/remote_development_shared_examples.rb b/spec/support/shared_examples/requests/api/graphql/remote_development_shared_examples.rb deleted file mode 100644 index 83e22945361..00000000000 --- a/spec/support/shared_examples/requests/api/graphql/remote_development_shared_examples.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -RSpec.shared_examples 'workspaces query in licensed environment and with feature flag on' do - describe 'when licensed and remote_development_feature_flag feature flag is enabled' do - before do - stub_licensed_features(remote_development: true) - - post_graphql(query, current_user: current_user) - end - - it_behaves_like 'a working graphql query' - - it { is_expected.to match_array(a_hash_including('name' => workspace.name)) } - - context 'when user is not authorized' do - let(:current_user) { create(:user) } - - it { is_expected.to eq([]) } - end - end -end - -RSpec.shared_examples 'workspaces query in unlicensed environment and with feature flag off' do - describe 'when remote_development feature is unlicensed' do - before do - stub_licensed_features(remote_development: false) - post_graphql(query, current_user: current_user) - end - - it 'returns an error' do - expect(subject).to be_nil - expect_graphql_errors_to_include(/'remote_development' licensed feature is not available/) - end - end - - describe 'when remote_development_feature_flag feature flag is disabled' do - before do - stub_licensed_features(remote_development: true) - stub_feature_flags(remote_development_feature_flag: false) - post_graphql(query, current_user: current_user) - end - - it 'returns an error' do - expect(subject).to be_nil - expect_graphql_errors_to_include(/'remote_development_feature_flag' feature flag is disabled/) - end - end -end diff --git a/spec/support/shared_examples/requests/api/graphql/work_item_list_shared_examples.rb b/spec/support/shared_examples/requests/api/graphql/work_item_list_shared_examples.rb index a9c422c8f2d..82f98b883dc 100644 --- a/spec/support/shared_examples/requests/api/graphql/work_item_list_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/graphql/work_item_list_shared_examples.rb @@ -46,6 +46,14 @@ RSpec.shared_examples 'graphql work item list request spec' do expect(work_item_ids).to include(closed_work_item.to_global_id.to_s) end end + + context 'when filtering by state locked' do + let(:item_filter_params) { { state: :locked } } + + it 'return an error message' do + expect_graphql_errors_to_include(Types::IssuableStateEnum::INVALID_LOCKED_MESSAGE) + end + end end context 'when filtering by type' do diff --git a/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb b/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb index 7803f0ff04d..9c20b95eb80 100644 --- a/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.shared_examples 'rejects helm packages access' do |user_type, status| +RSpec.shared_examples 'rejects helm packages access' do |user_type, status, body| context "for user type #{user_type}" do before do project.send("add_#{user_type}", user) if user_type != :anonymous && user_type != :not_a_member @@ -15,6 +15,14 @@ RSpec.shared_examples 'rejects helm packages access' do |user_type, status| expect(response.headers['WWW-Authenticate']).to eq 'Basic realm="GitLab Packages Registry"' end end + + if body + it 'has the correct body' do + subject + + expect(response.body).to eq(body) + end + end end end diff --git a/spec/support/shared_examples/requests/api/integrations/github_enterprise_jira_dvcs_end_of_life_shared_examples.rb b/spec/support/shared_examples/requests/api/integrations/github_enterprise_jira_dvcs_end_of_life_shared_examples.rb deleted file mode 100644 index 6799dec7b80..00000000000 --- a/spec/support/shared_examples/requests/api/integrations/github_enterprise_jira_dvcs_end_of_life_shared_examples.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.shared_examples 'a GitHub Enterprise Jira DVCS reversible end of life endpoint' do - it 'is a reachable endpoint' do - subject - - expect(response).not_to have_gitlab_http_status(:not_found) - end - - context 'when the flag is disabled' do - before do - stub_feature_flags(jira_dvcs_end_of_life_amnesty: false) - end - - it 'presents as an endpoint that does not exist' do - subject - - expect(response).to have_gitlab_http_status(:not_found) - end - end -end diff --git a/spec/support/shared_examples/requests/api/ml/mlflow/mlflow_shared_examples.rb b/spec/support/shared_examples/requests/api/ml/mlflow/mlflow_shared_examples.rb index 00e50b07909..7978f43610d 100644 --- a/spec/support/shared_examples/requests/api/ml/mlflow/mlflow_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/ml/mlflow/mlflow_shared_examples.rb @@ -74,6 +74,37 @@ RSpec.shared_examples 'MLflow|shared error cases' do end end +RSpec.shared_examples 'MLflow|shared model registry error cases' do + context 'when not authenticated' do + let(:headers) { {} } + + it "is Unauthorized" do + is_expected.to have_gitlab_http_status(:unauthorized) + end + end + + context 'when user does not have access' do + let(:access_token) { tokens[:different_user] } + + it "is Not Found" do + is_expected.to have_gitlab_http_status(:not_found) + end + end + + context 'when model registry is unavailable' do + before do + allow(Ability).to receive(:allowed?).and_call_original + allow(Ability).to receive(:allowed?) + .with(current_user, :read_model_registry, project) + .and_return(false) + end + + it "is Not Found" do + is_expected.to have_gitlab_http_status(:not_found) + end + end +end + RSpec.shared_examples 'MLflow|Bad Request on missing required' do |keys| keys.each do |key| context "when \"#{key}\" is missing" do diff --git a/spec/support/shared_examples/requests/api/multiple_and_scoped_issue_boards_shared_examples.rb b/spec/support/shared_examples/requests/api/multiple_and_scoped_issue_boards_shared_examples.rb index d749479544d..fa111ca5811 100644 --- a/spec/support/shared_examples/requests/api/multiple_and_scoped_issue_boards_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/multiple_and_scoped_issue_boards_shared_examples.rb @@ -5,7 +5,6 @@ RSpec.shared_examples 'multiple and scoped issue boards' do |route_definition| context 'multiple issue boards' do before do - stub_feature_flags(apollo_boards: false) board_parent.add_reporter(user) stub_licensed_features(multiple_group_issue_boards: true) end diff --git a/spec/support/shared_examples/requests/api/nuget_packages_shared_examples.rb b/spec/support/shared_examples/requests/api/nuget_packages_shared_examples.rb index f8e78c8c9b1..c23d514abfc 100644 --- a/spec/support/shared_examples/requests/api/nuget_packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/nuget_packages_shared_examples.rb @@ -699,6 +699,7 @@ RSpec.shared_examples 'nuget upload endpoint' do |symbol_package: false| end context 'when package duplicates are not allowed' do + let(:params) { { package: temp_file(file_name, content: File.open(expand_fixture_path('packages/nuget/package.nupkg'))) } } let(:headers) { basic_auth_header(deploy_token.username, deploy_token.token).merge(workhorse_headers) } let_it_be(:existing_package) { create(:nuget_package, project: project) } let_it_be(:metadata) { { package_name: existing_package.name, package_version: existing_package.version } } @@ -722,14 +723,6 @@ RSpec.shared_examples 'nuget upload endpoint' do |symbol_package: false| it_behaves_like 'returning response status', :created end - - context 'when nuget_duplicates_option feature flag is disabled' do - before do - stub_feature_flags(nuget_duplicates_option: false) - end - - it_behaves_like 'returning response status', :created - end end end diff --git a/spec/support/shared_examples/requests/api/repository_storage_moves_shared_examples.rb b/spec/support/shared_examples/requests/api/repository_storage_moves_shared_examples.rb index 3913d29e086..181bab41e09 100644 --- a/spec/support/shared_examples/requests/api/repository_storage_moves_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/repository_storage_moves_shared_examples.rb @@ -80,56 +80,9 @@ RSpec.shared_examples 'repository_storage_moves API' do |container_type| end end - describe "GET /#{container_type}/:id/repository_storage_moves" do - let(:container_id) { container.id } + shared_examples 'post single container repository storage move' do let(:url) { "/#{container_type}/#{container_id}/repository_storage_moves" } - - it_behaves_like 'get container repository storage move list' - - context 'non-existent container' do - let(:container_id) { non_existing_record_id } - - it 'returns not found' do - get api(url, user, admin_mode: user.admin?) - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - - describe "GET /#{container_type}/:id/repository_storage_moves/:repository_storage_move_id" do let(:container_id) { container.id } - let(:url) { "/#{container_type}/#{container_id}/repository_storage_moves/#{repository_storage_move_id}" } - - it_behaves_like 'get single container repository storage move' - - context 'non-existent container' do - let(:container_id) { non_existing_record_id } - let(:repository_storage_move_id) { storage_move.id } - - it 'returns not found' do - get api(url, user, admin_mode: user.admin?) - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - - describe "GET /#{container_type.singularize}_repository_storage_moves" do - it_behaves_like 'get container repository storage move list' do - let(:url) { "/#{container_type.singularize}_repository_storage_moves" } - end - end - - describe "GET /#{container_type.singularize}_repository_storage_moves/:repository_storage_move_id" do - it_behaves_like 'get single container repository storage move' do - let(:url) { "/#{container_type.singularize}_repository_storage_moves/#{repository_storage_move_id}" } - end - end - - describe "POST /#{container_type}/:id/repository_storage_moves", :aggregate_failures do - let(:container_id) { container.id } - let(:url) { "/#{container_type}/#{container_id}/repository_storage_moves" } let(:destination_storage_name) { 'test_second_storage' } def create_container_repository_storage_move @@ -186,6 +139,57 @@ RSpec.shared_examples 'repository_storage_moves API' do |container_type| end end + describe "GET /#{container_type}/:id/repository_storage_moves" do + let(:container_id) { container.id } + let(:url) { "/#{container_type}/#{container_id}/repository_storage_moves" } + + it_behaves_like 'get container repository storage move list' + + context 'non-existent container' do + let(:container_id) { non_existing_record_id } + + it 'returns not found' do + get api(url, user, admin_mode: user.admin?) + + expect(response).to have_gitlab_http_status(:not_found) + end + end + end + + describe "GET /#{container_type}/:id/repository_storage_moves/:repository_storage_move_id" do + let(:container_id) { container.id } + let(:url) { "/#{container_type}/#{container_id}/repository_storage_moves/#{repository_storage_move_id}" } + + it_behaves_like 'get single container repository storage move' + + context 'non-existent container' do + let(:container_id) { non_existing_record_id } + let(:repository_storage_move_id) { storage_move.id } + + it 'returns not found' do + get api(url, user, admin_mode: user.admin?) + + expect(response).to have_gitlab_http_status(:not_found) + end + end + end + + describe "GET /#{container_type.singularize}_repository_storage_moves" do + it_behaves_like 'get container repository storage move list' do + let(:url) { "/#{container_type.singularize}_repository_storage_moves" } + end + end + + describe "GET /#{container_type.singularize}_repository_storage_moves/:repository_storage_move_id" do + it_behaves_like 'get single container repository storage move' do + let(:url) { "/#{container_type.singularize}_repository_storage_moves/#{repository_storage_move_id}" } + end + end + + describe "POST /#{container_type}/:id/repository_storage_moves", :aggregate_failures do + it_behaves_like 'post single container repository storage move' + end + describe "POST /#{container_type.singularize}_repository_storage_moves" do let(:url) { "/#{container_type.singularize}_repository_storage_moves" } let(:source_storage_name) { 'default' } diff --git a/spec/support/shared_examples/requests/api/rubygems_packages_shared_examples.rb b/spec/support/shared_examples/requests/api/rubygems_packages_shared_examples.rb index da09d70c777..d7077180b91 100644 --- a/spec/support/shared_examples/requests/api/rubygems_packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/rubygems_packages_shared_examples.rb @@ -151,7 +151,7 @@ RSpec.shared_examples 'dependency endpoint success' do |user_type, status, add_m context 'with gems params' do let(:params) { { gems: 'foo,bar' } } - let(:expected_response) { Marshal.dump(%w(result result)) } + let(:expected_response) { Marshal.dump(%w[result result]) } it 'returns successfully', :aggregate_failures do service_result = double('DependencyResolverService', execute: ServiceResponse.success(payload: 'result')) diff --git a/spec/support/shared_examples/sends_git_audit_streaming_event_shared_examples.rb b/spec/support/shared_examples/sends_git_audit_streaming_event_shared_examples.rb index 2c2be0152a0..f91cf22f27e 100644 --- a/spec/support/shared_examples/sends_git_audit_streaming_event_shared_examples.rb +++ b/spec/support/shared_examples/sends_git_audit_streaming_event_shared_examples.rb @@ -14,7 +14,7 @@ RSpec.shared_examples 'sends git audit streaming event' do let(:project) { create(:project, :public, :repository, namespace: group) } before do - group.external_audit_event_destinations.create!(destination_url: 'http://example.com') + create(:external_audit_event_destination, group: group) project.add_developer(user) end @@ -38,7 +38,7 @@ RSpec.shared_examples 'sends git audit streaming event' do let(:project) { create(:project, :private, :repository, namespace: group) } before do - group.external_audit_event_destinations.create!(destination_url: 'http://example.com') + create(:external_audit_event_destination, group: group) project.add_developer(user) sign_in(user) end @@ -52,9 +52,40 @@ RSpec.shared_examples 'sends git audit streaming event' do request.headers.merge! auth_env(user.username, password, nil) end end - it 'sends the audit streaming event' do - expect(AuditEvents::AuditEventStreamingWorker).to receive(:perform_async).once - subject + + context 'when log_git_streaming_audit_events is enable' do + it 'does not send the audit streaming event' do + expect(AuditEvents::AuditEventStreamingWorker).not_to receive(:perform_async) + subject + end + + it 'respond the need audit to be true' do + subject + + expect(response).to have_gitlab_http_status(:ok) + + audit_flag = json_response["need_audit"] || json_response["NeedAudit"] + expect(audit_flag).to be_truthy + end + end + + context 'when log_git_streaming_audit_events is disable' do + before do + stub_feature_flags(log_git_streaming_audit_events: false) + end + + it "sends git streaming audit event" do + expect(AuditEvents::AuditEventStreamingWorker).to receive(:perform_async).once + + subject + end + + it 'respond the need audit to be false' do + subject + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response["need_audit"]).to be_falsy + end end end end diff --git a/spec/support/shared_examples/serializers/environment_serializer_shared_examples.rb b/spec/support/shared_examples/serializers/environment_serializer_shared_examples.rb index 9eaad541df7..b7247f1f243 100644 --- a/spec/support/shared_examples/serializers/environment_serializer_shared_examples.rb +++ b/spec/support/shared_examples/serializers/environment_serializer_shared_examples.rb @@ -48,7 +48,7 @@ RSpec.shared_examples 'avoid N+1 on environments serialization' do query ||= { page: 1, per_page: 20 } request = double(url: "#{Gitlab.config.gitlab.url}:8080/api/v4/projects?#{query.to_query}", query_parameters: query) - EnvironmentSerializer.new(current_user: user, project: project).yield_self do |serializer| + EnvironmentSerializer.new(current_user: user, project: project).then do |serializer| serializer.within_folders if grouping serializer.with_pagination(request, spy('response')) serializer.represent(Environment.where(project: project)) diff --git a/spec/support/shared_examples/services/container_registry_auth_service_shared_examples.rb b/spec/support/shared_examples/services/container_registry_auth_service_shared_examples.rb index 6abf8b242f1..f6be45b0cf8 100644 --- a/spec/support/shared_examples/services/container_registry_auth_service_shared_examples.rb +++ b/spec/support/shared_examples/services/container_registry_auth_service_shared_examples.rb @@ -127,7 +127,7 @@ end RSpec.shared_examples 'a pullable and pushable' do it_behaves_like 'an accessible' do - let(:actions) { %w(pull push) } + let(:actions) { %w[pull push] } end end diff --git a/spec/support/shared_examples/services/notification_service_shared_examples.rb b/spec/support/shared_examples/services/notification_service_shared_examples.rb index df1ae67a590..c53872ca4bc 100644 --- a/spec/support/shared_examples/services/notification_service_shared_examples.rb +++ b/spec/support/shared_examples/services/notification_service_shared_examples.rb @@ -45,7 +45,7 @@ RSpec.shared_examples 'group emails are disabled' do before do reset_delivered_emails! - target_group.clear_memoization(:emails_disabled_memoized) + target_group.clear_memoization(:emails_enabled_memoized) end it 'sends no emails with group emails disabled' do diff --git a/spec/support/shared_examples/services/protected_branches_shared_examples.rb b/spec/support/shared_examples/services/protected_branches_shared_examples.rb index 15c63865720..80e2f09ed44 100644 --- a/spec/support/shared_examples/services/protected_branches_shared_examples.rb +++ b/spec/support/shared_examples/services/protected_branches_shared_examples.rb @@ -23,3 +23,34 @@ RSpec.shared_context 'with scan result policy blocking protected branches' do stub_licensed_features(security_orchestration_policies: true) end end + +RSpec.shared_context 'with scan result policy preventing force pushing' do + include RepoHelpers + + let(:policy_path) { Security::OrchestrationPolicyConfiguration::POLICY_PATH } + let(:default_branch) { policy_project.default_branch } + let(:prevent_pushing_and_force_pushing) { true } + + let(:scan_result_policy) do + build(:scan_result_policy, branches: [branch_name], + approval_settings: { prevent_pushing_and_force_pushing: prevent_pushing_and_force_pushing }) + end + + let(:policy_yaml) do + build(:orchestration_policy_yaml, scan_result_policy: [scan_result_policy]) + end + + before do + create_file_in_repo(policy_project, default_branch, default_branch, policy_path, policy_yaml) + stub_licensed_features(security_orchestration_policies: true) + end + + after do + policy_project.repository.delete_file( + policy_project.creator, + policy_path, + message: 'Automatically deleted policy', + branch_name: default_branch + ) + end +end diff --git a/spec/support/shared_examples/validators/url_validator_shared_examples.rb b/spec/support/shared_examples/validators/url_validator_shared_examples.rb index c5a775fefb6..8547845d0c3 100644 --- a/spec/support/shared_examples/validators/url_validator_shared_examples.rb +++ b/spec/support/shared_examples/validators/url_validator_shared_examples.rb @@ -24,7 +24,7 @@ RSpec.shared_examples 'url validator examples' do |schemes| end context 'with schemes' do - let(:options) { { schemes: %w(http) } } + let(:options) { { schemes: %w[http] } } it 'allows urls with the defined schemes' do subject diff --git a/spec/support/shared_examples/views/themed_layout_examples.rb b/spec/support/shared_examples/views/themed_layout_examples.rb index 599fd141dd7..ffbc9026240 100644 --- a/spec/support/shared_examples/views/themed_layout_examples.rb +++ b/spec/support/shared_examples/views/themed_layout_examples.rb @@ -8,7 +8,7 @@ RSpec.shared_examples "a layout which reflects the application theme setting" do it 'renders with the default theme' do render - expect(rendered).to have_selector("body.#{default_theme_class}") + expect(rendered).to have_selector("html.#{default_theme_class}") end end @@ -24,10 +24,10 @@ RSpec.shared_examples "a layout which reflects the application theme setting" do render if chosen_theme.css_class != default_theme_class - expect(rendered).not_to have_selector("body.#{default_theme_class}") + expect(rendered).not_to have_selector("html.#{default_theme_class}") end - expect(rendered).to have_selector("body.#{chosen_theme.css_class}") + expect(rendered).to have_selector("html.#{chosen_theme.css_class}") end end end diff --git a/spec/support/sidekiq_middleware.rb b/spec/support/sidekiq_middleware.rb index 73f43487d7c..f4d90ff5151 100644 --- a/spec/support/sidekiq_middleware.rb +++ b/spec/support/sidekiq_middleware.rb @@ -7,7 +7,7 @@ module SidekiqMiddleware def with_sidekiq_server_middleware(&block) Sidekiq::Testing.server_middleware.clear - if Gem::Version.new(Sidekiq::VERSION) != Gem::Version.new('6.5.7') + if Gem::Version.new(Sidekiq::VERSION) != Gem::Version.new('6.5.12') raise 'New version of sidekiq detected, please remove this line' end |