debian-mirror-gitlab/spec/frontend/pipelines/pipeline_graph/mock_data.js

109 lines
1.9 KiB
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
import { createUniqueJobId } from '~/pipelines/utils';
2020-11-24 15:15:51 +05:30
export const yamlString = `stages:
- empty
- build
- test
- deploy
- final
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
build_a:
stage: build
script: echo hello
build_b:
stage: build
script: echo hello
build_c:
stage: build
script: echo hello
build_d:
stage: Queen
script: echo hello
test_a:
stage: test
script: ls
needs: [build_a, build_b, build_c]
test_b:
stage: test
script: ls
needs: [build_a, build_b, build_d]
test_c:
stage: test
script: ls
needs: [build_a, build_b, build_c]
deploy_a:
stage: deploy
script: echo hello
`;
2021-01-03 14:25:43 +05:30
const jobId1 = createUniqueJobId('build', 'build_1');
const jobId2 = createUniqueJobId('test', 'test_1');
const jobId3 = createUniqueJobId('test', 'test_2');
const jobId4 = createUniqueJobId('deploy', 'deploy_1');
2020-11-24 15:15:51 +05:30
export const pipelineData = {
stages: [
{
name: 'build',
groups: [
{
name: 'build_1',
jobs: [{ script: 'echo hello', stage: 'build' }],
2021-01-03 14:25:43 +05:30
id: jobId1,
2020-11-24 15:15:51 +05:30
},
],
},
{
name: 'test',
groups: [
{
name: 'test_1',
jobs: [{ script: 'yarn test', stage: 'test' }],
2021-01-03 14:25:43 +05:30
id: jobId2,
2020-11-24 15:15:51 +05:30
},
{
name: 'test_2',
jobs: [{ script: 'yarn karma', stage: 'test' }],
2021-01-03 14:25:43 +05:30
id: jobId3,
2020-11-24 15:15:51 +05:30
},
],
},
{
name: 'deploy',
groups: [
{
name: 'deploy_1',
jobs: [{ script: 'yarn magick', stage: 'deploy' }],
2021-01-03 14:25:43 +05:30
id: jobId4,
2020-11-24 15:15:51 +05:30
},
],
},
],
2021-01-03 14:25:43 +05:30
jobs: {
[jobId1]: {},
[jobId2]: {},
[jobId3]: {},
[jobId4]: {},
},
2020-11-24 15:15:51 +05:30
};
2021-01-29 00:20:46 +05:30
export const singleStageData = {
stages: [
{
name: 'build',
groups: [
{
name: 'build_1',
jobs: [{ script: 'echo hello', stage: 'build' }],
id: jobId1,
},
],
},
],
};