mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Build: Separate frontend linting from frontend testing (#39808)
* Create new lint-frontend step * Use lint-frontend step / separate from test-frontend * Fix typo
This commit is contained in:
parent
738d5e499e
commit
4017c5c800
114
.drone.yml
114
.drone.yml
@ -49,6 +49,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -65,7 +77,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -309,6 +321,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -325,7 +349,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -773,6 +797,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -789,7 +825,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -1141,6 +1177,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -1157,7 +1205,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -1713,6 +1761,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -1729,7 +1789,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -2070,6 +2130,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -2086,7 +2158,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -2635,6 +2707,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -2651,7 +2735,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -2963,6 +3047,18 @@ steps:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- initialize
|
- initialize
|
||||||
|
|
||||||
|
- name: lint-frontend
|
||||||
|
image: grafana/build-container:1.4.3
|
||||||
|
commands:
|
||||||
|
- yarn run prettier:check
|
||||||
|
- yarn run lint
|
||||||
|
- yarn run typecheck
|
||||||
|
- yarn run check-strict
|
||||||
|
environment:
|
||||||
|
TEST_MAX_WORKERS: 50%
|
||||||
|
depends_on:
|
||||||
|
- initialize
|
||||||
|
|
||||||
- name: test-backend
|
- name: test-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
commands:
|
commands:
|
||||||
@ -2979,7 +3075,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
TEST_MAX_WORKERS: 50%
|
TEST_MAX_WORKERS: 50%
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint-backend
|
- lint-frontend
|
||||||
|
|
||||||
- name: build-backend
|
- name: build-backend
|
||||||
image: grafana/build-container:1.4.3
|
image: grafana/build-container:1.4.3
|
||||||
@ -3468,6 +3564,6 @@ get:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 9d5ee57b9eff4ba3df8f70c8f7625c2ff1e07c2ce438182a97f81e6e8dbbb1dc
|
hmac: 1a0a169db008e1e64f43227aef586c8a6f6c763ce8ffb91923ac60d4f94ca33f
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"api-tests": "jest --notify --watch --config=devenv/e2e-api-tests/jest.js",
|
"api-tests": "jest --notify --watch --config=devenv/e2e-api-tests/jest.js",
|
||||||
"build": "node ./node_modules/webpack/bin/webpack.js --config scripts/webpack/webpack.prod.js",
|
"build": "node ./node_modules/webpack/bin/webpack.js --config scripts/webpack/webpack.prod.js",
|
||||||
|
"check-strict": "./scripts/ci-check-strict.sh",
|
||||||
"dev": "webpack --progress --color --config scripts/webpack/webpack.dev.js",
|
"dev": "webpack --progress --color --config scripts/webpack/webpack.dev.js",
|
||||||
"e2e": "./e2e/start-and-run-suite",
|
"e2e": "./e2e/start-and-run-suite",
|
||||||
"e2e:debug": "./e2e/start-and-run-suite debug",
|
"e2e:debug": "./e2e/start-and-run-suite debug",
|
||||||
@ -48,7 +49,7 @@
|
|||||||
"typecheck": "tsc --noEmit && yarn run packages:typecheck",
|
"typecheck": "tsc --noEmit && yarn run packages:typecheck",
|
||||||
"plugins:build-bundled": "grafana-toolkit plugin:bundle-managed",
|
"plugins:build-bundled": "grafana-toolkit plugin:bundle-managed",
|
||||||
"watch": "yarn start -d watch,start core:start --watchTheme",
|
"watch": "yarn start -d watch,start core:start --watchTheme",
|
||||||
"ci:test-frontend": "yarn run prettier:check && yarn run typecheck && yarn run lint && yarn run test:ci && yarn grafana-toolkit node-version-check && ./scripts/ci-check-strict.sh"
|
"ci:test-frontend": "yarn run test:ci && yarn grafana-toolkit node-version-check"
|
||||||
},
|
},
|
||||||
"grafana": {
|
"grafana": {
|
||||||
"whatsNewUrl": "https://grafana.com/docs/grafana/next/whatsnew/whats-new-in-v8-2/",
|
"whatsNewUrl": "https://grafana.com/docs/grafana/next/whatsnew/whats-new-in-v8-2/",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
load(
|
load(
|
||||||
'scripts/drone/steps/lib.star',
|
'scripts/drone/steps/lib.star',
|
||||||
'lint_backend_step',
|
'lint_backend_step',
|
||||||
|
'lint_frontend_step',
|
||||||
'codespell_step',
|
'codespell_step',
|
||||||
'shellcheck_step',
|
'shellcheck_step',
|
||||||
'test_backend_step',
|
'test_backend_step',
|
||||||
@ -56,6 +57,7 @@ def get_steps(edition, is_downstream=False):
|
|||||||
codespell_step(),
|
codespell_step(),
|
||||||
shellcheck_step(),
|
shellcheck_step(),
|
||||||
lint_backend_step(edition=edition),
|
lint_backend_step(edition=edition),
|
||||||
|
lint_frontend_step(),
|
||||||
test_backend_step(edition=edition),
|
test_backend_step(edition=edition),
|
||||||
test_frontend_step(),
|
test_frontend_step(),
|
||||||
build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
|
build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
load(
|
load(
|
||||||
'scripts/drone/steps/lib.star',
|
'scripts/drone/steps/lib.star',
|
||||||
'lint_backend_step',
|
'lint_backend_step',
|
||||||
|
'lint_frontend_step',
|
||||||
'codespell_step',
|
'codespell_step',
|
||||||
'shellcheck_step',
|
'shellcheck_step',
|
||||||
'build_backend_step',
|
'build_backend_step',
|
||||||
@ -47,6 +48,7 @@ def pr_pipelines(edition):
|
|||||||
codespell_step(),
|
codespell_step(),
|
||||||
shellcheck_step(),
|
shellcheck_step(),
|
||||||
lint_backend_step(edition=edition),
|
lint_backend_step(edition=edition),
|
||||||
|
lint_frontend_step(),
|
||||||
test_backend_step(edition=edition),
|
test_backend_step(edition=edition),
|
||||||
test_frontend_step(),
|
test_frontend_step(),
|
||||||
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
|
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
|
||||||
|
@ -4,6 +4,7 @@ load(
|
|||||||
'build_image',
|
'build_image',
|
||||||
'publish_image',
|
'publish_image',
|
||||||
'lint_backend_step',
|
'lint_backend_step',
|
||||||
|
'lint_frontend_step',
|
||||||
'codespell_step',
|
'codespell_step',
|
||||||
'shellcheck_step',
|
'shellcheck_step',
|
||||||
'test_backend_step',
|
'test_backend_step',
|
||||||
@ -83,6 +84,7 @@ def get_steps(edition, ver_mode):
|
|||||||
codespell_step(),
|
codespell_step(),
|
||||||
shellcheck_step(),
|
shellcheck_step(),
|
||||||
lint_backend_step(edition=edition),
|
lint_backend_step(edition=edition),
|
||||||
|
lint_frontend_step(),
|
||||||
test_backend_step(edition=edition, tries=tries),
|
test_backend_step(edition=edition, tries=tries),
|
||||||
test_frontend_step(),
|
test_frontend_step(),
|
||||||
build_backend_step(edition=edition, ver_mode=ver_mode),
|
build_backend_step(edition=edition, ver_mode=ver_mode),
|
||||||
|
@ -391,7 +391,7 @@ def test_frontend_step():
|
|||||||
'name': 'test-frontend',
|
'name': 'test-frontend',
|
||||||
'image': build_image,
|
'image': build_image,
|
||||||
'depends_on': [
|
'depends_on': [
|
||||||
'lint-backend',
|
'lint-frontend',
|
||||||
],
|
],
|
||||||
'environment': {
|
'environment': {
|
||||||
'TEST_MAX_WORKERS': '50%',
|
'TEST_MAX_WORKERS': '50%',
|
||||||
@ -401,6 +401,24 @@ def test_frontend_step():
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def lint_frontend_step():
|
||||||
|
return {
|
||||||
|
'name': 'lint-frontend',
|
||||||
|
'image': build_image,
|
||||||
|
'depends_on': [
|
||||||
|
'initialize',
|
||||||
|
],
|
||||||
|
'environment': {
|
||||||
|
'TEST_MAX_WORKERS': '50%',
|
||||||
|
},
|
||||||
|
'commands': [
|
||||||
|
'yarn run prettier:check',
|
||||||
|
'yarn run lint',
|
||||||
|
'yarn run typecheck',
|
||||||
|
'yarn run check-strict',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
def test_a11y_frontend_step(edition, port=3001):
|
def test_a11y_frontend_step(edition, port=3001):
|
||||||
return {
|
return {
|
||||||
'name': 'test-a11y-frontend' + enterprise2_suffix(edition),
|
'name': 'test-a11y-frontend' + enterprise2_suffix(edition),
|
||||||
|
Loading…
Reference in New Issue
Block a user