diff --git a/qa/qa/page/project/import/github.rb b/qa/qa/page/project/import/github.rb index fb227209b482ff54e47b91d86d08c7c6d3c9460d..6248af98a787329ca9e9047e3c9c6a2b4c116e90 100644 --- a/qa/qa/page/project/import/github.rb +++ b/qa/qa/page/project/import/github.rb @@ -71,7 +71,11 @@ def has_go_to_project_link?(gh_project_name) # @param [String] source_project_name # @param [Integer] wait # @return [Boolean] - def has_imported_project?(gh_project_name, wait: QA::Support::WaitForRequests::DEFAULT_MAX_WAIT_TIME) + def has_imported_project?( + gh_project_name, + wait: QA::Support::WaitForRequests::DEFAULT_MAX_WAIT_TIME, + allow_partial_import: false + ) within_element(:project_import_row, source_project: gh_project_name, skip_finished_loading_check: true) do wait_until( max_duration: wait, @@ -80,18 +84,12 @@ def has_imported_project?(gh_project_name, wait: QA::Support::WaitForRequests::D skip_finished_loading_check_on_refresh: true ) do status_selector = 'import_status_indicator' - is_partial_import = has_css?(status_selector, text: 'Partially completed') - # Temporarily adding this for investigation purposes. This makes sure that the details section is - # expanded when the screenshot is taken when the test fails. This can be removed or repurposed later - # after investigation. Related: https://gitlab.com/gitlab-org/gitlab/-/issues/385252#note_1211218434 - if is_partial_import - within_element_by_index(:import_status_indicator, 0) do - find('button').click - end - end + return has_element?(status_selector, text: "Complete", wait: 1) unless allow_partial_import # rubocop:disable Cop/AvoidReturnFromBlocks - has_element?(status_selector, text: "Complete") + ["Partially completed", "Complete"].any? do |status| + has_element?(status_selector, text: status, wait: 1) + end end end end diff --git a/qa/qa/resource/project_imported_from_github.rb b/qa/qa/resource/project_imported_from_github.rb index 1e6b2ff620eab43e9412d6f96f3d590df32f6216..ed8074b144013446647bffe2c823c762bae97723 100644 --- a/qa/qa/resource/project_imported_from_github.rb +++ b/qa/qa/resource/project_imported_from_github.rb @@ -3,7 +3,7 @@ module QA module Resource class ProjectImportedFromGithub < Resource::Project - attr_accessor :issue_events_import, :full_notes_import, :attachments_import + attr_accessor :issue_events_import, :full_notes_import, :attachments_import, :allow_partial_import attribute :github_repo_id do github_client.repository(github_repository_path).id @@ -24,7 +24,7 @@ def fabricate! import_page.select_advanced_option(:attachments_import) if attachments_import import_page.import!(github_repository_path, group.full_path, name) - import_page.wait_for_success(github_repository_path, wait: 240) + import_page.wait_for_success(github_repository_path, wait: 240, allow_partial_import: allow_partial_import) end reload! diff --git a/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb b/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb index 5b04010d070e91a0206e90d078e456c70375722f..001f87fda1eea1798756f2cf4345e466eae0b621 100644 --- a/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb +++ b/qa/qa/specs/features/ee/browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb @@ -4,10 +4,7 @@ module QA describe 'Verify', :github, :requires_admin, only: { subdomain: %i[staging staging-canary] } do - describe 'Pipeline for project mirrors Github', product_group: :pipeline_execution, quarantine: { - type: :investigating, - issue: "https://gitlab.com/gitlab-org/gitlab/-/issues/385252" - } do + describe 'Pipeline for project mirrors Github', product_group: :pipeline_execution do include QA::Support::Data::Github let(:commit_message) { "Update #{github_data[:file_name]} - #{Time.now}" } @@ -44,6 +41,7 @@ module QA project.github_personal_access_token = github_data[:access_token] project.github_repository_path = github_data[:repo] project.api_client = user_api_client + project.allow_partial_import = true end end