Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Amirault <mamirault@gitlab.com>2022-05-30 13:35:47 +0300
committerMarcel Amirault <mamirault@gitlab.com>2022-05-30 13:35:47 +0300
commit0f597c7a1531ffa2839835a98b96f2cc1b9d16c2 (patch)
tree904ee0490a649d92f9722d738b047c22b2170396
parentb526f0e4e5e1fba3fb5488be193a6190a866d4d2 (diff)
parent3a795e585affd982fbbfd0a188df0d7b76b328f6 (diff)
Merge branch 'eread/run-lefthook-tests-in-parallel' into 'main'
Split Make targets for tests See merge request gitlab-org/gitlab-docs!2735
-rw-r--r--.gitlab-ci.yml10
-rw-r--r--Makefile16
-rw-r--r--lefthook.yml17
3 files changed, 35 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9a24ee9e..5a9bd8a0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -297,7 +297,7 @@ rspec:
stage: test
script:
- yarn install --cache-folder .yarn-cache
- - bundle exec rspec
+ - make rspec-tests
#
# Run JavaScript tests
@@ -310,7 +310,7 @@ jest:
needs: []
stage: test
script:
- - yarn test
+ - make jest-tests
#
# Lint JavaScript
@@ -323,8 +323,8 @@ js_lint:
needs: []
stage: test
script:
- - yarn eslint
- - yarn prettier
+ - make eslint-tests
+ - make prettier-tests
#
# Lint SCSS
@@ -337,7 +337,7 @@ stylelint:
needs: []
stage: test
script:
- - scripts/run-stylelint.sh
+ - make stylelint-tests
#
# Yamllint of *.yml for .gitlab-ci.yml.
diff --git a/Makefile b/Makefile
index 75400fdf..d8ef0b7f 100644
--- a/Makefile
+++ b/Makefile
@@ -95,18 +95,32 @@ brew-bundle:
@printf "\n$(INFO)INFO: Checking Brew dependencies, if Brew is available..$(INFO_END)\n"
@(command -v brew > /dev/null 2>&1) && brew bundle --no-lock || true
-test: setup brew-bundle
+rspec-tests:
@printf "\n$(INFO)INFO: Running RSpec tests..$(INFO_END)\n"
@bundle exec rspec
+
+jest-tests:
@printf "\n$(INFO)INFO: Running Jest tests..$(INFO_END)\n"
@yarn test
+
+eslint-tests:
@printf "\n$(INFO)INFO: Running ESLint tests..$(INFO_END)\n"
@yarn eslint
+
+prettier-tests:
@printf "\n$(INFO)INFO: Running Prettier tests..$(INFO_END)\n"
@yarn prettier
+
+stylelint-tests:
@printf "\n$(INFO)INFO: Running Stylelint tests..$(INFO_END)\n"
@scripts/run-stylelint.sh
+
+hadolint-tests:
@printf "\n$(INFO)INFO: Running hadolint tests..$(INFO_END)\n"
@hadolint latest.Dockerfile .gitpod.Dockerfile **/*.Dockerfile
+
+yamllint-tests:
@printf "\n$(INFO)INFO: Running yamllint tests..$(INFO_END)\n"
@yamllint .gitlab-ci.yml content/_data
+
+test: setup brew-bundle rspec-test jest-tests eslint-tests prettier-tests stylelint-tests hadolint-tests yamllint-tests
diff --git a/lefthook.yml b/lefthook.yml
index 3a543eb0..db3a667e 100644
--- a/lefthook.yml
+++ b/lefthook.yml
@@ -1,5 +1,18 @@
---
pre-push:
commands:
- tests:
- run: make test
+ parallel: true
+ rspec-tests:
+ run: make rspec-tests
+ jest-tests:
+ run: make jest-tests
+ eslint-tests:
+ run: make eslint-tests
+ prettier-tests:
+ run: make prettier-tests
+ stylelint-tests:
+ run: make stylelint-tests
+ hadolint-tests:
+ run: make hadolint-tests
+ yamllint-tests:
+ run: make yamllint-tests