Skip to content
Snippets Groups Projects
Verified Commit 4142f659 authored by Chloe Liu's avatar Chloe Liu :speech_balloon: Committed by GitLab
Browse files

Merge branch 'trea-refactor-verify-specs-final' into 'master'

Refactor verify specs use new Pipeline::Flow - final part

See merge request !179132



Merged-by: default avatarChloe Liu <yliu@gitlab.com>
Approved-by: default avatarDésirée Chevalier <dchevalier@gitlab.com>
Approved-by: default avatarChloe Liu <yliu@gitlab.com>
Co-authored-by: Tiffany Rea's avatartreagitlab <trea@gitlab.com>
parents 956943e5 8b00009e
No related branches found
No related tags found
3 merge requests!181325Fix ambiguous `created_at` in project.rb,!180187Draft: Update dashboard editing to save visualizations directly to the dashboard file,!179132Refactor verify specs use new Pipeline::Flow - final part
Pipeline #1649495902 failed
Pipeline: E2E GDK

#1649516917

    Pipeline: E2E Omnibus GitLab EE

    #1649516393

      Pipeline: E2E CNG

      #1649516390

        +30
        ......@@ -28,14 +28,6 @@ def wait_for_latest_pipeline(status: nil, wait: 120)
        end
        end
        def visit_pipeline_job_page(job_name:, pipeline: nil)
        pipeline.visit! unless pipeline.nil?
        Page::Project::Pipeline::Show.perform do |pipeline|
        pipeline.click_job(job_name)
        end
        end
        # With pipeline creation is slow a known issue - https://gitlab.com/groups/gitlab-org/-/epics/7290,
        # it might help reduce flakiness if we wait for pipeline to be created via API first before
        # visiting it via the UI.
        ......
        ......@@ -419,6 +419,10 @@ def pipelines(auto_paginate: false, attempts: 0, **kwargs)
        auto_paginated_response(request_url(api_pipelines_path, per_page: '100', **kwargs), attempts: attempts)
        end
        def has_pipeline_with_ref?(ref)
        pipelines.any? { |pipeline| pipeline[:ref] == ref }
        end
        def latest_pipeline
        # Observing in https://gitlab.com/gitlab-org/gitlab/-/issues/481642#note_2081214771
        # Sometimes in either canary or staging-canary,
        ......
        ......@@ -19,15 +19,15 @@ module QA
        before do
        add_ci_file(downstream_project, downstream_ci_file)
        add_ci_file(upstream_project, upstream_ci_file)
        Flow::Pipeline.wait_for_pipeline_creation_via_api(project: upstream_project)
        Flow::Pipeline.wait_for_latest_pipeline_to_have_status(project: upstream_project, status: 'success')
        Flow::Login.sign_in
        upstream_project.visit!
        Flow::Pipeline.visit_latest_pipeline(status: 'Passed')
        upstream_project.visit_latest_pipeline
        end
        after do
        runner.remove_via_api!
        [upstream_project, downstream_project].each(&:remove_via_api!)
        end
        it(
        ......@@ -35,11 +35,9 @@ module QA
        testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358064'
        ) do
        Page::Project::Pipeline::Show.perform do |show|
        expect(show).to have_passed
        expect(show).not_to have_job(downstream_job_name)
        show.expand_linked_pipeline
        expect(show).to have_job(downstream_job_name)
        end
        end
        ......
        ......@@ -16,7 +16,7 @@ module QA
        let(:downstream_project) do
        create(:project,
        name: 'project-with-pipeline-subscription',
        name: 'downstream-project-for-subscription',
        description: 'Project with CI subscription',
        group: group)
        end
        ......@@ -28,6 +28,8 @@ module QA
        add_ci_file(project)
        end
        Flow::Pipeline.wait_for_pipeline_creation_via_api(project: downstream_project)
        Flow::Login.sign_in
        downstream_project.visit!
        ......@@ -43,28 +45,18 @@ module QA
        context 'when upstream project new tag pipeline finishes' do
        it 'triggers pipeline in downstream project',
        testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347998' do
        # Downstream project should have one pipeline at this time
        Support::Waiter.wait_until { downstream_project.pipelines.size == 1 }
        create(:tag, project: upstream_project, ref: upstream_project.default_branch, name: tag_name)
        downstream_project.visit!
        Support::Waiter.wait_until(sleep_interval: 3) do
        QA::Runtime::Logger.info 'Waiting for upstream pipeline to succeed.'
        new_pipeline = upstream_project.pipelines.find { |pipeline| pipeline[:ref] == tag_name }
        new_pipeline&.dig(:status) == 'success'
        end
        Page::Project::Menu.perform(&:go_to_pipelines)
        Runtime::Logger.info "Creating tag #{tag_name} for #{upstream_project.name}."
        create(:tag, project: upstream_project, ref: upstream_project.default_branch, name: tag_name)
        Flow::Pipeline.wait_for_pipeline_creation_via_api(project: downstream_project, size: 2)
        # Downstream project must have 2 pipelines at this time
        expect { downstream_project.pipelines.size }.to eventually_eq(2), "There are currently #{downstream_project.pipelines.size} pipelines in downstream project."
        expect(upstream_project).to have_pipeline_with_ref(tag_name),
        "No pipeline with ref #{tag_name} was created for #{upstream_project.name}."
        # expect new downstream pipeline to also succeed
        Page::Project::Pipeline::Index.perform do |index|
        expect(index.wait_for_latest_pipeline(status: 'Passed')).to be_truthy, 'Downstream pipeline did not succeed as expected.'
        end
        expect do
        downstream_project.latest_pipeline[:status]
        end.to eventually_eq('success').within(max_duration: 300), 'Downstream pipeline did not succeed as expected.'
        end
        end
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment