diff options
Diffstat (limited to 'spec/frontend/pipelines')
7 files changed, 19 insertions, 1210 deletions
diff --git a/spec/frontend/pipelines/__snapshots__/utils_spec.js.snap b/spec/frontend/pipelines/__snapshots__/utils_spec.js.snap deleted file mode 100644 index 724ec7366d3..00000000000 --- a/spec/frontend/pipelines/__snapshots__/utils_spec.js.snap +++ /dev/null @@ -1,471 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`DAG visualization parsing utilities generateColumnsFromLayersList matches the snapshot 1`] = ` -Array [ - Object { - "groups": Array [ - Object { - "__typename": "CiGroup", - "id": "4", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "6", - "kind": "BUILD", - "name": "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - "needs": Array [], - "previousStageJobsOrNeeds": Array [], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "8", - "path": "/root/abcd-dag/-/jobs/1482/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1482", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "7", - "label": "passed", - "tooltip": "passed", - }, - }, - ], - "name": "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - "size": 1, - "stageName": "build", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "5", - "label": "passed", - }, - }, - Object { - "__typename": "CiGroup", - "id": "9", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "11", - "kind": "BUILD", - "name": "build_b", - "needs": Array [], - "previousStageJobsOrNeeds": Array [], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "13", - "path": "/root/abcd-dag/-/jobs/1515/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1515", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "12", - "label": "passed", - "tooltip": "passed", - }, - }, - ], - "name": "build_b", - "size": 1, - "stageName": "build", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "10", - "label": "passed", - }, - }, - Object { - "__typename": "CiGroup", - "id": "14", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "16", - "kind": "BUILD", - "name": "build_c", - "needs": Array [], - "previousStageJobsOrNeeds": Array [], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "18", - "path": "/root/abcd-dag/-/jobs/1484/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1484", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "17", - "label": "passed", - "tooltip": "passed", - }, - }, - ], - "name": "build_c", - "size": 1, - "stageName": "build", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "15", - "label": "passed", - }, - }, - Object { - "__typename": "CiGroup", - "id": "19", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "21", - "kind": "BUILD", - "name": "build_d 1/3", - "needs": Array [], - "previousStageJobsOrNeeds": Array [], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "23", - "path": "/root/abcd-dag/-/jobs/1485/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1485", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "22", - "label": "passed", - "tooltip": "passed", - }, - }, - Object { - "__typename": "CiJob", - "id": "24", - "kind": "BUILD", - "name": "build_d 2/3", - "needs": Array [], - "previousStageJobsOrNeeds": Array [], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "26", - "path": "/root/abcd-dag/-/jobs/1486/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1486", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "25", - "label": "passed", - "tooltip": "passed", - }, - }, - Object { - "__typename": "CiJob", - "id": "27", - "kind": "BUILD", - "name": "build_d 3/3", - "needs": Array [], - "previousStageJobsOrNeeds": Array [], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "29", - "path": "/root/abcd-dag/-/jobs/1487/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1487", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "28", - "label": "passed", - "tooltip": "passed", - }, - }, - ], - "name": "build_d", - "size": 3, - "stageName": "build", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "20", - "label": "passed", - }, - }, - Object { - "__typename": "CiGroup", - "id": "57", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "59", - "kind": "BUILD", - "name": "test_c", - "needs": Array [], - "previousStageJobsOrNeeds": Array [], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": null, - "detailsPath": "/root/kinder-pipe/-/pipelines/154", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "60", - "label": null, - "tooltip": null, - }, - }, - ], - "name": "test_c", - "size": 1, - "stageName": "test", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "58", - "label": null, - }, - }, - ], - "id": "layer-0", - "name": "", - "status": Object { - "action": null, - }, - }, - Object { - "groups": Array [ - Object { - "__typename": "CiGroup", - "id": "32", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "34", - "kind": "BUILD", - "name": "test_a", - "needs": Array [ - "build_c", - "build_b", - "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - ], - "previousStageJobsOrNeeds": Array [ - "build_c", - "build_b", - "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - ], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "36", - "path": "/root/abcd-dag/-/jobs/1514/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1514", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "35", - "label": "passed", - "tooltip": "passed", - }, - }, - ], - "name": "test_a", - "size": 1, - "stageName": "test", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "33", - "label": "passed", - }, - }, - Object { - "__typename": "CiGroup", - "id": "40", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "42", - "kind": "BUILD", - "name": "test_b 1/2", - "needs": Array [ - "build_d 3/3", - "build_d 2/3", - "build_d 1/3", - "build_b", - "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - ], - "previousStageJobsOrNeeds": Array [ - "build_d 3/3", - "build_d 2/3", - "build_d 1/3", - "build_b", - "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - ], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "44", - "path": "/root/abcd-dag/-/jobs/1489/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1489", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "43", - "label": "passed", - "tooltip": "passed", - }, - }, - Object { - "__typename": "CiJob", - "id": "67", - "kind": "BUILD", - "name": "test_b 2/2", - "needs": Array [ - "build_d 3/3", - "build_d 2/3", - "build_d 1/3", - "build_b", - "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - ], - "previousStageJobsOrNeeds": Array [ - "build_d 3/3", - "build_d 2/3", - "build_d 1/3", - "build_b", - "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl", - ], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": Object { - "__typename": "StatusAction", - "buttonTitle": "Retry this job", - "icon": "retry", - "id": "51", - "path": "/root/abcd-dag/-/jobs/1490/retry", - "title": "Retry", - }, - "detailsPath": "/root/abcd-dag/-/jobs/1490", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "50", - "label": "passed", - "tooltip": "passed", - }, - }, - ], - "name": "test_b", - "size": 2, - "stageName": "test", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "41", - "label": "passed", - }, - }, - Object { - "__typename": "CiGroup", - "id": "61", - "jobs": Array [ - Object { - "__typename": "CiJob", - "id": "53", - "kind": "BUILD", - "name": "test_d", - "needs": Array [ - "build_b", - ], - "previousStageJobsOrNeeds": Array [ - "build_b", - ], - "scheduledAt": null, - "status": Object { - "__typename": "DetailedStatus", - "action": null, - "detailsPath": "/root/abcd-dag/-/pipelines/153", - "group": "success", - "hasDetails": true, - "icon": "status_success", - "id": "64", - "label": null, - "tooltip": null, - }, - }, - ], - "name": "test_d", - "size": 1, - "stageName": "test", - "status": Object { - "__typename": "DetailedStatus", - "group": "success", - "icon": "status_success", - "id": "62", - "label": null, - }, - }, - ], - "id": "layer-1", - "name": "", - "status": Object { - "action": null, - }, - }, -] -`; diff --git a/spec/frontend/pipelines/graph/graph_component_spec.js b/spec/frontend/pipelines/graph/graph_component_spec.js index 95207fd59ff..e9bce037800 100644 --- a/spec/frontend/pipelines/graph/graph_component_spec.js +++ b/spec/frontend/pipelines/graph/graph_component_spec.js @@ -1,4 +1,5 @@ import { shallowMount } from '@vue/test-utils'; +import mockPipelineResponse from 'test_fixtures/pipelines/pipeline_details.json'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import { LAYER_VIEW, STAGE_VIEW } from '~/pipelines/components/graph/constants'; import PipelineGraph from '~/pipelines/components/graph/graph_component.vue'; @@ -7,11 +8,8 @@ import LinkedPipelinesColumn from '~/pipelines/components/graph/linked_pipelines import StageColumnComponent from '~/pipelines/components/graph/stage_column_component.vue'; import { calculatePipelineLayersInfo } from '~/pipelines/components/graph/utils'; import LinksLayer from '~/pipelines/components/graph_shared/links_layer.vue'; -import { - generateResponse, - mockPipelineResponse, - pipelineWithUpstreamDownstream, -} from './mock_data'; + +import { generateResponse, pipelineWithUpstreamDownstream } from './mock_data'; describe('graph component', () => { let wrapper; diff --git a/spec/frontend/pipelines/graph/graph_component_wrapper_spec.js b/spec/frontend/pipelines/graph/graph_component_wrapper_spec.js index cc952eac1d7..9599b5e6b7b 100644 --- a/spec/frontend/pipelines/graph/graph_component_wrapper_spec.js +++ b/spec/frontend/pipelines/graph/graph_component_wrapper_spec.js @@ -2,6 +2,7 @@ import { GlAlert, GlButton, GlButtonGroup, GlLoadingIcon, GlToggle } from '@gitl import MockAdapter from 'axios-mock-adapter'; import Vue from 'vue'; import VueApollo from 'vue-apollo'; +import mockPipelineResponse from 'test_fixtures/pipelines/pipeline_details.json'; import { useLocalStorageSpy } from 'helpers/local_storage_helper'; import createMockApollo from 'helpers/mock_apollo_helper'; import { mountExtended, shallowMountExtended } from 'helpers/vue_test_utils_helper'; @@ -26,7 +27,6 @@ import { import PipelineGraph from '~/pipelines/components/graph/graph_component.vue'; import PipelineGraphWrapper from '~/pipelines/components/graph/graph_component_wrapper.vue'; import GraphViewSelector from '~/pipelines/components/graph/graph_view_selector.vue'; -import StageColumnComponent from '~/pipelines/components/graph/stage_column_component.vue'; import * as Api from '~/pipelines/components/graph_shared/api'; import LinksLayer from '~/pipelines/components/graph_shared/links_layer.vue'; import * as parsingUtils from '~/pipelines/components/parsing_utils'; @@ -34,7 +34,7 @@ import getPipelineHeaderData from '~/pipelines/graphql/queries/get_pipeline_head import * as sentryUtils from '~/pipelines/utils'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import { mockRunningPipelineHeaderData } from '../mock_data'; -import { mapCallouts, mockCalloutsResponse, mockPipelineResponse } from './mock_data'; +import { mapCallouts, mockCalloutsResponse } from './mock_data'; const defaultProvide = { graphqlResourceEtag: 'frog/amphibirama/etag/', @@ -55,8 +55,6 @@ describe('Pipeline graph wrapper', () => { const findLinksLayer = () => wrapper.findComponent(LinksLayer); const findGraph = () => wrapper.findComponent(PipelineGraph); const findStageColumnTitle = () => wrapper.findByTestId('stage-column-title'); - const findAllStageColumnGroupsInColumn = () => - wrapper.findComponent(StageColumnComponent).findAll('[data-testid="stage-column-group"]'); const findViewSelector = () => wrapper.findComponent(GraphViewSelector); const findViewSelectorToggle = () => findViewSelector().findComponent(GlToggle); const findViewSelectorTrip = () => findViewSelector().findComponent(GlAlert); @@ -316,12 +314,10 @@ describe('Pipeline graph wrapper', () => { }); it('switches between views', async () => { - const groupsInFirstColumn = - mockPipelineResponse.data.project.pipeline.stages.nodes[0].groups.nodes.length; - expect(findAllStageColumnGroupsInColumn()).toHaveLength(groupsInFirstColumn); - expect(findStageColumnTitle().text()).toBe('build'); + expect(findStageColumnTitle().text()).toBe('deploy'); + await findViewSelector().vm.$emit('updateViewType', LAYER_VIEW); - expect(findAllStageColumnGroupsInColumn()).toHaveLength(groupsInFirstColumn + 1); + expect(findStageColumnTitle().text()).toBe(''); }); @@ -507,9 +503,9 @@ describe('Pipeline graph wrapper', () => { }); describe('with metrics path', () => { - const duration = 875; - const numLinks = 7; - const totalGroups = 8; + const duration = 500; + const numLinks = 3; + const totalGroups = 7; const metricsData = { histograms: [ { name: PIPELINES_DETAIL_LINK_DURATION, value: duration / 1000 }, @@ -559,9 +555,6 @@ describe('Pipeline graph wrapper', () => { createComponentWithApollo({ provide: { metricsPath, - glFeatures: { - pipelineGraphLayersView: true, - }, }, data: { currentViewType: LAYER_VIEW, diff --git a/spec/frontend/pipelines/graph/linked_pipelines_column_spec.js b/spec/frontend/pipelines/graph/linked_pipelines_column_spec.js index 6e4b9498918..bcea140f2dd 100644 --- a/spec/frontend/pipelines/graph/linked_pipelines_column_spec.js +++ b/spec/frontend/pipelines/graph/linked_pipelines_column_spec.js @@ -1,6 +1,7 @@ import { mount, shallowMount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; +import mockPipelineResponse from 'test_fixtures/pipelines/pipeline_details.json'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import getPipelineDetails from 'shared_queries/pipelines/get_pipeline_details.query.graphql'; @@ -15,11 +16,8 @@ import LinkedPipeline from '~/pipelines/components/graph/linked_pipeline.vue'; import LinkedPipelinesColumn from '~/pipelines/components/graph/linked_pipelines_column.vue'; import * as parsingUtils from '~/pipelines/components/parsing_utils'; import { LOAD_FAILURE } from '~/pipelines/constants'; -import { - mockPipelineResponse, - pipelineWithUpstreamDownstream, - wrappedPipelineReturn, -} from './mock_data'; + +import { pipelineWithUpstreamDownstream, wrappedPipelineReturn } from './mock_data'; const processedPipeline = pipelineWithUpstreamDownstream(mockPipelineResponse); diff --git a/spec/frontend/pipelines/graph/mock_data.js b/spec/frontend/pipelines/graph/mock_data.js index 08624cc511d..b012e7f66e1 100644 --- a/spec/frontend/pipelines/graph/mock_data.js +++ b/spec/frontend/pipelines/graph/mock_data.js @@ -5,710 +5,6 @@ import { RETRY_ACTION_TITLE, } from '~/pipelines/components/graph/constants'; -export const mockPipelineResponse = { - data: { - project: { - __typename: 'Project', - id: '1', - pipeline: { - __typename: 'Pipeline', - id: 163, - iid: '22', - complete: true, - usesNeeds: true, - downstream: null, - upstream: null, - userPermissions: { - __typename: 'PipelinePermissions', - updatePipeline: true, - }, - stages: { - __typename: 'CiStageConnection', - nodes: [ - { - __typename: 'CiStage', - id: '2', - name: 'build', - status: { - __typename: 'DetailedStatus', - id: '3', - action: null, - }, - groups: { - __typename: 'CiGroupConnection', - nodes: [ - { - __typename: 'CiGroup', - id: '4', - name: 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - size: 1, - status: { - __typename: 'DetailedStatus', - id: '5', - label: 'passed', - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '6', - kind: BUILD_KIND, - name: 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '7', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1482', - group: 'success', - action: { - __typename: 'StatusAction', - id: '8', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1482/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [], - }, - }, - ], - }, - }, - { - __typename: 'CiGroup', - name: 'build_b', - id: '9', - size: 1, - status: { - __typename: 'DetailedStatus', - id: '10', - label: 'passed', - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '11', - name: 'build_b', - kind: BUILD_KIND, - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '12', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1515', - group: 'success', - action: { - __typename: 'StatusAction', - id: '13', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1515/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [], - }, - }, - ], - }, - }, - { - __typename: 'CiGroup', - id: '14', - name: 'build_c', - size: 1, - status: { - __typename: 'DetailedStatus', - id: '15', - label: 'passed', - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '16', - name: 'build_c', - kind: BUILD_KIND, - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '17', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1484', - group: 'success', - action: { - __typename: 'StatusAction', - id: '18', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1484/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [], - }, - }, - ], - }, - }, - { - __typename: 'CiGroup', - id: '19', - name: 'build_d', - size: 3, - status: { - __typename: 'DetailedStatus', - id: '20', - label: 'passed', - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '21', - kind: BUILD_KIND, - name: 'build_d 1/3', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '22', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1485', - group: 'success', - action: { - __typename: 'StatusAction', - id: '23', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1485/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [], - }, - }, - { - __typename: 'CiJob', - id: '24', - kind: BUILD_KIND, - name: 'build_d 2/3', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '25', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1486', - group: 'success', - action: { - __typename: 'StatusAction', - id: '26', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1486/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [], - }, - }, - { - __typename: 'CiJob', - id: '27', - kind: BUILD_KIND, - name: 'build_d 3/3', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '28', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1487', - group: 'success', - action: { - __typename: 'StatusAction', - id: '29', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1487/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [], - }, - }, - ], - }, - }, - ], - }, - }, - { - __typename: 'CiStage', - id: '30', - name: 'test', - status: { - __typename: 'DetailedStatus', - id: '31', - action: null, - }, - groups: { - __typename: 'CiGroupConnection', - nodes: [ - { - __typename: 'CiGroup', - id: '32', - name: 'test_a', - size: 1, - status: { - __typename: 'DetailedStatus', - id: '33', - label: 'passed', - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '34', - kind: BUILD_KIND, - name: 'test_a', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '35', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1514', - group: 'success', - action: { - __typename: 'StatusAction', - id: '36', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1514/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '37', - name: 'build_c', - }, - { - __typename: 'CiBuildNeed', - id: '38', - name: 'build_b', - }, - { - __typename: 'CiBuildNeed', - id: '39', - name: - 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - }, - ], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '37', - name: 'build_c', - }, - { - __typename: 'CiBuildNeed', - id: '38', - name: 'build_b', - }, - { - __typename: 'CiBuildNeed', - id: '39', - name: - 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - }, - ], - }, - }, - ], - }, - }, - { - __typename: 'CiGroup', - id: '40', - name: 'test_b', - size: 2, - status: { - __typename: 'DetailedStatus', - id: '41', - label: 'passed', - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '42', - kind: BUILD_KIND, - name: 'test_b 1/2', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '43', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1489', - group: 'success', - action: { - __typename: 'StatusAction', - id: '44', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1489/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '45', - name: 'build_d 3/3', - }, - { - __typename: 'CiBuildNeed', - id: '46', - name: 'build_d 2/3', - }, - { - __typename: 'CiBuildNeed', - id: '47', - name: 'build_d 1/3', - }, - { - __typename: 'CiBuildNeed', - id: '48', - name: 'build_b', - }, - { - __typename: 'CiBuildNeed', - id: '49', - name: - 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - }, - ], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '45', - name: 'build_d 3/3', - }, - { - __typename: 'CiBuildNeed', - id: '46', - name: 'build_d 2/3', - }, - { - __typename: 'CiBuildNeed', - id: '47', - name: 'build_d 1/3', - }, - { - __typename: 'CiBuildNeed', - id: '48', - name: 'build_b', - }, - { - __typename: 'CiBuildNeed', - id: '49', - name: - 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - }, - ], - }, - }, - { - __typename: 'CiJob', - id: '67', - kind: BUILD_KIND, - name: 'test_b 2/2', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '50', - icon: 'status_success', - tooltip: 'passed', - label: 'passed', - hasDetails: true, - detailsPath: '/root/abcd-dag/-/jobs/1490', - group: 'success', - action: { - __typename: 'StatusAction', - id: '51', - buttonTitle: 'Retry this job', - icon: 'retry', - path: '/root/abcd-dag/-/jobs/1490/retry', - title: 'Retry', - }, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '52', - name: 'build_d 3/3', - }, - { - __typename: 'CiBuildNeed', - id: '53', - name: 'build_d 2/3', - }, - { - __typename: 'CiBuildNeed', - id: '54', - name: 'build_d 1/3', - }, - { - __typename: 'CiBuildNeed', - id: '55', - name: 'build_b', - }, - { - __typename: 'CiBuildNeed', - id: '56', - name: - 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - }, - ], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '52', - name: 'build_d 3/3', - }, - { - __typename: 'CiBuildNeed', - id: '53', - name: 'build_d 2/3', - }, - { - __typename: 'CiBuildNeed', - id: '54', - name: 'build_d 1/3', - }, - { - __typename: 'CiBuildNeed', - id: '55', - name: 'build_b', - }, - { - __typename: 'CiBuildNeed', - id: '56', - name: - 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl', - }, - ], - }, - }, - ], - }, - }, - { - __typename: 'CiGroup', - name: 'test_c', - id: '57', - size: 1, - status: { - __typename: 'DetailedStatus', - id: '58', - label: null, - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '59', - kind: BUILD_KIND, - name: 'test_c', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '60', - icon: 'status_success', - tooltip: null, - label: null, - hasDetails: true, - detailsPath: '/root/kinder-pipe/-/pipelines/154', - group: 'success', - action: null, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [], - }, - }, - ], - }, - }, - { - __typename: 'CiGroup', - id: '61', - name: 'test_d', - size: 1, - status: { - id: '62', - __typename: 'DetailedStatus', - label: null, - group: 'success', - icon: 'status_success', - }, - jobs: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiJob', - id: '53', - kind: BUILD_KIND, - name: 'test_d', - scheduledAt: null, - status: { - __typename: 'DetailedStatus', - id: '64', - icon: 'status_success', - tooltip: null, - label: null, - hasDetails: true, - detailsPath: '/root/abcd-dag/-/pipelines/153', - group: 'success', - action: null, - }, - needs: { - __typename: 'CiBuildNeedConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '65', - name: 'build_b', - }, - ], - }, - previousStageJobsOrNeeds: { - __typename: 'CiJobConnection', - nodes: [ - { - __typename: 'CiBuildNeed', - id: '65', - name: 'build_b', - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - }, - }, -}; - export const downstream = { nodes: [ { diff --git a/spec/frontend/pipelines/graph_shared/links_layer_spec.js b/spec/frontend/pipelines/graph_shared/links_layer_spec.js index 9d39c86ed5e..88ba84c395a 100644 --- a/spec/frontend/pipelines/graph_shared/links_layer_spec.js +++ b/spec/frontend/pipelines/graph_shared/links_layer_spec.js @@ -1,7 +1,9 @@ import { shallowMount } from '@vue/test-utils'; +import mockPipelineResponse from 'test_fixtures/pipelines/pipeline_details.json'; import LinksInner from '~/pipelines/components/graph_shared/links_inner.vue'; import LinksLayer from '~/pipelines/components/graph_shared/links_layer.vue'; -import { generateResponse, mockPipelineResponse } from '../graph/mock_data'; + +import { generateResponse } from '../graph/mock_data'; describe('links layer component', () => { let wrapper; diff --git a/spec/frontend/pipelines/utils_spec.js b/spec/frontend/pipelines/utils_spec.js index 51e0e0705ff..286d79edc6c 100644 --- a/spec/frontend/pipelines/utils_spec.js +++ b/spec/frontend/pipelines/utils_spec.js @@ -1,3 +1,4 @@ +import mockPipelineResponse from 'test_fixtures/pipelines/pipeline_details.json'; import { createSankey } from '~/pipelines/components/dag/drawing_utils'; import { makeLinksFromNodes, @@ -14,7 +15,7 @@ import { createNodeDict } from '~/pipelines/utils'; import { mockDownstreamPipelinesRest } from '../vue_merge_request_widget/mock_data'; import { mockDownstreamPipelinesGraphql } from '../commit/mock_data'; import { mockParsedGraphQLNodes, missingJob } from './components/dag/mock_data'; -import { generateResponse, mockPipelineResponse } from './graph/mock_data'; +import { generateResponse } from './graph/mock_data'; describe('DAG visualization parsing utilities', () => { const nodeDict = createNodeDict(mockParsedGraphQLNodes); @@ -152,14 +153,6 @@ describe('DAG visualization parsing utilities', () => { }); }); }); - - /* - Just as a fallback in case multiple functions change, so tests pass - but the implementation moves away from case. - */ - it('matches the snapshot', () => { - expect(columns).toMatchSnapshot(); - }); }); }); |