diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb index 8094ee06d511d6b7f516fa778dd1fe84352762b6..cd58b0777cb230141e3e79e86ec1ac3487023976 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :object_storage, except: { job: 'relative-url' }, product_group: :package_registry do + RSpec.describe 'Package', :object_storage, product_group: :package_registry do describe 'Composer Repository' do include Runtime::Fixtures diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb index 2b5b80a27977ddebf57ff03451fee184b5671964..46d4a91d32ca907eedeae7c5d486dffe4afa1365 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Package', :object_storage, product_group: :package_registry, quarantine: { - only: { job: %w[object_storage relative_url airgapped], condition: -> { QA::Support::FIPS.enabled? } }, + only: { job: %w[object_storage airgapped], condition: -> { QA::Support::FIPS.enabled? } }, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/417584', type: :bug } do diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb index 1253dc91ca3c8932d30a6a0ef27054f58628999b..7bdaba792149cb6093642c9c7730cdf129b9d6b7 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :object_storage, except: { job: 'relative-url' }, product_group: :package_registry do - describe 'Generic Repository' do + RSpec.describe 'Package', :object_storage, product_group: :package_registry do + describe 'Generic Repository', except: { job: 'airgapped' } do include Runtime::Fixtures let(:project) do diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/helm_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/helm_registry_spec.rb index 7bfda7f5956d7caa1a7e6641fba4febb73c471c8..c82b276e83659ca5ac900e4d384ab45e5594a179 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/helm_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/helm_registry_spec.rb @@ -2,12 +2,7 @@ module QA RSpec.describe 'Package', :object_storage, product_group: :package_registry do - describe 'Helm Registry', - quarantine: { - only: { job: %w[relative_url airgapped] }, - issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/417590', - type: :investigating - } do + describe 'Helm Registry', except: { job: 'airgapped' } do using RSpec::Parameterized::TableSyntax include Runtime::Fixtures include Support::Helpers::MaskToken diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb index ce6c54b6ed84992b5cb6261ec6bc3d1d75ba8696..490d0117a0b74b51ea65bc0b5f7f2c34895dad58 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb @@ -2,12 +2,7 @@ module QA RSpec.describe 'Package', :object_storage, product_group: :package_registry do - describe 'Maven group level endpoint', - quarantine: { - only: { job: %w[relative_url airgapped] }, - issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/417600', - type: :investigating - } do + describe 'Maven group level endpoint', except: { job: 'airgapped' } do include Runtime::Fixtures include Support::Helpers::MaskToken include_context 'packages registry qa scenario' diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb index 8609d484f207e9008fb8a098949051c6758c8d7c..bf2bc13869da08edc3ea3caa24b8877c8ddf07e1 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_project_level_spec.rb @@ -1,12 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :object_storage, - quarantine: { - only: { job: %w[relative_url airgapped] }, - issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/417600', - type: :investigating - } do + RSpec.describe 'Package', :object_storage, except: { job: 'airgapped' } do describe 'Maven project level endpoint', product_group: :package_registry do include Runtime::Fixtures include Support::Helpers::MaskToken diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven_gradle_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven_gradle_repository_spec.rb index 738217c3980040128084bf67d380effb958001fa..9da56f1d640d8349cfdcdc79be24ee93831205ef 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/maven_gradle_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/maven_gradle_repository_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Package', :object_storage, quarantine: { - only: { job: 'relative_url', condition: -> { QA::Support::FIPS.enabled? } }, + only: { condition: -> { QA::Support::FIPS.enabled? } }, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/417600', type: :investigating }, product_group: :package_registry do diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_group_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_group_level_spec.rb index 88ed1026633a165be9338e3c0d161710ee285dd9..b245d162da90f2b9c8fe3a117e095297f920aa21 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_group_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_group_level_spec.rb @@ -2,169 +2,167 @@ module QA RSpec.describe 'Package' do - describe 'Package Registry', :object_storage, except: { job: 'relative-url' }, product_group: :package_registry do - describe 'npm group level endpoint' do - using RSpec::Parameterized::TableSyntax - include Runtime::Fixtures - include Support::Helpers::MaskToken + describe 'npm Registry group level endpoint', :object_storage, product_group: :package_registry do + using RSpec::Parameterized::TableSyntax + include Runtime::Fixtures + include Support::Helpers::MaskToken - let!(:registry_scope) { Runtime::Namespace.sandbox_name } - let!(:personal_access_token) do - Flow::Login.sign_in unless Page::Main::Menu.perform(&:signed_in?) + let!(:registry_scope) { Runtime::Namespace.sandbox_name } + let!(:personal_access_token) do + Flow::Login.sign_in unless Page::Main::Menu.perform(&:signed_in?) - Resource::PersonalAccessToken.fabricate!.token - end + Resource::PersonalAccessToken.fabricate!.token + end - let(:project_deploy_token) do - Resource::ProjectDeployToken.fabricate_via_api! do |deploy_token| - deploy_token.name = 'npm-deploy-token' - deploy_token.project = project - deploy_token.scopes = %w[ - read_repository - read_package_registry - write_package_registry - ] - end + let(:project_deploy_token) do + Resource::ProjectDeployToken.fabricate_via_api! do |deploy_token| + deploy_token.name = 'npm-deploy-token' + deploy_token.project = project + deploy_token.scopes = %w[ + read_repository + read_package_registry + write_package_registry + ] end + end - let(:gitlab_address_with_port) { Support::GitlabAddress.address_with_port } - let(:gitlab_host_with_port) { Support::GitlabAddress.host_with_port } + let(:gitlab_address_with_port) { Support::GitlabAddress.address_with_port } + let(:gitlab_host_with_port) { Support::GitlabAddress.host_with_port } - let!(:project) do - Resource::Project.fabricate_via_api! do |project| - project.name = 'npm-group-level-publish' - end + let!(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'npm-group-level-publish' end + end - let!(:another_project) do - Resource::Project.fabricate_via_api! do |another_project| - another_project.name = 'npm-group-level-install' - another_project.group = project.group - end + let!(:another_project) do + Resource::Project.fabricate_via_api! do |another_project| + another_project.name = 'npm-group-level-install' + another_project.group = project.group end + end - let!(:runner) do - Resource::GroupRunner.fabricate! do |runner| - runner.name = "qa-runner-#{Time.now.to_i}" - runner.tags = ["runner-for-#{project.group.name}"] - runner.executor = :docker - runner.group = project.group - end + let!(:runner) do + Resource::GroupRunner.fabricate! do |runner| + runner.name = "qa-runner-#{Time.now.to_i}" + runner.tags = ["runner-for-#{project.group.name}"] + runner.executor = :docker + runner.group = project.group end + end - let(:package) do - Resource::Package.init do |package| - package.name = "@#{registry_scope}/#{project.name}-#{SecureRandom.hex(8)}" - package.project = project - end + let(:package) do + Resource::Package.init do |package| + package.name = "@#{registry_scope}/#{project.name}-#{SecureRandom.hex(8)}" + package.project = project end + end - after do - package.remove_via_api! - runner.remove_via_api! - project.remove_via_api! - another_project.remove_via_api! - end + after do + package.remove_via_api! + runner.remove_via_api! + project.remove_via_api! + another_project.remove_via_api! + end - where(:case_name, :authentication_token_type, :token_name, :testcase) do - 'using personal access token' | :personal_access_token | 'Personal Access Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/413760' - 'using ci job token' | :ci_job_token | 'CI Job Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/413761' - 'using project deploy token' | :project_deploy_token | 'Deploy Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/413762' - end + where(:case_name, :authentication_token_type, :token_name, :testcase) do + 'using personal access token' | :personal_access_token | 'Personal Access Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/413760' + 'using ci job token' | :ci_job_token | 'CI Job Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/413761' + 'using project deploy token' | :project_deploy_token | 'Deploy Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/413762' + end - with_them do - let(:auth_token) do - case authentication_token_type - when :personal_access_token - use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: project) - use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: another_project) - when :ci_job_token - '${CI_JOB_TOKEN}' - when :project_deploy_token - use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: project) - use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: another_project) - end + with_them do + let(:auth_token) do + case authentication_token_type + when :personal_access_token + use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: project) + use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: another_project) + when :ci_job_token + '${CI_JOB_TOKEN}' + when :project_deploy_token + use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: project) + use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: another_project) end + end - it 'push and pull a npm package via CI', testcase: params[:testcase] do - Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do - npm_upload_yaml = ERB.new(read_fixture('package_managers/npm', - 'npm_upload_package_group.yaml.erb')).result(binding) - package_json = ERB.new(read_fixture('package_managers/npm', 'package.json.erb')).result(binding) - - Resource::Repository::Commit.fabricate_via_api! do |commit| - commit.project = project - commit.commit_message = 'Add files' - commit.add_files([ - { - file_path: '.gitlab-ci.yml', - content: npm_upload_yaml - }, - { - file_path: 'package.json', - content: package_json - } - ]) - end + it 'push and pull a npm package via CI', testcase: params[:testcase] do + Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do + npm_upload_yaml = ERB.new(read_fixture('package_managers/npm', + 'npm_upload_package_group.yaml.erb')).result(binding) + package_json = ERB.new(read_fixture('package_managers/npm', 'package.json.erb')).result(binding) + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.commit_message = 'Add files' + commit.add_files([ + { + file_path: '.gitlab-ci.yml', + content: npm_upload_yaml + }, + { + file_path: 'package.json', + content: package_json + } + ]) end + end - project.visit! - Flow::Pipeline.visit_latest_pipeline + project.visit! + Flow::Pipeline.visit_latest_pipeline - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('deploy') - end + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('deploy') + end - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - end + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + end - Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do - Resource::Repository::Commit.fabricate_via_api! do |commit| - npm_install_yaml = ERB.new(read_fixture('package_managers/npm', - 'npm_install_package_group.yaml.erb')).result(binding) - - commit.project = another_project - commit.commit_message = 'Add .gitlab-ci.yml' - commit.add_files([ - { - file_path: '.gitlab-ci.yml', - content: npm_install_yaml - } - ]) - end + Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do + Resource::Repository::Commit.fabricate_via_api! do |commit| + npm_install_yaml = ERB.new(read_fixture('package_managers/npm', + 'npm_install_package_group.yaml.erb')).result(binding) + + commit.project = another_project + commit.commit_message = 'Add .gitlab-ci.yml' + commit.add_files([ + { + file_path: '.gitlab-ci.yml', + content: npm_install_yaml + } + ]) end + end - another_project.visit! - Flow::Pipeline.visit_latest_pipeline + another_project.visit! + Flow::Pipeline.visit_latest_pipeline - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('install') - end + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('install') + end - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - job.click_browse_button - end + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + job.click_browse_button + end - Page::Project::Artifact::Show.perform do |artifacts| - artifacts.go_to_directory('node_modules') - artifacts.go_to_directory("@#{registry_scope}") - expect(artifacts).to have_content(project.name.to_s) - end + Page::Project::Artifact::Show.perform do |artifacts| + artifacts.go_to_directory('node_modules') + artifacts.go_to_directory("@#{registry_scope}") + expect(artifacts).to have_content(project.name.to_s) + end - project.visit! - Page::Project::Menu.perform(&:go_to_package_registry) + project.visit! + Page::Project::Menu.perform(&:go_to_package_registry) - Page::Project::Packages::Index.perform do |index| - expect(index).to have_package(package.name) + Page::Project::Packages::Index.perform do |index| + expect(index).to have_package(package.name) - index.click_package(package.name) - end + index.click_package(package.name) + end - Page::Project::Packages::Show.perform do |show| - expect(show).to have_package_info(package.name, "1.0.0") - end + Page::Project::Packages::Show.perform do |show| + expect(show).to have_package_info(package.name, "1.0.0") end end end diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb index 31c1603d54b06a4c06b6385bbb96913060536f26..961953220e3afac80d2bded100133d535aba749a 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb @@ -2,167 +2,165 @@ module QA RSpec.describe 'Package' do - describe 'Package Registry', :object_storage, except: { job: 'relative-url' }, product_group: :package_registry do - describe 'npm instance level endpoint' do - using RSpec::Parameterized::TableSyntax - include Runtime::Fixtures - include Support::Helpers::MaskToken + describe 'npm Registry instance level endpoint', :object_storage, product_group: :package_registry do + using RSpec::Parameterized::TableSyntax + include Runtime::Fixtures + include Support::Helpers::MaskToken - let!(:registry_scope) { Runtime::Namespace.sandbox_name } - let!(:personal_access_token) do - Flow::Login.sign_in unless Page::Main::Menu.perform(&:signed_in?) + let!(:registry_scope) { Runtime::Namespace.sandbox_name } + let!(:personal_access_token) do + Flow::Login.sign_in unless Page::Main::Menu.perform(&:signed_in?) - Resource::PersonalAccessToken.fabricate!.token - end + Resource::PersonalAccessToken.fabricate!.token + end - let(:project_deploy_token) do - Resource::ProjectDeployToken.fabricate_via_api! do |deploy_token| - deploy_token.name = 'npm-deploy-token' - deploy_token.project = project - deploy_token.scopes = %w[ - read_repository - read_package_registry - write_package_registry - ] - end + let(:project_deploy_token) do + Resource::ProjectDeployToken.fabricate_via_api! do |deploy_token| + deploy_token.name = 'npm-deploy-token' + deploy_token.project = project + deploy_token.scopes = %w[ + read_repository + read_package_registry + write_package_registry + ] end + end - let(:gitlab_address_with_port) { Support::GitlabAddress.address_with_port } - let(:gitlab_host_with_port) { Support::GitlabAddress.host_with_port } + let(:gitlab_address_with_port) { Support::GitlabAddress.address_with_port } + let(:gitlab_host_with_port) { Support::GitlabAddress.host_with_port } - let!(:project) do - Resource::Project.fabricate_via_api! do |project| - project.name = 'npm-instace-level-publish' - end + let!(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'npm-instace-level-publish' end + end - let!(:another_project) do - Resource::Project.fabricate_via_api! do |another_project| - another_project.name = 'npm-instance-level-install' - another_project.group = project.group - end + let!(:another_project) do + Resource::Project.fabricate_via_api! do |another_project| + another_project.name = 'npm-instance-level-install' + another_project.group = project.group end + end - let!(:runner) do - Resource::GroupRunner.fabricate! do |runner| - runner.name = "qa-runner-#{Time.now.to_i}" - runner.tags = ["runner-for-#{project.group.name}"] - runner.executor = :docker - runner.group = project.group - end + let!(:runner) do + Resource::GroupRunner.fabricate! do |runner| + runner.name = "qa-runner-#{Time.now.to_i}" + runner.tags = ["runner-for-#{project.group.name}"] + runner.executor = :docker + runner.group = project.group end + end - let(:package) do - Resource::Package.init do |package| - package.name = "@#{registry_scope}/#{project.name}-#{SecureRandom.hex(8)}" - package.project = project - end + let(:package) do + Resource::Package.init do |package| + package.name = "@#{registry_scope}/#{project.name}-#{SecureRandom.hex(8)}" + package.project = project end + end - after do - package.remove_via_api! - runner.remove_via_api! - project.remove_via_api! - another_project.remove_via_api! - end + after do + package.remove_via_api! + runner.remove_via_api! + project.remove_via_api! + another_project.remove_via_api! + end - where(:case_name, :authentication_token_type, :token_name, :testcase) do - 'using personal access token' | :personal_access_token | 'Personal Access Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347600' - 'using ci job token' | :ci_job_token | 'CI Job Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347599' - 'using project deploy token' | :project_deploy_token | 'Deploy Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347598' - end + where(:case_name, :authentication_token_type, :token_name, :testcase) do + 'using personal access token' | :personal_access_token | 'Personal Access Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347600' + 'using ci job token' | :ci_job_token | 'CI Job Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347599' + 'using project deploy token' | :project_deploy_token | 'Deploy Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347598' + end - with_them do - let(:auth_token) do - case authentication_token_type - when :personal_access_token - use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: project) - use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: another_project) - when :ci_job_token - '${CI_JOB_TOKEN}' - when :project_deploy_token - use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: project) - use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: another_project) - end + with_them do + let(:auth_token) do + case authentication_token_type + when :personal_access_token + use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: project) + use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: another_project) + when :ci_job_token + '${CI_JOB_TOKEN}' + when :project_deploy_token + use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: project) + use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: another_project) end + end - it 'push and pull a npm package via CI', testcase: params[:testcase] do - Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do - npm_upload_yaml = ERB.new(read_fixture('package_managers/npm', 'npm_upload_package_instance.yaml.erb')).result(binding) - package_json = ERB.new(read_fixture('package_managers/npm', 'package.json.erb')).result(binding) - - Resource::Repository::Commit.fabricate_via_api! do |commit| - commit.project = project - commit.commit_message = 'Add files' - commit.add_files([ - { - file_path: '.gitlab-ci.yml', - content: npm_upload_yaml - }, - { - file_path: 'package.json', - content: package_json - } - ]) - end + it 'push and pull a npm package via CI', testcase: params[:testcase] do + Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do + npm_upload_yaml = ERB.new(read_fixture('package_managers/npm', 'npm_upload_package_instance.yaml.erb')).result(binding) + package_json = ERB.new(read_fixture('package_managers/npm', 'package.json.erb')).result(binding) + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.commit_message = 'Add files' + commit.add_files([ + { + file_path: '.gitlab-ci.yml', + content: npm_upload_yaml + }, + { + file_path: 'package.json', + content: package_json + } + ]) end + end - project.visit! - Flow::Pipeline.visit_latest_pipeline + project.visit! + Flow::Pipeline.visit_latest_pipeline - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('deploy') - end + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('deploy') + end - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - end + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + end - Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do - Resource::Repository::Commit.fabricate_via_api! do |commit| - npm_install_yaml = ERB.new(read_fixture('package_managers/npm', 'npm_install_package_instance.yaml.erb')).result(binding) - - commit.project = another_project - commit.commit_message = 'Add .gitlab-ci.yml' - commit.add_files([ - { - file_path: '.gitlab-ci.yml', - content: npm_install_yaml - } - ]) - end + Support::Retrier.retry_on_exception(max_attempts: 3, sleep_interval: 2) do + Resource::Repository::Commit.fabricate_via_api! do |commit| + npm_install_yaml = ERB.new(read_fixture('package_managers/npm', 'npm_install_package_instance.yaml.erb')).result(binding) + + commit.project = another_project + commit.commit_message = 'Add .gitlab-ci.yml' + commit.add_files([ + { + file_path: '.gitlab-ci.yml', + content: npm_install_yaml + } + ]) end + end - another_project.visit! - Flow::Pipeline.visit_latest_pipeline + another_project.visit! + Flow::Pipeline.visit_latest_pipeline - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('install') - end + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('install') + end - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - job.click_browse_button - end + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + job.click_browse_button + end - Page::Project::Artifact::Show.perform do |artifacts| - artifacts.go_to_directory('node_modules') - artifacts.go_to_directory("@#{registry_scope}") - expect(artifacts).to have_content(project.name.to_s) - end + Page::Project::Artifact::Show.perform do |artifacts| + artifacts.go_to_directory('node_modules') + artifacts.go_to_directory("@#{registry_scope}") + expect(artifacts).to have_content(project.name.to_s) + end - project.visit! - Page::Project::Menu.perform(&:go_to_package_registry) + project.visit! + Page::Project::Menu.perform(&:go_to_package_registry) - Page::Project::Packages::Index.perform do |index| - expect(index).to have_package(package.name) + Page::Project::Packages::Index.perform do |index| + expect(index).to have_package(package.name) - index.click_package(package.name) - end + index.click_package(package.name) + end - Page::Project::Packages::Show.perform do |show| - expect(show).to have_package_info(package.name, "1.0.0") - end + Page::Project::Packages::Show.perform do |show| + expect(show).to have_package_info(package.name, "1.0.0") end end end diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb index 65645f1ccc525e84aec7f125880ed742075c2061..f44e3d4da966044fe1d05fbc338c2ddbcc4eb19c 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb @@ -2,140 +2,138 @@ module QA RSpec.describe 'Package' do - describe 'Package Registry', :object_storage, except: { job: 'relative-url' }, product_group: :package_registry do - describe 'npm project level endpoint' do - using RSpec::Parameterized::TableSyntax - include Runtime::Fixtures - include Support::Helpers::MaskToken + describe 'npm Registry project level endpoint', :object_storage, product_group: :package_registry do + using RSpec::Parameterized::TableSyntax + include Runtime::Fixtures + include Support::Helpers::MaskToken - let!(:registry_scope) { Runtime::Namespace.sandbox_name } - let!(:personal_access_token) do - Flow::Login.sign_in unless Page::Main::Menu.perform(&:signed_in?) + let!(:registry_scope) { Runtime::Namespace.sandbox_name } + let!(:personal_access_token) do + Flow::Login.sign_in unless Page::Main::Menu.perform(&:signed_in?) - Resource::PersonalAccessToken.fabricate!.token + Resource::PersonalAccessToken.fabricate!.token + end + + let(:project_deploy_token) do + Resource::ProjectDeployToken.fabricate_via_api! do |deploy_token| + deploy_token.name = 'npm-deploy-token' + deploy_token.project = project + deploy_token.scopes = %w[ + read_repository + read_package_registry + write_package_registry + ] end + end - let(:project_deploy_token) do - Resource::ProjectDeployToken.fabricate_via_api! do |deploy_token| - deploy_token.name = 'npm-deploy-token' - deploy_token.project = project - deploy_token.scopes = %w[ - read_repository - read_package_registry - write_package_registry - ] - end + let(:gitlab_address_with_port) { Support::GitlabAddress.address_with_port } + let(:gitlab_host_with_port) { Support::GitlabAddress.host_with_port } + + let!(:project) do + Resource::Project.fabricate_via_api! do |project| + project.name = 'npm-project-level' + project.visibility = :private end + end - let(:gitlab_address_with_port) { Support::GitlabAddress.address_with_port } - let(:gitlab_host_with_port) { Support::GitlabAddress.host_with_port } + let!(:runner) do + Resource::ProjectRunner.fabricate! do |runner| + runner.name = "qa-runner-#{Time.now.to_i}" + runner.tags = ["runner-for-#{project.name}"] + runner.executor = :docker + runner.project = project + end + end - let!(:project) do - Resource::Project.fabricate_via_api! do |project| - project.name = 'npm-project-level' - project.visibility = :private - end + let(:package) do + Resource::Package.init do |package| + package.name = "@#{registry_scope}/mypackage-#{SecureRandom.hex(8)}" + package.project = project end + end + + after do + package.remove_via_api! + runner.remove_via_api! + project.remove_via_api! + end - let!(:runner) do - Resource::ProjectRunner.fabricate! do |runner| - runner.name = "qa-runner-#{Time.now.to_i}" - runner.tags = ["runner-for-#{project.name}"] - runner.executor = :docker - runner.project = project + where(:case_name, :authentication_token_type, :token_name, :testcase) do + 'using personal access token' | :personal_access_token | 'Personal Access Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347592' + 'using ci job token' | :ci_job_token | 'CI Job Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347594' + 'using project deploy token' | :project_deploy_token | 'Deploy Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347593' + end + + with_them do + let(:auth_token) do + case authentication_token_type + when :personal_access_token + use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: project) + when :ci_job_token + '${CI_JOB_TOKEN}' + when :project_deploy_token + use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: project) end end - let(:package) do - Resource::Package.init do |package| - package.name = "@#{registry_scope}/mypackage-#{SecureRandom.hex(8)}" - package.project = project + it 'push and pull a npm package via CI', testcase: params[:testcase] do + Resource::Repository::Commit.fabricate_via_api! do |commit| + npm_upload_install_yaml = ERB.new(read_fixture('package_managers/npm', 'npm_upload_install_package_project.yaml.erb')).result(binding) + package_json = ERB.new(read_fixture('package_managers/npm', 'package.json.erb')).result(binding) + + commit.project = project + commit.commit_message = 'Add .gitlab-ci.yml' + commit.add_files([ + { + file_path: '.gitlab-ci.yml', + content: npm_upload_install_yaml + }, + { + file_path: 'package.json', + content: package_json + } + ]) end - end - after do - package.remove_via_api! - runner.remove_via_api! - project.remove_via_api! - end + project.visit! + Flow::Pipeline.visit_latest_pipeline - where(:case_name, :authentication_token_type, :token_name, :testcase) do - 'using personal access token' | :personal_access_token | 'Personal Access Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347592' - 'using ci job token' | :ci_job_token | 'CI Job Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347594' - 'using project deploy token' | :project_deploy_token | 'Deploy Token' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347593' - end + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('deploy') + end + + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + end + + Flow::Pipeline.visit_latest_pipeline + + Page::Project::Pipeline::Show.perform do |pipeline| + pipeline.click_job('install') + end + + Page::Project::Job::Show.perform do |job| + expect(job).to be_successful(timeout: 800) + job.click_browse_button + end + + Page::Project::Artifact::Show.perform do |artifacts| + artifacts.go_to_directory('node_modules') + artifacts.go_to_directory("@#{registry_scope}") + expect(artifacts).to have_content('mypackage') + end + + project.visit! + Page::Project::Menu.perform(&:go_to_package_registry) + + Page::Project::Packages::Index.perform do |index| + expect(index).to have_package(package.name) - with_them do - let(:auth_token) do - case authentication_token_type - when :personal_access_token - use_ci_variable(name: 'PERSONAL_ACCESS_TOKEN', value: personal_access_token, project: project) - when :ci_job_token - '${CI_JOB_TOKEN}' - when :project_deploy_token - use_ci_variable(name: 'PROJECT_DEPLOY_TOKEN', value: project_deploy_token.token, project: project) - end + index.click_package(package.name) end - it 'push and pull a npm package via CI', testcase: params[:testcase] do - Resource::Repository::Commit.fabricate_via_api! do |commit| - npm_upload_install_yaml = ERB.new(read_fixture('package_managers/npm', 'npm_upload_install_package_project.yaml.erb')).result(binding) - package_json = ERB.new(read_fixture('package_managers/npm', 'package.json.erb')).result(binding) - - commit.project = project - commit.commit_message = 'Add .gitlab-ci.yml' - commit.add_files([ - { - file_path: '.gitlab-ci.yml', - content: npm_upload_install_yaml - }, - { - file_path: 'package.json', - content: package_json - } - ]) - end - - project.visit! - Flow::Pipeline.visit_latest_pipeline - - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('deploy') - end - - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - end - - Flow::Pipeline.visit_latest_pipeline - - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('install') - end - - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) - job.click_browse_button - end - - Page::Project::Artifact::Show.perform do |artifacts| - artifacts.go_to_directory('node_modules') - artifacts.go_to_directory("@#{registry_scope}") - expect(artifacts).to have_content('mypackage') - end - - project.visit! - Page::Project::Menu.perform(&:go_to_package_registry) - - Page::Project::Packages::Index.perform do |index| - expect(index).to have_package(package.name) - - index.click_package(package.name) - end - - Page::Project::Packages::Show.perform do |show| - expect(show).to have_package_info(package.name, "1.0.0") - end + Page::Project::Packages::Show.perform do |show| + expect(show).to have_package_info(package.name, "1.0.0") end end end diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb index 5413ae85dcd184c83132a4df5a11ed85fafa796e..5703a32be8dec583635706850436a75557861a14 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :object_storage, except: { job: 'relative-url' }, product_group: :package_registry do + RSpec.describe 'Package', :object_storage, product_group: :package_registry do describe 'NuGet group level endpoint' do using RSpec::Parameterized::TableSyntax include Runtime::Fixtures diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb index 9a192bc005f5d7adaaa2e511d9befde5f1b9e70e..d58a232ec58ddcff563fcf3738bdcfca9bf91fe6 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :object_storage, except: { job: 'relative-url' }, product_group: :package_registry do + RSpec.describe 'Package', :object_storage, product_group: :package_registry do describe 'NuGet project level endpoint' do include Support::Helpers::MaskToken diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb index 5a774f0b0d8ed83b66acf23cbdea2394e468ac79..024e59ae9123c5e0951902e913f8087dc34e1185 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb @@ -2,12 +2,7 @@ module QA RSpec.describe 'Package', :object_storage, product_group: :package_registry do - describe 'PyPI Repository', - quarantine: { - only: { job: %w[relative_url airgapped] }, - issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/417592', - type: :investigating - } do + describe 'PyPI Repository', except: { job: 'airgapped' } do include Runtime::Fixtures include Support::Helpers::MaskToken diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb index 30ffec53d27a0067b826d4634bf2f94abc3a9b1e..d539e1f75de50f9f276cf0dfcb9e49c729760bc9 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :object_storage, except: { job: 'relative-url' }, + RSpec.describe 'Package', :object_storage, feature_flag: { name: 'rubygem_packages', scope: :project } do describe 'RubyGems Repository', product_group: :package_registry do include Runtime::Fixtures