diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/support/helpers | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/support/helpers')
19 files changed, 195 insertions, 141 deletions
diff --git a/spec/support/helpers/api_internal_base_helpers.rb b/spec/support/helpers/api_internal_base_helpers.rb index 94996f7480e..e89716571f9 100644 --- a/spec/support/helpers/api_internal_base_helpers.rb +++ b/spec/support/helpers/api_internal_base_helpers.rb @@ -1,6 +1,10 @@ # frozen_string_literal: true +require_relative 'gitlab_shell_helpers' + module APIInternalBaseHelpers + include GitlabShellHelpers + def gl_repository_for(container) case container when ProjectWiki @@ -33,9 +37,9 @@ module APIInternalBaseHelpers project: full_path_for(container), gl_repository: gl_repository_for(container), action: 'git-upload-pack', - secret_token: secret_token, protocol: protocol - } + }, + headers: gitlab_shell_internal_api_request_header ) end @@ -56,7 +60,6 @@ module APIInternalBaseHelpers key_id: key.id, project: full_path, action: 'git-receive-pack', - secret_token: secret_token, protocol: protocol, env: env } @@ -64,7 +67,8 @@ module APIInternalBaseHelpers post( api("/internal/allowed"), - params: params + params: params, + headers: gitlab_shell_internal_api_request_header ) end @@ -77,9 +81,9 @@ module APIInternalBaseHelpers project: full_path_for(container), gl_repository: gl_repository_for(container), action: 'git-upload-archive', - secret_token: secret_token, protocol: 'ssh' - } + }, + headers: gitlab_shell_internal_api_request_header ) end end diff --git a/spec/support/helpers/ci/template_helpers.rb b/spec/support/helpers/ci/template_helpers.rb index 119f8d001a1..2e9b6f748cd 100644 --- a/spec/support/helpers/ci/template_helpers.rb +++ b/spec/support/helpers/ci/template_helpers.rb @@ -2,10 +2,6 @@ module Ci module TemplateHelpers - def secure_analyzers_prefix - 'registry.gitlab.com/security-products' - end - def template_registry_host 'registry.gitlab.com' end diff --git a/spec/support/helpers/create_environments_helpers.rb b/spec/support/helpers/create_environments_helpers.rb index be105f5862b..361d365dc5b 100644 --- a/spec/support/helpers/create_environments_helpers.rb +++ b/spec/support/helpers/create_environments_helpers.rb @@ -7,7 +7,7 @@ module CreateEnvironmentsHelpers start_review = create(:ci_build, :start_review_app, :success, **common, pipeline: pipeline) stop_review = create(:ci_build, :stop_review_app, :manual, **common, pipeline: pipeline) environment = create(:environment, :auto_stoppable, project: project, name: ref) - create(:deployment, :success, **common, on_stop: stop_review.name, - deployable: start_review, environment: environment) + create(:deployment, :success, **common, + on_stop: stop_review.name, deployable: start_review, environment: environment) end end diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index 05e9a099a2b..6d41d7b7414 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -7,7 +7,7 @@ module CycleAnalyticsHelpers def path_nav_stage_names_without_median # Returns the path names with the median value stripped out - page.all('.gl-path-button').collect(&:text).map {|name_with_median| name_with_median.split("\n")[0] } + page.all('.gl-path-button').collect(&:text).map { |name_with_median| name_with_median.split("\n")[0] } end def fill_in_custom_stage_fields diff --git a/spec/support/helpers/database/partitioning_helpers.rb b/spec/support/helpers/database/partitioning_helpers.rb index 80b31fe0603..889652a9252 100644 --- a/spec/support/helpers/database/partitioning_helpers.rb +++ b/spec/support/helpers/database/partitioning_helpers.rb @@ -79,8 +79,8 @@ module Database SQL end - def find_partitions(partition, schema: Gitlab::Database::DYNAMIC_PARTITIONS_SCHEMA) - connection.select_rows(<<~SQL) + def find_partitions(partition, schema: Gitlab::Database::DYNAMIC_PARTITIONS_SCHEMA, conn: connection) + conn.select_rows(<<~SQL) select pg_class.relname from pg_class diff --git a/spec/support/helpers/gitlab_shell_helpers.rb b/spec/support/helpers/gitlab_shell_helpers.rb new file mode 100644 index 00000000000..aa0cec22727 --- /dev/null +++ b/spec/support/helpers/gitlab_shell_helpers.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module GitlabShellHelpers + extend self + + def gitlab_shell_internal_api_request_header( + issuer: API::Helpers::GITLAB_SHELL_JWT_ISSUER, secret_token: Gitlab::Shell.secret_token) + jwt_token = JSONWebToken::HMACToken.new(secret_token).tap do |token| + token.issuer = issuer + end + + { API::Helpers::GITLAB_SHELL_API_HEADER => jwt_token.encoded } + end +end diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb index d78c523decd..9d745f2cb70 100644 --- a/spec/support/helpers/graphql_helpers.rb +++ b/spec/support/helpers/graphql_helpers.rb @@ -130,11 +130,12 @@ module GraphqlHelpers current_user: :not_given, # The current user (specified explicitly, overrides ctx[:current_user]) schema: GitlabSchema, # A specific schema instance object_type: described_class, # The `BaseObject` type this field belongs to - arg_style: :internal_prepared # Args are in internal format, but should use more rigorous processing + arg_style: :internal_prepared, # Args are in internal format, but should use more rigorous processing + query: nil # Query to evaluate the field ) field = to_base_field(field, object_type) ctx[:current_user] = current_user unless current_user == :not_given - query = GraphQL::Query.new(schema, context: ctx.to_h) + query ||= GraphQL::Query.new(schema, context: ctx.to_h) extras[:lookahead] = negative_lookahead if extras[:lookahead] == :not_given && field.extras.include?(:lookahead) query_ctx = query.context @@ -857,6 +858,8 @@ module GraphqlHelpers def positive_lookahead double(selects?: true).tap do |selection| allow(selection).to receive(:selection).and_return(selection) + allow(selection).to receive(:selections).and_return(selection) + allow(selection).to receive(:map).and_return(double(include?: true)) end end diff --git a/spec/support/helpers/html_escaped_helpers.rb b/spec/support/helpers/html_escaped_helpers.rb new file mode 100644 index 00000000000..7f6825e9598 --- /dev/null +++ b/spec/support/helpers/html_escaped_helpers.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module HtmlEscapedHelpers + extend self + + # Checks if +content+ contains HTML escaped tags and returns its match. + # + # It matches escaped opening and closing tags `<<name>` and + # `</<name>`. The match is discarded if the tag is inside a quoted + # attribute value. + # Foor example, `<div title="We allow # <b>bold</b>">`. + # + # @return [MatchData, nil] Returns the match or +nil+ if no match was found. + def match_html_escaped_tags(content) + match_data = %r{<\s*(?:/\s*)?\w+}.match(content) + return unless match_data + + # Escaped HTML tags are allowed inside quoted attribute values like: + # `title="Press <back>"` + return if %r{=\s*["'][^>]*\z}.match?(match_data.pre_match) + + match_data + end +end diff --git a/spec/support/helpers/javascript_form_helper.rb b/spec/support/helpers/javascript_form_helper.rb new file mode 100644 index 00000000000..41c5ba4373b --- /dev/null +++ b/spec/support/helpers/javascript_form_helper.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module JavascriptFormHelper + def prevent_submit_for(query_selector) + execute_script("document.querySelector('#{query_selector}').addEventListener('submit', e => e.preventDefault())") + end +end diff --git a/spec/support/helpers/kubernetes_helpers.rb b/spec/support/helpers/kubernetes_helpers.rb index dd210f02ae7..912e7d24b25 100644 --- a/spec/support/helpers/kubernetes_helpers.rb +++ b/spec/support/helpers/kubernetes_helpers.rb @@ -880,7 +880,7 @@ module KubernetesHelpers containers.map do |container| terminal = { selectors: { pod: pod_name, container: container['name'] }, - url: container_exec_url(service.api_url, pod_namespace, pod_name, container['name']), + url: container_exec_url(service.api_url, pod_namespace, pod_name, container['name']), subprotocols: ['channel.k8s.io'], headers: { 'Authorization' => ["Bearer #{service.token}"] }, created_at: DateTime.parse(pod['metadata']['creationTimestamp']), diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb index d966fd13dca..87a1f5459ec 100644 --- a/spec/support/helpers/login_helpers.rb +++ b/spec/support/helpers/login_helpers.rb @@ -122,7 +122,7 @@ module LoginHelpers def register_via(provider, uid, email, additional_info: {}) mock_auth_hash(provider, uid, email, additional_info: additional_info) visit new_user_registration_path - expect(page).to have_content('Create an account using') + expect(page).to have_content('Create an account using').or(have_content('Register with')) click_link_or_button "oauth-login-#{provider}" end diff --git a/spec/support/helpers/migrations_helpers/work_item_types_helper.rb b/spec/support/helpers/migrations_helpers/work_item_types_helper.rb index 59b1f1b1305..b05caf265ee 100644 --- a/spec/support/helpers/migrations_helpers/work_item_types_helper.rb +++ b/spec/support/helpers/migrations_helpers/work_item_types_helper.rb @@ -3,11 +3,11 @@ module MigrationHelpers module WorkItemTypesHelper DEFAULT_WORK_ITEM_TYPES = { - issue: { name: 'Issue', icon_name: 'issue-type-issue', enum_value: 0 }, - incident: { name: 'Incident', icon_name: 'issue-type-incident', enum_value: 1 }, - test_case: { name: 'Test Case', icon_name: 'issue-type-test-case', enum_value: 2 }, + issue: { name: 'Issue', icon_name: 'issue-type-issue', enum_value: 0 }, + incident: { name: 'Incident', icon_name: 'issue-type-incident', enum_value: 1 }, + test_case: { name: 'Test Case', icon_name: 'issue-type-test-case', enum_value: 2 }, requirement: { name: 'Requirement', icon_name: 'issue-type-requirements', enum_value: 3 }, - task: { name: 'Task', icon_name: 'issue-type-task', enum_value: 4 } + task: { name: 'Task', icon_name: 'issue-type-task', enum_value: 4 } }.freeze def reset_work_item_types diff --git a/spec/support/helpers/navbar_structure_helper.rb b/spec/support/helpers/navbar_structure_helper.rb index e11548d0b75..b44552d6479 100644 --- a/spec/support/helpers/navbar_structure_helper.rb +++ b/spec/support/helpers/navbar_structure_helper.rb @@ -34,7 +34,7 @@ module NavbarStructureHelper insert_after_nav_item( within, new_nav_item: { - nav_item: _('Packages & Registries'), + nav_item: _('Packages and registries'), nav_sub_items: [_('Package Registry')] } ) @@ -56,7 +56,7 @@ module NavbarStructureHelper def insert_container_nav insert_after_sub_nav_item( _('Package Registry'), - within: _('Packages & Registries'), + within: _('Packages and registries'), new_sub_nav_item_name: _('Container Registry') ) end @@ -64,7 +64,7 @@ module NavbarStructureHelper def insert_dependency_proxy_nav insert_after_sub_nav_item( _('Package Registry'), - within: _('Packages & Registries'), + within: _('Packages and registries'), new_sub_nav_item_name: _('Dependency Proxy') ) end @@ -72,7 +72,7 @@ module NavbarStructureHelper def insert_infrastructure_registry_nav insert_after_sub_nav_item( _('Package Registry'), - within: _('Packages & Registries'), + within: _('Packages and registries'), new_sub_nav_item_name: _('Infrastructure Registry') ) end @@ -80,11 +80,21 @@ module NavbarStructureHelper def insert_harbor_registry_nav(within) insert_after_sub_nav_item( within, - within: _('Packages & Registries'), + within: _('Packages and registries'), new_sub_nav_item_name: _('Harbor Registry') ) end + def insert_observability_nav + insert_after_nav_item( + _('Kubernetes'), + new_nav_item: { + nav_item: _('Observability'), + nav_sub_items: [] + } + ) + end + def insert_infrastructure_google_cloud_nav insert_after_sub_nav_item( _('Terraform'), diff --git a/spec/support/helpers/seed_helper.rb b/spec/support/helpers/seed_helper.rb index 59723583cbc..9628762d46a 100644 --- a/spec/support/helpers/seed_helper.rb +++ b/spec/support/helpers/seed_helper.rb @@ -29,8 +29,8 @@ module SeedHelper def create_bare_seeds system(git_env, *%W(#{Gitlab.config.git.bin_path} clone --bare #{GITLAB_GIT_TEST_REPO_URL}), chdir: SEED_STORAGE_PATH, - out: '/dev/null', - err: '/dev/null') + out: '/dev/null', + err: '/dev/null') end def create_normal_seeds diff --git a/spec/support/helpers/snowplow_helpers.rb b/spec/support/helpers/snowplow_helpers.rb index c8b194919ed..265e1c38b09 100644 --- a/spec/support/helpers/snowplow_helpers.rb +++ b/spec/support/helpers/snowplow_helpers.rb @@ -7,7 +7,7 @@ module SnowplowHelpers # # Examples: # - # describe '#show', :snowplow do + # describe '#show' do # it 'tracks snowplow events' do # get :show # @@ -15,7 +15,7 @@ module SnowplowHelpers # end # end # - # describe '#create', :snowplow do + # describe '#create' do # it 'tracks snowplow events' do # post :create # diff --git a/spec/support/helpers/stub_configuration.rb b/spec/support/helpers/stub_configuration.rb index 20f46396424..c08e35912c3 100644 --- a/spec/support/helpers/stub_configuration.rb +++ b/spec/support/helpers/stub_configuration.rb @@ -104,6 +104,10 @@ module StubConfiguration .to receive(:sentry_clientside_dsn) { clientside_dsn } end + def stub_microsoft_graph_mailer_setting(messages) + allow(Gitlab.config.microsoft_graph_mailer).to receive_messages(to_settings(messages)) + end + def stub_kerberos_setting(messages) allow(Gitlab.config.kerberos).to receive_messages(to_settings(messages)) end diff --git a/spec/support/helpers/stub_object_storage.rb b/spec/support/helpers/stub_object_storage.rb index 024f06cae1b..661c1c683b0 100644 --- a/spec/support/helpers/stub_object_storage.rb +++ b/spec/support/helpers/stub_object_storage.rb @@ -3,8 +3,8 @@ module StubObjectStorage def stub_dependency_proxy_object_storage(**params) stub_object_storage_uploader(config: ::Gitlab.config.dependency_proxy.object_store, - uploader: ::DependencyProxy::FileUploader, - **params) + uploader: ::DependencyProxy::FileUploader, + **params) end def stub_object_storage_uploader( diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index 03e9ad1a08e..691f978550a 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -10,85 +10,86 @@ module TestEnv # When developing the seed repository, comment out the branch you will modify. BRANCH_SHA = { - 'signed-commits' => 'c7794c1', - 'not-merged-branch' => 'b83d6e3', - 'branch-merged' => '498214d', - 'empty-branch' => '7efb185', - 'ends-with.json' => '98b0d8b', - 'flatten-dir' => 'e56497b', - 'feature' => '0b4bc9a', - 'feature_conflict' => 'bb5206f', - 'fix' => '48f0be4', - 'improve/awesome' => '5937ac0', - 'merged-target' => '21751bf', - 'markdown' => '0ed8c6c', - 'lfs' => '55bc176', - 'master' => 'b83d6e3', - 'merge-test' => '5937ac0', - "'test'" => 'e56497b', - 'orphaned-branch' => '45127a9', - 'binary-encoding' => '7b1cf43', - 'gitattributes' => '5a62481', - 'expand-collapse-diffs' => '4842455', - 'symlink-expand-diff' => '81e6355', - 'diff-files-symlink-to-image' => '8cfca84', - 'diff-files-image-to-symlink' => '3e94fda', - 'diff-files-symlink-to-text' => '689815e', - 'diff-files-text-to-symlink' => '5e2c270', - 'expand-collapse-files' => '025db92', - 'expand-collapse-lines' => '238e82d', - 'pages-deploy' => '7897d5b', - 'pages-deploy-target' => '7975be0', - 'audio' => 'c3c21fd', - 'video' => '8879059', - 'crlf-diff' => '5938907', - 'conflict-start' => '824be60', - 'conflict-resolvable' => '1450cd6', - 'conflict-binary-file' => '259a6fb', + 'signed-commits' => 'c7794c1', + 'not-merged-branch' => 'b83d6e3', + 'branch-merged' => '498214d', + 'empty-branch' => '7efb185', + 'ends-with.json' => '98b0d8b', + 'flatten-dir' => 'e56497b', + 'feature' => '0b4bc9a', + 'feature_conflict' => 'bb5206f', + 'fix' => '48f0be4', + 'improve/awesome' => '5937ac0', + 'merged-target' => '21751bf', + 'markdown' => '0ed8c6c', + 'lfs' => '55bc176', + 'master' => 'b83d6e391c22777fca1ed3012fce84f633d7fed0', + 'merge-test' => '5937ac0', + "'test'" => 'e56497b', + 'orphaned-branch' => '45127a9', + 'binary-encoding' => '7b1cf43', + 'gitattributes' => '5a62481', + 'expand-collapse-diffs' => '4842455', + 'symlink-expand-diff' => '81e6355', + 'diff-files-symlink-to-image' => '8cfca84', + 'diff-files-image-to-symlink' => '3e94fda', + 'diff-files-symlink-to-text' => '689815e', + 'diff-files-text-to-symlink' => '5e2c270', + 'expand-collapse-files' => '025db92', + 'expand-collapse-lines' => '238e82d', + 'pages-deploy' => '7897d5b', + 'pages-deploy-target' => '7975be0', + 'audio' => 'c3c21fd', + 'video' => '8879059', + 'crlf-diff' => '5938907', + 'conflict-start' => '824be60', + 'conflict-resolvable' => '1450cd6', + 'conflict-binary-file' => '259a6fb', 'conflict-contains-conflict-markers' => '78a3086', - 'conflict-missing-side' => 'eb227b3', - 'conflict-non-utf8' => 'd0a293c', - 'conflict-too-large' => '39fa04f', - 'deleted-image-test' => '6c17798', - 'wip' => 'b9238ee', - 'csv' => '3dd0896', - 'v1.1.0' => 'b83d6e3', - 'add-ipython-files' => '4963fef', - 'add-pdf-file' => 'e774ebd', - 'squash-large-files' => '54cec52', - 'add-pdf-text-binary' => '79faa7b', - 'add_images_and_changes' => '010d106', - 'update-gitlab-shell-v-6-0-1' => '2f61d70', - 'update-gitlab-shell-v-6-0-3' => 'de78448', - 'merge-commit-analyze-before' => '1adbdef', - 'merge-commit-analyze-side-branch' => '8a99451', - 'merge-commit-analyze-after' => '646ece5', - 'snippet/single-file' => '43e4080aaa14fc7d4b77ee1f5c9d067d5a7df10e', - 'snippet/multiple-files' => '40232f7eb98b3f221886432def6e8bab2432add9', - 'snippet/rename-and-edit-file' => '220a1e4b4dff37feea0625a7947a4c60fbe78365', - 'snippet/edit-file' => 'c2f074f4f26929c92795a75775af79a6ed6d8430', - 'snippet/no-files' => '671aaa842a4875e5f30082d1ab6feda345fdb94d', - '2-mb-file' => 'bf12d25', - 'before-create-delete-modify-move' => '845009f', - 'between-create-delete-modify-move' => '3f5f443', - 'after-create-delete-modify-move' => 'ba3faa7', - 'with-codeowners' => '219560e', - 'submodule_inside_folder' => 'b491b92', - 'png-lfs' => 'fe42f41', - 'sha-starting-with-large-number' => '8426165', - 'invalid-utf8-diff-paths' => '99e4853', - 'compare-with-merge-head-source' => 'f20a03d', - 'compare-with-merge-head-target' => '2f1e176', - 'trailers' => 'f0a5ed6', - 'add_commit_with_5mb_subject' => '8cf8e80', - 'blame-on-renamed' => '32c33da', - 'with-executables' => '6b8dc4a', - 'spooky-stuff' => 'ba3343b', - 'few-commits' => '0031876', - 'two-commits' => '304d257', - 'utf-16' => 'f05a987', - 'gitaly-rename-test' => '94bb47c', - 'smime-signed-commits' => 'ed775cc' + 'conflict-missing-side' => 'eb227b3', + 'conflict-non-utf8' => 'd0a293c', + 'conflict-too-large' => '39fa04f', + 'deleted-image-test' => '6c17798', + 'wip' => 'b9238ee', + 'csv' => '3dd0896', + 'v1.1.0' => 'b83d6e3', + 'add-ipython-files' => '4963fef', + 'add-pdf-file' => 'e774ebd', + 'squash-large-files' => '54cec52', + 'add-pdf-text-binary' => '79faa7b', + 'add_images_and_changes' => '010d106', + 'update-gitlab-shell-v-6-0-1' => '2f61d70', + 'update-gitlab-shell-v-6-0-3' => 'de78448', + 'merge-commit-analyze-before' => '1adbdef', + 'merge-commit-analyze-side-branch' => '8a99451', + 'merge-commit-analyze-after' => '646ece5', + 'snippet/single-file' => '43e4080aaa14fc7d4b77ee1f5c9d067d5a7df10e', + 'snippet/multiple-files' => '40232f7eb98b3f221886432def6e8bab2432add9', + 'snippet/rename-and-edit-file' => '220a1e4b4dff37feea0625a7947a4c60fbe78365', + 'snippet/edit-file' => 'c2f074f4f26929c92795a75775af79a6ed6d8430', + 'snippet/no-files' => '671aaa842a4875e5f30082d1ab6feda345fdb94d', + '2-mb-file' => 'bf12d25', + 'before-create-delete-modify-move' => '845009f', + 'between-create-delete-modify-move' => '3f5f443', + 'after-create-delete-modify-move' => 'ba3faa7', + 'with-codeowners' => '219560e', + 'submodule_inside_folder' => 'b491b92', + 'png-lfs' => 'fe42f41', + 'sha-starting-with-large-number' => '8426165', + 'invalid-utf8-diff-paths' => '99e4853', + 'compare-with-merge-head-source' => 'f20a03d', + 'compare-with-merge-head-target' => '2f1e176', + 'trailers' => 'f0a5ed6', + 'add_commit_with_5mb_subject' => '8cf8e80', + 'blame-on-renamed' => '32c33da', + 'with-executables' => '6b8dc4a', + 'spooky-stuff' => 'ba3343b', + 'few-commits' => '0031876', + 'two-commits' => '304d257', + 'utf-16' => 'f05a987', + 'gitaly-rename-test' => '94bb47c', + 'smime-signed-commits' => 'ed775cc', + 'Ääh-test-utf-8' => '7975be0' }.freeze # gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily @@ -96,9 +97,9 @@ module TestEnv # We currently only need a subset of the branches FORKED_BRANCH_SHA = { 'add-submodule-version-bump' => '3f547c0', - 'master' => '5937ac0', - 'remove-submodule' => '2a33e0c', - 'conflict-resolvable-fork' => '404fa3f' + 'master' => '5937ac0', + 'remove-submodule' => '2a33e0c', + 'conflict-resolvable-fork' => '404fa3f' }.freeze TMP_TEST_PATH = Rails.root.join('tmp', 'tests').freeze diff --git a/spec/support/helpers/usage_data_helpers.rb b/spec/support/helpers/usage_data_helpers.rb index 2a9144614d0..1aea3545ae0 100644 --- a/spec/support/helpers/usage_data_helpers.rb +++ b/spec/support/helpers/usage_data_helpers.rb @@ -6,22 +6,14 @@ module UsageDataHelpers snippet_update snippet_comment merge_request_comment - merge_request_create commit_comment wiki_pages_create wiki_pages_update wiki_pages_delete - web_ide_views - web_ide_commits - web_ide_merge_requests - web_ide_previews navbar_searches cycle_analytics_views productivity_analytics_views source_code_pushes - design_management_designs_create - design_management_designs_update - design_management_designs_delete ).freeze COUNTS_KEYS = %i( @@ -126,7 +118,6 @@ module UsageDataHelpers uploads web_hooks user_preferences_user_gitpod_enabled - service_usage_data_download_payload_click ).push(*SMAU_KEYS) USAGE_DATA_KEYS = %i( @@ -193,11 +184,11 @@ module UsageDataHelpers allow(Settings).to receive(:[]).with('artifacts') .and_return( { 'enabled' => true, - 'object_store' => + 'object_store' => { 'enabled' => true, - 'remote_directory' => 'artifacts', - 'direct_upload' => true, - 'connection' => + 'remote_directory' => 'artifacts', + 'direct_upload' => true, + 'connection' => { 'provider' => 'AWS', 'aws_access_key_id' => 'minio', 'aws_secret_access_key' => 'gdk-minio', 'region' => 'gdk', 'endpoint' => 'http://127.0.0.1:9000', 'path_style' => true }, 'background_upload' => false, 'proxy_download' => false } } @@ -208,11 +199,11 @@ module UsageDataHelpers allow(Settings).to receive(:[]).with('lfs') .and_return( { 'enabled' => true, - 'object_store' => + 'object_store' => { 'enabled' => false, - 'remote_directory' => 'lfs-objects', - 'direct_upload' => true, - 'connection' => + 'remote_directory' => 'lfs-objects', + 'direct_upload' => true, + 'connection' => { 'provider' => 'AWS', 'aws_access_key_id' => 'minio', 'aws_secret_access_key' => 'gdk-minio', 'region' => 'gdk', 'endpoint' => 'http://127.0.0.1:9000', 'path_style' => true }, 'background_upload' => false, 'proxy_download' => false } } @@ -221,21 +212,21 @@ module UsageDataHelpers .and_return( { 'object_store' => { 'enabled' => false, - 'remote_directory' => 'uploads', - 'direct_upload' => true, - 'connection' => + 'remote_directory' => 'uploads', + 'direct_upload' => true, + 'connection' => { 'provider' => 'AWS', 'aws_access_key_id' => 'minio', 'aws_secret_access_key' => 'gdk-minio', 'region' => 'gdk', 'endpoint' => 'http://127.0.0.1:9000', 'path_style' => true }, - 'background_upload' => false, - 'proxy_download' => false } } + 'background_upload' => false, + 'proxy_download' => false } } ) allow(Settings).to receive(:[]).with('packages') .and_return( { 'enabled' => true, - 'object_store' => + 'object_store' => { 'enabled' => false, - 'remote_directory' => 'packages', - 'direct_upload' => false, - 'connection' => + 'remote_directory' => 'packages', + 'direct_upload' => false, + 'connection' => { 'provider' => 'AWS', 'aws_access_key_id' => 'minio', 'aws_secret_access_key' => 'gdk-minio', 'region' => 'gdk', 'endpoint' => 'http://127.0.0.1:9000', 'path_style' => true }, 'background_upload' => true, 'proxy_download' => false } } |