From 09be3408489659c4a53b2fd5acbfe5ec6a01be40 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Wed, 29 Jun 2022 16:35:35 +0100 Subject: [PATCH] Chore: Backport 51543 to v9.0.x (#51562) * Chore: split betterer into it's own CI step and allow failures for now (#51543) * split betterer into it's own CI step and allow failures for now * Run make drone Co-authored-by: dsotirakis (cherry picked from commit f654152dc8965fa8e9bb79bb3615365c8489ced6) * Run make drone Co-authored-by: dsotirakis --- .drone.yml | 16 +++++++++++++++- package.json | 2 +- scripts/drone/pipelines/main.star | 4 +++- scripts/drone/pipelines/pr.star | 2 ++ scripts/drone/steps/lib.star | 13 +++++++++++++ 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4003b6e8b3a..95f3fd6c10c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,6 +42,13 @@ steps: TEST_MAX_WORKERS: 50% image: grafana/build-container:1.5.5 name: lint-frontend +- commands: + - yarn betterer ci + depends_on: + - yarn-install + failure: ignore + image: grafana/build-container:1.5.5 + name: betterer-frontend - commands: - yarn run ci:test-frontend depends_on: @@ -710,6 +717,13 @@ steps: TEST_MAX_WORKERS: 50% image: grafana/build-container:1.5.5 name: lint-frontend +- commands: + - yarn betterer ci + depends_on: + - yarn-install + failure: ignore + image: grafana/build-container:1.5.5 + name: betterer-frontend - commands: - yarn run ci:test-frontend depends_on: @@ -4667,6 +4681,6 @@ kind: secret name: gcp_upload_artifacts_key --- kind: signature -hmac: 9225ad54ce9cda12db965a6f098eb4daf970c4d43a0f456b8c5f1aff81ac2abd +hmac: 3f5060830f3acfffdb22b5565e8270820ebd24f014a851cb35b6d95be0e7977a ... diff --git a/package.json b/package.json index fc77a1a3c01..b077d9fc66a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "lint": "yarn run lint:ts && yarn run lint:sass", "lint:ts": "eslint . --ext .js,.tsx,.ts --cache", "lint:sass": "yarn stylelint '{public/sass,packages}/**/*.scss' --cache", - "test:ci": "betterer ci && mkdir -p reports/junit && JEST_JUNIT_OUTPUT_DIR=reports/junit jest --ci --reporters=default --reporters=jest-junit -w ${TEST_MAX_WORKERS:-100%}", + "test:ci": "mkdir -p reports/junit && JEST_JUNIT_OUTPUT_DIR=reports/junit jest --ci --reporters=default --reporters=jest-junit -w ${TEST_MAX_WORKERS:-100%}", "lint:fix": "yarn lint:ts --fix", "packages:build": "lerna run clean && lerna run build --ignore @grafana-plugins/input-datasource", "packages:docsExtract": "rm -rf ./reports/docs && lerna run docsExtract", diff --git a/scripts/drone/pipelines/main.star b/scripts/drone/pipelines/main.star index b7bcf66584e..2ae7f1c28d2 100644 --- a/scripts/drone/pipelines/main.star +++ b/scripts/drone/pipelines/main.star @@ -42,7 +42,8 @@ load( 'validate_scuemata_step', 'ensure_cuetsified_step', 'test_a11y_frontend_step', - 'trigger_oss' + 'trigger_oss', + 'betterer_frontend_step' ) load( @@ -83,6 +84,7 @@ def main_test_frontend(): ] test_steps = [ lint_frontend_step(), + betterer_frontend_step(), test_frontend_step(), ] return pipeline( diff --git a/scripts/drone/pipelines/pr.star b/scripts/drone/pipelines/pr.star index cd96747db0d..405a35cb726 100644 --- a/scripts/drone/pipelines/pr.star +++ b/scripts/drone/pipelines/pr.star @@ -33,6 +33,7 @@ load( 'ensure_cuetsified_step', 'test_a11y_frontend_step', 'enterprise_downstream_step', + 'betterer_frontend_step', ) load( @@ -80,6 +81,7 @@ def pr_test_frontend(): ] test_steps = [ lint_frontend_step(), + betterer_frontend_step(), test_frontend_step(), ] return pipeline( diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index a1e35a2415f..a0271985d19 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -523,6 +523,19 @@ def test_backend_integration_step(edition): ], } +def betterer_frontend_step(): + return { + 'name': 'betterer-frontend', + 'image': build_image, + 'depends_on': [ + 'yarn-install', + ], + 'commands': [ + 'yarn betterer ci', + ], + 'failure': 'ignore', + } + def test_frontend_step(): return {