diff --git a/qa/qa/ee/runtime/path.rb b/qa/qa/ee/runtime/path.rb index db433cee4bb6712a2633993c819b72a728296e06..701b4fe1f2d4aaf421b9462cbec3faf9b903232f 100644 --- a/qa/qa/ee/runtime/path.rb +++ b/qa/qa/ee/runtime/path.rb @@ -4,8 +4,14 @@ module QA module EE module Runtime module Path - def self.fixtures_path - File.expand_path('../fixtures', __dir__) + class << self + def fixtures_path + File.expand_path('../fixtures', __dir__) + end + + def fixture(*args) + ::File.join(fixtures_path, *args) + end end end end diff --git a/qa/qa/page/component/design_management.rb b/qa/qa/page/component/design_management.rb index 71c24b6cac8881fbf7723a2eb36bb5fb43d5129a..4caa5169c5fbc497ab881dfe2a9b2b720d65aa9a 100644 --- a/qa/qa/page/component/design_management.rb +++ b/qa/qa/page/component/design_management.rb @@ -78,7 +78,7 @@ def add_design(design_file_path) end def update_design(filename) - filepath = ::File.join(Runtime::Path.fixtures_path, 'designs', 'update', filename) + filepath = Runtime::Path.fixture('designs', 'update', filename) add_design(filepath) end diff --git a/qa/qa/resource/design.rb b/qa/qa/resource/design.rb index 127e7ae61e376c47225942d85156caf4a8109a9c..68d8e43ad3d6ec87981fa3c41486fa76f3738bed 100644 --- a/qa/qa/resource/design.rb +++ b/qa/qa/resource/design.rb @@ -111,7 +111,7 @@ def transform_api_resource(api_resource) private def filepath - ::File.join(Runtime::Path.fixtures_path, 'designs', filename) + Runtime::Path.fixture('designs', filename) end end end diff --git a/qa/qa/resource/import_project.rb b/qa/qa/resource/import_project.rb index a490905cbd6423aee8b3f5386cf1d10c41ca154d..1709a9eb9896f8e23cdbd6b29effab33df748c3f 100644 --- a/qa/qa/resource/import_project.rb +++ b/qa/qa/resource/import_project.rb @@ -7,7 +7,7 @@ class ImportProject < Resource::Project def initialize @name = "ImportedProject-#{SecureRandom.hex(8)}" - @file_path = ::File.join(Runtime::Path.fixtures_path, 'export.tar.gz') + @file_path = Runtime::Path.fixture('export.tar.gz') end def fabricate! diff --git a/qa/qa/runtime/fixtures.rb b/qa/qa/runtime/fixtures.rb index 201cf7f0fcbae6b840f5cadf2b99af34f8383852..4319f142bba237be40f25a45300fde668b754576 100644 --- a/qa/qa/runtime/fixtures.rb +++ b/qa/qa/runtime/fixtures.rb @@ -35,7 +35,7 @@ def with_fixtures(fixtures) end def read_fixture(fixture_path, file_name) - File.read(File.join(Runtime::Path.fixtures_path, fixture_path, file_name)) + File.read(Runtime::Path.fixture(fixture_path, file_name)) end private diff --git a/qa/qa/runtime/gpg.rb b/qa/qa/runtime/gpg.rb index 3314b14cd68e68e56feb5bf27e3bbc1f3ce40bb3..fb2a63ba2e35546c0b4541abd32174a69609f1fd 100644 --- a/qa/qa/runtime/gpg.rb +++ b/qa/qa/runtime/gpg.rb @@ -14,7 +14,7 @@ def initialize def key return @key if defined?(@key) - shell("gpg --import #{File.join(Path.fixtures_path, 'gpg', 'admin.asc')}") + shell("gpg --import #{Path.fixture('gpg', 'admin.asc')}") @key = shell("gpg --armor --export #{key_id}") end end diff --git a/qa/qa/runtime/path.rb b/qa/qa/runtime/path.rb index fd451f2df190ac0973909d541cfb800cbe9fc09a..ae1b26ca84a3c0aca8e4767d26b9f13afd8b41d9 100644 --- a/qa/qa/runtime/path.rb +++ b/qa/qa/runtime/path.rb @@ -3,14 +3,18 @@ module QA module Runtime module Path - extend self + class << self + def qa_root + ::File.expand_path('../../', __dir__) + end - def qa_root - ::File.expand_path('../../', __dir__) - end + def fixtures_path + ::File.expand_path('../fixtures', __dir__) + end - def fixtures_path - ::File.expand_path('../fixtures', __dir__) + def fixture(*args) + ::File.join(fixtures_path, *args) + end end end end diff --git a/qa/qa/service/docker_run/ldap.rb b/qa/qa/service/docker_run/ldap.rb index a6982bddf28ac93efee610ac06749781e55a573b..ea0f774b8d977fe6f319733c8bfa029802c4f865 100644 --- a/qa/qa/service/docker_run/ldap.rb +++ b/qa/qa/service/docker_run/ldap.rb @@ -28,7 +28,7 @@ def volume_or_fixture(volume_name) if volume_exists?(volume_name) volume_name else - ::File.join(Runtime::Path.fixtures_path, 'ldap', volume_name) + Runtime::Path.fixture('ldap', volume_name) end end diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb index aaf59bf32d6c59935c3a1c71493b01b46e58ed0e..e1f3ef26be3b569861d9301bf87fa41449bf70f8 100644 --- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb +++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb @@ -24,7 +24,7 @@ module QA group.api_client = admin_api_client group.sandbox = source_sandbox group.path = "source-group-for-import-#{SecureRandom.hex(4)}" - group.avatar = File.new(File.join(Runtime::Path.fixtures_path, 'designs', 'tanuki.jpg'), 'r') + group.avatar = File.new(Runtime::Path.fixture('designs', 'tanuki.jpg'), 'r') end end diff --git a/qa/qa/specs/features/browser_ui/2_plan/design_management/add_design_content_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/design_management/add_design_content_spec.rb index 130006fe424ca9a4d215d9948130362f02d230f0..63d30da9ec3bcf4278921d6ee21e4e2d94b8af7d 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/design_management/add_design_content_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/design_management/add_design_content_spec.rb @@ -5,7 +5,7 @@ module QA describe 'Design Management' do let(:issue) { Resource::Issue.fabricate_via_api! } let(:design_filename) { 'banana_sample.gif' } - let(:design) { File.join(Runtime::Path.fixtures_path, 'designs', design_filename) } + let(:design) { Runtime::Path.fixture('designs', design_filename) } let(:annotation) { "This design is great!" } before do diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb index 821f885c4c850a760a10cb20835ea7491ffbcd9b..33cd3879298cc82dd5b8cc435552a6ef00076401 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb @@ -59,9 +59,7 @@ module QA context 'when using attachments in comments', :object_storage do let(:png_file_name) { 'testfile.png' } - let(:file_to_attach) do - File.join(Runtime::Path.fixtures_path, 'designs', png_file_name) - end + let(:file_to_attach) { Runtime::Path.fixture('designs', png_file_name) } before do Resource::Issue.fabricate_via_api_unless_fips! { |issue| issue.project = project }.visit! diff --git a/qa/qa/specs/features/browser_ui/2_plan/project_wiki/project_based_file_upload_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/project_wiki/project_based_file_upload_spec.rb index a044bfa205407dda71be87a207d305a030a43cfd..bb411efc0294f34e8ce8b304581b2c1b0c7e89a4 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/project_wiki/project_based_file_upload_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/project_wiki/project_based_file_upload_spec.rb @@ -31,7 +31,7 @@ module QA edit.set_title(page_title) edit.use_new_editor edit.add_heading('Heading 1', heading_text) - edit.upload_image(File.join(Runtime::Path.fixtures_path, 'designs', image_file_name)) + edit.upload_image(Runtime::Path.fixture('designs', image_file_name)) end Page::Project::Wiki::Edit.perform(&:click_submit) diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb index 7b89b021d892c5963c963821cd95f1e81a3bb9d4..297f91be0bba67f12d9d32bc1d9393ffa69ff8d4 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/batch_suggestion_spec.rb @@ -15,7 +15,7 @@ module QA merge_request.title = 'Needs some suggestions' merge_request.description = '... so please add them.' merge_request.file_content = File.read( - File.join(Runtime::Path.fixtures_path, 'metrics_dashboards', 'templating.yml') + Runtime::Path.fixture('metrics_dashboards', 'templating.yml') ) end end diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb index 499d4c0038412ebe434e8e69fb1ddb8cdb28fbea..ce32f4aadcabce05bbc7fd0def0aa3f75ecf76ec 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb @@ -17,7 +17,7 @@ module QA merge_request.title = 'Needs some suggestions' merge_request.description = '... so please add them.' merge_request.file_content = File.read( - File.join(Runtime::Path.fixtures_path, 'metrics_dashboards', 'templating.yml') + Runtime::Path.fixture('metrics_dashboards', 'templating.yml') ) end end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/license_detection_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/license_detection_spec.rb index 86a9f2c46fbb6dd57e233699f20d4e061fcdddaf..f00ef65fab4e7436a734d56cd3a4cedcc7411f67 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/license_detection_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/license_detection_spec.rb @@ -11,7 +11,7 @@ module QA shared_examples 'project license detection' do it 'displays the name of the license on the repository' do - license_path = File.join(Runtime::Path.fixtures_path, 'software_licenses', license_file_name) + license_path = Runtime::Path.fixture('software_licenses', license_file_name) Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.add_files([{ file_path: 'LICENSE', content: File.read(license_path) }]) diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide_old/server_hooks_custom_error_message_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide_old/server_hooks_custom_error_message_spec.rb index 99be95492e6738e9feb090b72fadacefd0207982..05925505610c7325dcca309e82e680b42033b412 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide_old/server_hooks_custom_error_message_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide_old/server_hooks_custom_error_message_spec.rb @@ -8,7 +8,7 @@ module QA end describe 'Git Server Hooks' do - let(:file_path) { File.join(Runtime::Path.fixtures_path, 'web_ide', 'README.md') } + let(:file_path) { Runtime::Path.fixture('web_ide', 'README.md') } let(:project) do Resource::Project.fabricate_via_api! do |project| diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide_old/upload_new_file_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide_old/upload_new_file_in_web_ide_spec.rb index f15f5b3a1d9049a2a462fbee631ee02bd7072542..c557f2fa8a60ae3f8065c4c0bf7925b26629552c 100644 --- a/qa/qa/specs/features/browser_ui/3_create/web_ide_old/upload_new_file_in_web_ide_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/web_ide_old/upload_new_file_in_web_ide_spec.rb @@ -8,8 +8,7 @@ module QA end describe 'Upload a file in Web IDE' do - let(:file_path) { File.join(Runtime::Path.fixtures_path, 'web_ide', file_name) } - + let(:file_path) { Runtime::Path.fixture('web_ide', file_name) } let(:project) do Resource::Project.fabricate_via_api! do |project| project.name = 'upload-file-project' diff --git a/qa/qa/specs/features/ee/api/10_govern/instance_audit_event_streaming_spec.rb b/qa/qa/specs/features/ee/api/10_govern/instance_audit_event_streaming_spec.rb index 021f444741b40fdd7cd4a2ec4532984c940e3a3e..56cd5f350525d05ee66e12eef8b244f3dc41b194 100644 --- a/qa/qa/specs/features/ee/api/10_govern/instance_audit_event_streaming_spec.rb +++ b/qa/qa/specs/features/ee/api/10_govern/instance_audit_event_streaming_spec.rb @@ -167,7 +167,7 @@ def mock_service # # @return [String] def mocks - @mocks ||= File.read(File.join(EE::Runtime::Path.fixtures_path, 'audit_event_streaming', 'mocks.yml')) + @mocks ||= File.read(EE::Runtime::Path.fixture('audit_event_streaming', 'mocks.yml')) end # Wait for the mock service to receive a request with the specified event type diff --git a/qa/qa/specs/features/ee/api/7_configure/kubernetes/kubernetes_agent_spec.rb b/qa/qa/specs/features/ee/api/7_configure/kubernetes/kubernetes_agent_spec.rb index 76630e79551b57c2462266203c9f2cbca8a0dd3b..e95d6468d42267b1d9781fe77c548a0ec304e542 100644 --- a/qa/qa/specs/features/ee/api/7_configure/kubernetes/kubernetes_agent_spec.rb +++ b/qa/qa/specs/features/ee/api/7_configure/kubernetes/kubernetes_agent_spec.rb @@ -48,7 +48,7 @@ def manifest_deployed? end def read_agent_fixture(file_name) - File.read(File.join(Runtime::Path.fixtures_path, 'kubernetes_agent', file_name)) + File.read(Runtime::Path.fixture('kubernetes_agent', file_name)) end def creates_agent_config(project) diff --git a/qa/qa/specs/features/ee/browser_ui/10_govern/create_merge_request_with_secure_spec.rb b/qa/qa/specs/features/ee/browser_ui/10_govern/create_merge_request_with_secure_spec.rb index d439154f5528dbda082ed518b05ad8671bc39ced..ee6334dc863d5e8d442234b0d7b5b7e7eb6f5283 100644 --- a/qa/qa/specs/features/ee/browser_ui/10_govern/create_merge_request_with_secure_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/10_govern/create_merge_request_with_secure_spec.rb @@ -35,7 +35,7 @@ module QA # Push fixture to generate Secure reports @source = Resource::Repository::ProjectPush.fabricate! do |push| push.project = @project - push.directory = Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'secure_premade_reports')) + push.directory = Pathname.new(EE::Runtime::Path.fixture('secure_premade_reports')) push.commit_message = 'Create Secure compatible application to serve premade reports' push.branch_name = 'secure-mr' end diff --git a/qa/qa/specs/features/ee/browser_ui/10_govern/dismissed_vulnerabilities_in_security_widget_spec.rb b/qa/qa/specs/features/ee/browser_ui/10_govern/dismissed_vulnerabilities_in_security_widget_spec.rb index 56b03d7875a0b9bcd4fcc6834213cb7474791ebf..00047db0a47ce8e3e6f35a099f3bb62685a6b0fa 100644 --- a/qa/qa/specs/features/ee/browser_ui/10_govern/dismissed_vulnerabilities_in_security_widget_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/10_govern/dismissed_vulnerabilities_in_security_widget_spec.rb @@ -14,7 +14,7 @@ module QA end let!(:artefacts_directory) do - Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'dismissed_security_findings_mr_widget')) + Pathname.new(EE::Runtime::Path.fixture('dismissed_security_findings_mr_widget')) end let!(:runner) do diff --git a/qa/qa/specs/features/ee/browser_ui/10_govern/fix_vulnerability_workflow_spec.rb b/qa/qa/specs/features/ee/browser_ui/10_govern/fix_vulnerability_workflow_spec.rb index 738c48b3dd7824ca5edd9ac16990c3f970643da0..4b99b7caba2d92103fe93d17788606bcb755195b 100644 --- a/qa/qa/specs/features/ee/browser_ui/10_govern/fix_vulnerability_workflow_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/10_govern/fix_vulnerability_workflow_spec.rb @@ -32,7 +32,7 @@ module QA Resource::Repository::ProjectPush.fabricate! do |project_push| project_push.project = project project_push.directory = Pathname.new( - File.join(EE::Runtime::Path.fixtures_path, 'fix_vulnerability_workflow_premade_reports') + EE::Runtime::Path.fixture('fix_vulnerability_workflow_premade_reports') ) end end diff --git a/qa/qa/specs/features/ee/browser_ui/10_govern/security_reports_spec.rb b/qa/qa/specs/features/ee/browser_ui/10_govern/security_reports_spec.rb index 612ca12f2be6253630af22e9fd0d5d74fa0ddd24..6499dd5206556b9e35effeb6c9580c9b322cf37d 100644 --- a/qa/qa/specs/features/ee/browser_ui/10_govern/security_reports_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/10_govern/security_reports_spec.rb @@ -205,7 +205,7 @@ def push_security_reports Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project commit.commit_message = 'Create Secure compatible application to serve premade reports' - commit.add_directory(Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'secure_premade_reports'))) + commit.add_directory(Pathname.new(EE::Runtime::Path.fixture('secure_premade_reports'))) end project.visit! diff --git a/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_management_spec.rb b/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_management_spec.rb index 6adce874ba0c948b7fee44a4714c044455ee10bb..15700886a693c9a41dacc9d6fcf7092aa71a6db1 100644 --- a/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_management_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_management_spec.rb @@ -43,7 +43,7 @@ module QA let!(:source_repository) do Resource::Repository::ProjectPush.fabricate! do |push| push.project = project - push.directory = Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'secure_premade_reports')) + push.directory = Pathname.new(EE::Runtime::Path.fixture('secure_premade_reports')) push.commit_message = 'Check in premade security reports' push.branch_name = 'secure-mr' end diff --git a/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_security_training_spec.rb b/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_security_training_spec.rb index 2b28b6e58a19b9395e4b5fc457b2b818d07eb42e..5a600850ce6e747a2ac8ec4454368ff4ad0fa11b 100644 --- a/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_security_training_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/10_govern/vulnerability_security_training_spec.rb @@ -18,7 +18,7 @@ module QA end let!(:artefacts_directory) do - Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'secure_premade_reports')) + Pathname.new(EE::Runtime::Path.fixture('secure_premade_reports')) end let!(:runner) do diff --git a/qa/qa/specs/features/ee/browser_ui/12_systems/geo/attachment_replication_spec.rb b/qa/qa/specs/features/ee/browser_ui/12_systems/geo/attachment_replication_spec.rb index 97e4be230e9c9c14138919bc662b07d230ccadb2..91a4d43004ebbe7748761d30b439cf54f31a5a4e 100644 --- a/qa/qa/specs/features/ee/browser_ui/12_systems/geo/attachment_replication_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/12_systems/geo/attachment_replication_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Systems', :orchestrated, :geo, product_group: :geo do describe 'GitLab Geo attachment replication' do - let(:file_to_attach) { File.join(Runtime::Path.fixtures_path, 'designs', 'banana_sample.gif') } + let(:file_to_attach) { Runtime::Path.fixture('designs', 'banana_sample.gif') } let(:project) do Resource::Project.fabricate_via_api! do |project| project.name = 'project-for-issues' diff --git a/qa/qa/specs/features/ee/browser_ui/13_secure/enable_scanning_from_configuration_spec.rb b/qa/qa/specs/features/ee/browser_ui/13_secure/enable_scanning_from_configuration_spec.rb index e01480c77b2ab3f56d2fc03a831b47b6b364e44f..a6bad675c705fd00eab370a1c81af6cae615e812 100644 --- a/qa/qa/specs/features/ee/browser_ui/13_secure/enable_scanning_from_configuration_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/13_secure/enable_scanning_from_configuration_spec.rb @@ -32,7 +32,7 @@ module QA project_push.project = project project_push.commit_message = 'Create Secure compatible application to serve premade reports' project_push.directory = Pathname.new( - File.join(EE::Runtime::Path.fixtures_path, 'secure_scanning_enable_from_ui_files') + EE::Runtime::Path.fixture('secure_scanning_enable_from_ui_files') ) end diff --git a/qa/qa/specs/features/ee/browser_ui/13_secure/license_compliance_spec.rb b/qa/qa/specs/features/ee/browser_ui/13_secure/license_compliance_spec.rb index 6e2a18093412e610ab3610f1bead11cd260c492e..0d55d14a77ec48492e1fca28777fa4bb8dae0be6 100644 --- a/qa/qa/specs/features/ee/browser_ui/13_secure/license_compliance_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/13_secure/license_compliance_spec.rb @@ -86,18 +86,12 @@ module QA project_push.files = [ { name: '.gitlab-ci.yml', - content: File.read( - File.join(EE::Runtime::Path.fixtures_path, 'secure_license_files', '.gitlab-ci.yml') - ) + content: File.read(EE::Runtime::Path.fixture('secure_license_files', '.gitlab-ci.yml')) }, { name: 'gl-license-scanning-report.json', content: File.read( - File.join( - EE::Runtime::Path.fixtures_path, - 'secure_premade_reports', - 'gl-license-scanning-report.json' - ) + EE::Runtime::Path.fixture('secure_premade_reports', 'gl-license-scanning-report.json') ) } ] @@ -158,7 +152,7 @@ module QA Resource::Repository::Commit.fabricate_via_api! do |resource| resource.project = @project resource.commit_message = 'Create sbom file' - resource.add_directory(Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'secure_sbom_files'))) + resource.add_directory(Pathname.new(EE::Runtime::Path.fixture('secure_sbom_files'))) end login_and_set_license_state(approved_license_name, denied_license_name) diff --git a/qa/qa/specs/features/ee/browser_ui/13_secure/merge_request_license_widget_spec.rb b/qa/qa/specs/features/ee/browser_ui/13_secure/merge_request_license_widget_spec.rb index 0206c95b595fa4eb25f6bb5b7d5ed38a198c9b8b..eddbc59ea276c71b0edbe08947a23afbbd2cabcf 100644 --- a/qa/qa/specs/features/ee/browser_ui/13_secure/merge_request_license_widget_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/13_secure/merge_request_license_widget_spec.rb @@ -34,7 +34,7 @@ module QA Resource::Repository::Commit.fabricate_via_api! do |resource| resource.project = @project resource.commit_message = 'Create license file' - resource.add_directory(Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'secure_license_files'))) + resource.add_directory(Pathname.new(EE::Runtime::Path.fixture('secure_license_files'))) end @project.visit! @@ -158,7 +158,7 @@ module QA Resource::Repository::Commit.fabricate_via_api! do |resource| resource.project = @project resource.commit_message = 'Create sbom file' - resource.add_directory(Pathname.new(File.join(EE::Runtime::Path.fixtures_path, 'secure_sbom_files'))) + resource.add_directory(Pathname.new(EE::Runtime::Path.fixture('secure_sbom_files'))) end @project.visit! diff --git a/qa/qa/specs/features/ee/browser_ui/2_plan/group_wiki/file_upload_group_wiki_page_spec.rb b/qa/qa/specs/features/ee/browser_ui/2_plan/group_wiki/file_upload_group_wiki_page_spec.rb index d3c0bf509eb2d042e1db9d619ee2b54afb1e574e..3775967b7da2299940eff505d1462d2e66a36935 100644 --- a/qa/qa/specs/features/ee/browser_ui/2_plan/group_wiki/file_upload_group_wiki_page_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/2_plan/group_wiki/file_upload_group_wiki_page_spec.rb @@ -27,7 +27,7 @@ module QA edit.set_title(page_title) edit.use_new_editor edit.add_heading('Heading 1', heading_text) - edit.upload_image(File.join(Runtime::Path.fixtures_path, 'designs', image_file_name)) + edit.upload_image(Runtime::Path.fixture('designs', image_file_name)) end EE::Page::Group::Wiki::Edit.perform(&:click_submit) diff --git a/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb b/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb index 5ae90d20351800087b96289a3f1012b60e783c4d..55ed9abb0dae2645e835558e82e3d8ccd083483e 100644 --- a/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb +++ b/qa/qa/specs/features/shared_contexts/import/github_import_shared_context.rb @@ -48,7 +48,7 @@ module QA ) end - let(:mocks_path) { File.join(Runtime::Path.fixtures_path, "mocks", "import") } + let(:mocks_path) { Runtime::Path.fixture("mocks", "import") } before do set_mocks diff --git a/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb b/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb index bfd0825cf91f25ab3338ff7bfb42221bfa4fbe10..e702da4ad5bfe6520bebafb1fd36ce7686c0023a 100644 --- a/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb +++ b/qa/qa/specs/features/shared_contexts/import/gitlab_group_migration_common.rb @@ -32,7 +32,7 @@ module QA Resource::Sandbox.fabricate_via_api! do |group| group.api_client = source_admin_api_client group.path = "source-group-for-import-#{SecureRandom.hex(4)}" - group.avatar = File.new(File.join(Runtime::Path.fixtures_path, 'designs', 'tanuki.jpg'), "r") + group.avatar = File.new(Runtime::Path.fixture('designs', 'tanuki.jpg'), "r") end end