mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CI: Split main tests pipeline (#48628)
* Split tests pipeline * Rename dependencies
This commit is contained in:
parent
929d3134d1
commit
20f62e1841
99
.drone.yml
99
.drone.yml
@ -656,7 +656,68 @@ volumes:
|
|||||||
---
|
---
|
||||||
depends_on: []
|
depends_on: []
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: main-test
|
name: main-test-frontend
|
||||||
|
node:
|
||||||
|
type: no-parallel
|
||||||
|
platform:
|
||||||
|
arch: amd64
|
||||||
|
os: linux
|
||||||
|
services: []
|
||||||
|
steps:
|
||||||
|
- commands:
|
||||||
|
- echo $DRONE_RUNNER_NAME
|
||||||
|
image: alpine:3.15
|
||||||
|
name: identify-runner
|
||||||
|
- commands:
|
||||||
|
- mkdir -p bin
|
||||||
|
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.9.41/grabpl
|
||||||
|
- chmod +x bin/grabpl
|
||||||
|
image: byrnedo/alpine-curl:0.1.8
|
||||||
|
name: grabpl
|
||||||
|
- commands:
|
||||||
|
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
|
||||||
|
depends_on:
|
||||||
|
- grabpl
|
||||||
|
image: grafana/build-container:1.5.4
|
||||||
|
name: gen-version
|
||||||
|
- commands:
|
||||||
|
- yarn install --immutable
|
||||||
|
depends_on:
|
||||||
|
- grabpl
|
||||||
|
image: grafana/build-container:1.5.4
|
||||||
|
name: yarn-install
|
||||||
|
- commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run i18n:compile
|
||||||
|
- yarn run typecheck
|
||||||
|
depends_on:
|
||||||
|
- yarn-install
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
image: grafana/build-container:1.5.4
|
||||||
|
name: lint-frontend
|
||||||
|
- commands:
|
||||||
|
- yarn run ci:test-frontend
|
||||||
|
depends_on:
|
||||||
|
- yarn-install
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
image: grafana/build-container:1.5.4
|
||||||
|
name: test-frontend
|
||||||
|
trigger:
|
||||||
|
branch: main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
type: docker
|
||||||
|
volumes:
|
||||||
|
- host:
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
name: docker
|
||||||
|
---
|
||||||
|
depends_on: []
|
||||||
|
kind: pipeline
|
||||||
|
name: main-test-backend
|
||||||
node:
|
node:
|
||||||
type: no-parallel
|
type: no-parallel
|
||||||
platform:
|
platform:
|
||||||
@ -684,12 +745,6 @@ steps:
|
|||||||
- make gen-go
|
- make gen-go
|
||||||
image: grafana/build-container:1.5.4
|
image: grafana/build-container:1.5.4
|
||||||
name: wire-install
|
name: wire-install
|
||||||
- commands:
|
|
||||||
- yarn install --immutable
|
|
||||||
depends_on:
|
|
||||||
- grabpl
|
|
||||||
image: grafana/build-container:1.5.4
|
|
||||||
name: yarn-install
|
|
||||||
- commands:
|
- commands:
|
||||||
- ./bin/grabpl verify-drone
|
- ./bin/grabpl verify-drone
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -722,17 +777,6 @@ steps:
|
|||||||
CGO_ENABLED: "1"
|
CGO_ENABLED: "1"
|
||||||
image: grafana/build-container:1.5.4
|
image: grafana/build-container:1.5.4
|
||||||
name: lint-backend
|
name: lint-backend
|
||||||
- commands:
|
|
||||||
- yarn run prettier:check
|
|
||||||
- yarn run lint
|
|
||||||
- yarn run i18n:compile
|
|
||||||
- yarn run typecheck
|
|
||||||
depends_on:
|
|
||||||
- yarn-install
|
|
||||||
environment:
|
|
||||||
TEST_MAX_WORKERS: 50%
|
|
||||||
image: grafana/build-container:1.5.4
|
|
||||||
name: lint-frontend
|
|
||||||
- commands:
|
- commands:
|
||||||
- ./bin/grabpl test-backend --edition oss
|
- ./bin/grabpl test-backend --edition oss
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -745,14 +789,6 @@ steps:
|
|||||||
- wire-install
|
- wire-install
|
||||||
image: grafana/build-container:1.5.4
|
image: grafana/build-container:1.5.4
|
||||||
name: test-backend-integration
|
name: test-backend-integration
|
||||||
- commands:
|
|
||||||
- yarn run ci:test-frontend
|
|
||||||
depends_on:
|
|
||||||
- yarn-install
|
|
||||||
environment:
|
|
||||||
TEST_MAX_WORKERS: 50%
|
|
||||||
image: grafana/build-container:1.5.4
|
|
||||||
name: test-frontend
|
|
||||||
trigger:
|
trigger:
|
||||||
branch: main
|
branch: main
|
||||||
event:
|
event:
|
||||||
@ -1266,7 +1302,8 @@ volumes:
|
|||||||
medium: memory
|
medium: memory
|
||||||
---
|
---
|
||||||
depends_on:
|
depends_on:
|
||||||
- main-test
|
- main-test-frontend
|
||||||
|
- main-test-backend
|
||||||
- main-build-e2e-publish
|
- main-build-e2e-publish
|
||||||
- main-integration-tests
|
- main-integration-tests
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@ -1355,7 +1392,8 @@ trigger:
|
|||||||
type: docker
|
type: docker
|
||||||
---
|
---
|
||||||
depends_on:
|
depends_on:
|
||||||
- main-test
|
- main-test-frontend
|
||||||
|
- main-test-backend
|
||||||
- main-build-e2e-publish
|
- main-build-e2e-publish
|
||||||
- main-integration-tests
|
- main-integration-tests
|
||||||
- main-windows
|
- main-windows
|
||||||
@ -1409,7 +1447,8 @@ volumes:
|
|||||||
name: docker
|
name: docker
|
||||||
---
|
---
|
||||||
depends_on:
|
depends_on:
|
||||||
- main-test
|
- main-test-frontend
|
||||||
|
- main-test-backend
|
||||||
- main-build-e2e-publish
|
- main-build-e2e-publish
|
||||||
- main-integration-tests
|
- main-integration-tests
|
||||||
- main-windows
|
- main-windows
|
||||||
@ -4614,6 +4653,6 @@ kind: secret
|
|||||||
name: gcp_upload_artifacts_key
|
name: gcp_upload_artifacts_key
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 6be0c058bd66d0282afe37bd5af923f345ca71ec0fd874514ae08f759e23adfd
|
hmac: 650895e4350d8423d0a77aa728ed07696ee301ad440b9982e336a05bb364cdf8
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -69,9 +69,47 @@ load('scripts/drone/vault.star', 'from_secret')
|
|||||||
|
|
||||||
|
|
||||||
ver_mode = 'main'
|
ver_mode = 'main'
|
||||||
|
trigger = {
|
||||||
|
'event': ['push',],
|
||||||
|
'branch': 'main',
|
||||||
|
}
|
||||||
|
|
||||||
|
def main_test_frontend():
|
||||||
|
init_steps = [
|
||||||
|
identify_runner_step(),
|
||||||
|
download_grabpl_step(),
|
||||||
|
gen_version_step(ver_mode),
|
||||||
|
yarn_install_step(),
|
||||||
|
]
|
||||||
|
test_steps = [
|
||||||
|
lint_frontend_step(),
|
||||||
|
test_frontend_step(),
|
||||||
|
]
|
||||||
|
return pipeline(
|
||||||
|
name='main-test-frontend', edition="oss", trigger=trigger, services=[], steps=init_steps + test_steps,
|
||||||
|
)
|
||||||
|
|
||||||
|
def main_test_backend():
|
||||||
|
init_steps = [
|
||||||
|
identify_runner_step(),
|
||||||
|
download_grabpl_step(),
|
||||||
|
gen_version_step(ver_mode),
|
||||||
|
wire_install_step(),
|
||||||
|
]
|
||||||
|
test_steps = [
|
||||||
|
lint_drone_step(),
|
||||||
|
codespell_step(),
|
||||||
|
shellcheck_step(),
|
||||||
|
lint_backend_step(edition="oss"),
|
||||||
|
test_backend_step(edition="oss"),
|
||||||
|
test_backend_integration_step(edition="oss"),
|
||||||
|
]
|
||||||
|
return pipeline(
|
||||||
|
name='main-test-backend', edition="oss", trigger=trigger, services=[], steps=init_steps + test_steps,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_steps(edition):
|
def get_steps(edition):
|
||||||
services = integration_test_services(edition)
|
|
||||||
init_steps = [
|
init_steps = [
|
||||||
identify_runner_step(),
|
identify_runner_step(),
|
||||||
download_grabpl_step(),
|
download_grabpl_step(),
|
||||||
@ -170,10 +208,6 @@ def trigger_test_release():
|
|||||||
def main_pipelines(edition):
|
def main_pipelines(edition):
|
||||||
services = integration_test_services(edition)
|
services = integration_test_services(edition)
|
||||||
volumes = integration_test_services_volumes()
|
volumes = integration_test_services_volumes()
|
||||||
trigger = {
|
|
||||||
'event': ['push',],
|
|
||||||
'branch': 'main',
|
|
||||||
}
|
|
||||||
drone_change_trigger = {
|
drone_change_trigger = {
|
||||||
'event': ['push',],
|
'event': ['push',],
|
||||||
'branch': 'main',
|
'branch': 'main',
|
||||||
@ -191,11 +225,7 @@ def main_pipelines(edition):
|
|||||||
}
|
}
|
||||||
init_steps, test_steps, build_steps, integration_test_steps, windows_steps, store_steps = get_steps(edition=edition)
|
init_steps, test_steps, build_steps, integration_test_steps, windows_steps, store_steps = get_steps(edition=edition)
|
||||||
|
|
||||||
pipelines = [docs_pipelines(edition, ver_mode, trigger), pipeline(
|
pipelines = [docs_pipelines(edition, ver_mode, trigger), main_test_frontend(), main_test_backend(), pipeline(
|
||||||
name='main-test', edition=edition, trigger=trigger, services=[],
|
|
||||||
steps=init_steps + test_steps,
|
|
||||||
volumes=[],
|
|
||||||
), pipeline(
|
|
||||||
name='main-build-e2e-publish', edition=edition, trigger=trigger, services=[],
|
name='main-build-e2e-publish', edition=edition, trigger=trigger, services=[],
|
||||||
steps=init_steps + build_steps,
|
steps=init_steps + build_steps,
|
||||||
volumes=volumes,
|
volumes=volumes,
|
||||||
@ -206,17 +236,17 @@ def main_pipelines(edition):
|
|||||||
), pipeline(
|
), pipeline(
|
||||||
name='main-windows', edition=edition, trigger=dict(trigger, repo=['grafana/grafana']),
|
name='main-windows', edition=edition, trigger=dict(trigger, repo=['grafana/grafana']),
|
||||||
steps=[identify_runner_step('windows')] + windows_steps,
|
steps=[identify_runner_step('windows')] + windows_steps,
|
||||||
depends_on=['main-test', 'main-build-e2e-publish', 'main-integration-tests'], platform='windows',
|
depends_on=['main-test-frontend', 'main-test-backend', 'main-build-e2e-publish', 'main-integration-tests'], platform='windows',
|
||||||
), notify_pipeline(
|
), notify_pipeline(
|
||||||
name='notify-drone-changes', slack_channel='slack-webhooks-test', trigger=drone_change_trigger,
|
name='notify-drone-changes', slack_channel='slack-webhooks-test', trigger=drone_change_trigger,
|
||||||
template=drone_change_template, secret='drone-changes-webhook',
|
template=drone_change_template, secret='drone-changes-webhook',
|
||||||
), pipeline(
|
), pipeline(
|
||||||
name='main-publish', edition=edition, trigger=dict(trigger, repo=['grafana/grafana']),
|
name='main-publish', edition=edition, trigger=dict(trigger, repo=['grafana/grafana']),
|
||||||
steps=[download_grabpl_step(), identify_runner_step(),] + store_steps,
|
steps=[download_grabpl_step(), identify_runner_step(),] + store_steps,
|
||||||
depends_on=['main-test', 'main-build-e2e-publish', 'main-integration-tests', 'main-windows', ],
|
depends_on=['main-test-frontend', 'main-test-backend', 'main-build-e2e-publish', 'main-integration-tests', 'main-windows', ],
|
||||||
), notify_pipeline(
|
), notify_pipeline(
|
||||||
name='main-notify', slack_channel='grafana-ci-notifications', trigger=dict(trigger, status=['failure']),
|
name='main-notify', slack_channel='grafana-ci-notifications', trigger=dict(trigger, status=['failure']),
|
||||||
depends_on=['main-test', 'main-build-e2e-publish', 'main-integration-tests', 'main-windows', 'main-publish'],
|
depends_on=['main-test-frontend', 'main-test-backend', 'main-build-e2e-publish', 'main-integration-tests', 'main-windows', 'main-publish'],
|
||||||
template=failure_template, secret='slack_webhook'
|
template=failure_template, secret='slack_webhook'
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user