mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
refactor(buildkite): remove fixtures (#31134)
This commit is contained in:
parent
fad5e98c71
commit
aff5d94b4f
10 changed files with 96 additions and 86 deletions
|
@ -1,3 +0,0 @@
|
|||
steps:
|
||||
- plugins:
|
||||
abc/detect-clowns#v2.0.0: ~
|
|
@ -1,17 +0,0 @@
|
|||
steps:
|
||||
# Prebuild the app image, upload it to a registry for later steps
|
||||
- name: "Docker Build"
|
||||
plugins:
|
||||
docker-compose#v1.3.2: # Comment at the end....
|
||||
build: app
|
||||
image-repository: index.docker.io/org/repo
|
||||
|
||||
- wait
|
||||
|
||||
# Use the app image built above to run concurrent tests
|
||||
- name: "Docker Test %n"
|
||||
command: test.sh
|
||||
parallelism: 25
|
||||
plugins:
|
||||
docker-compose#v1.3.2:
|
||||
run: app
|
|
@ -1,16 +0,0 @@
|
|||
steps:
|
||||
# Prebuild the app image, upload it to a registry for later steps
|
||||
- name: "Docker Build"
|
||||
plugins:
|
||||
namespace/docker-compose#v1.3.2.5:
|
||||
build: app
|
||||
image-repository: index.docker.io/org/repo
|
||||
|
||||
- wait
|
||||
|
||||
- name: "wrong"
|
||||
command: test.sh
|
||||
parallelism: 25
|
||||
plugins:
|
||||
github.com/buildkite/plugin-docker-compose#v1.3.2:
|
||||
run: app
|
|
@ -1,14 +0,0 @@
|
|||
steps:
|
||||
- plugins:
|
||||
- docker-login#v2.0.1:
|
||||
username: xyz
|
||||
- docker-compose#v2.5.1:
|
||||
build: app
|
||||
image-repository: index.docker.io/myorg/myrepo
|
||||
- wait
|
||||
- command: test.sh
|
||||
plugins:
|
||||
- docker-login#v2.0.1:
|
||||
username: xyz
|
||||
- docker-compose#v2.5.1:
|
||||
run: app
|
|
@ -1,6 +0,0 @@
|
|||
steps:
|
||||
- plugins:
|
||||
- ssh://git@github.company.com/some-org/some-plugin#v3.2.7:
|
||||
username: abc
|
||||
- https://github.company.com/some-third-org/some-third-plugin#v0.0.1:
|
||||
build: app
|
|
@ -1,4 +0,0 @@
|
|||
steps:
|
||||
- plugins:
|
||||
- ssh://git@github.company.com/some-org/some-plugin.git#v3.2.7:
|
||||
username: abc
|
|
@ -1,8 +0,0 @@
|
|||
.docker-options: &some-options
|
||||
propagate-environment: true
|
||||
copy-checkout: true
|
||||
|
||||
.python3-container: &python3-container
|
||||
ssh://git@github.some-domain.com/some-org/some-plugin#v3.2.7:
|
||||
some-config: some-value
|
||||
<<: *some-options
|
|
@ -1,4 +0,0 @@
|
|||
steps:
|
||||
- plugins:
|
||||
- ? ssh://git@github.company.com/some-org/some-plugin.git#v3.2.7
|
||||
: enforce_peer_deps: false
|
|
@ -1,4 +0,0 @@
|
|||
steps:
|
||||
- plugins:
|
||||
- ssh://git@bitbucket.org/some-org/some-plugin.git#v3.2.7:
|
||||
- docker-compose#v1.3.2:
|
|
@ -1,4 +1,4 @@
|
|||
import { Fixtures } from '../../../../test/fixtures';
|
||||
import { codeBlock } from 'common-tags';
|
||||
import type { PackageDependency } from '../types';
|
||||
import { extractPackageFile } from '.';
|
||||
|
||||
|
@ -9,31 +9,95 @@ describe('modules/manager/buildkite/extract', () => {
|
|||
});
|
||||
|
||||
it('extracts simple single plugin', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline1.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
- plugins:
|
||||
abc/detect-clowns#v2.0.0: ~
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
expect(res).toMatchSnapshot();
|
||||
expect(res).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('extracts multiple plugins in same file', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline2.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
# Prebuild the app image, upload it to a registry for later steps
|
||||
- name: "Docker Build"
|
||||
plugins:
|
||||
docker-compose#v1.3.2: # Comment at the end....
|
||||
build: app
|
||||
image-repository: index.docker.io/org/repo
|
||||
|
||||
- wait
|
||||
|
||||
# Use the app image built above to run concurrent tests
|
||||
- name: "Docker Test %n"
|
||||
command: test.sh
|
||||
parallelism: 25
|
||||
plugins:
|
||||
docker-compose#v1.3.2:
|
||||
run: app
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
expect(res).toMatchSnapshot();
|
||||
expect(res).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('adds skipReason', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline3.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
- name: "Docker Build"
|
||||
plugins:
|
||||
namespace/docker-compose#v1.3.2.5:
|
||||
build: app
|
||||
image-repository: index.docker.io/org/repo
|
||||
|
||||
- wait
|
||||
|
||||
- name: "wrong"
|
||||
command: test.sh
|
||||
parallelism: 25
|
||||
plugins:
|
||||
github.com/buildkite/plugin-docker-compose#v1.3.2:
|
||||
run: app
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
expect(res).toMatchSnapshot();
|
||||
expect(res).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('extracts arrays of plugins', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline4.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
- plugins:
|
||||
- docker-login#v2.0.1:
|
||||
username: xyz
|
||||
- docker-compose#v2.5.1:
|
||||
build: app
|
||||
image-repository: index.docker.io/myorg/myrepo
|
||||
- wait
|
||||
- command: test.sh
|
||||
plugins:
|
||||
- docker-login#v2.0.1:
|
||||
username: xyz
|
||||
- docker-compose#v2.5.1:
|
||||
run: app
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
expect(res).toMatchSnapshot();
|
||||
expect(res).toHaveLength(4);
|
||||
});
|
||||
|
||||
it('extracts git-based plugins', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline5.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
- ssh://git@github.company.com/some-org/some-plugin#v3.2.7:
|
||||
username: abc
|
||||
- https://github.company.com/some-third-org/some-third-plugin#v0.0.1:
|
||||
build: app
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
expect(res).toMatchSnapshot();
|
||||
expect(res).toHaveLength(2);
|
||||
});
|
||||
|
@ -45,13 +109,25 @@ describe('modules/manager/buildkite/extract', () => {
|
|||
depName: 'some-org/some-plugin',
|
||||
registryUrls: ['https://github.company.com'],
|
||||
};
|
||||
const res = extractPackageFile(Fixtures.get('pipeline6.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
- ssh://git@github.company.com/some-org/some-plugin.git#v3.2.7:
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
expect(res).toHaveLength(1);
|
||||
expect(res).toEqual([expectedPackageDependency]);
|
||||
});
|
||||
|
||||
it('extracts plugins outside plugins sections', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline7.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
.docker-options: &some-options
|
||||
copy-checkout: true
|
||||
.python3-container: &python3-container
|
||||
ssh://git@github.some-domain.com/some-org/some-plugin#v3.2.7:
|
||||
some-config: some-value
|
||||
<<: *some-options
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
const expectedPackageDependency: PackageDependency = {
|
||||
currentValue: 'v3.2.7',
|
||||
datasource: 'github-tags',
|
||||
|
@ -62,7 +138,11 @@ describe('modules/manager/buildkite/extract', () => {
|
|||
});
|
||||
|
||||
it('extracts plugin with preceding ?', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline8.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
- ? ssh://git@github.company.com/some-org/some-plugin.git#v3.2.7
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
const expectedPackageDependency: PackageDependency = {
|
||||
currentValue: 'v3.2.7',
|
||||
datasource: 'github-tags',
|
||||
|
@ -73,7 +153,13 @@ describe('modules/manager/buildkite/extract', () => {
|
|||
});
|
||||
|
||||
it('extracts plugin tags from bitbucket', () => {
|
||||
const res = extractPackageFile(Fixtures.get('pipeline9.yml'))?.deps;
|
||||
const fileContent = codeBlock`
|
||||
steps:
|
||||
- plugins:
|
||||
- ssh://git@bitbucket.org/some-org/some-plugin.git#v3.2.7:
|
||||
- docker-compose#v1.3.2:
|
||||
`;
|
||||
const res = extractPackageFile(fileContent)?.deps;
|
||||
const githubDependency: PackageDependency = {
|
||||
currentValue: 'v1.3.2',
|
||||
datasource: 'github-tags',
|
||||
|
|
Loading…
Reference in a new issue