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:
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--.yamllint4
-rw-r--r--Brewfile1
-rw-r--r--Makefile2
-rw-r--r--doc/testing.md90
5 files changed, 70 insertions, 33 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3c7bfe4f..5ba30e66 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,7 +16,7 @@ default:
- ruby -v
- gem -v
- bundle -v
- - bundle config set --local deployment true # Install dependencies into ./vendor/ruby
+ - bundle config set --local deployment true # Install dependencies into ./vendor/ruby
- NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install --jobs 4
.yarn:
@@ -382,7 +382,7 @@ test_EOL_whitespace:
script:
- yarn global add markdownlint-cli@$MARKDOWNLINT_VERSION
- apk add jq
- - bundle config set --local deployment true # Install dependencies into ./vendor/ruby
+ - bundle config set --local deployment true # Install dependencies into ./vendor/ruby
- bundle install
- bundle exec rake setup_git default
- markdownlint --config tasks/whitespace_task.yml '../gitlab/doc/**/*.md' '../gitlab-runner/doc/**/*.md' '../omnibus-gitlab/doc/**/*.md' '../charts-gitlab/doc/**/*.md'
@@ -398,7 +398,7 @@ test_unlinked_images:
dependencies: []
script:
- apk add jq
- - bundle config set --local deployment true # Install dependencies into ./vendor/ruby
+ - bundle config set --local deployment true # Install dependencies into ./vendor/ruby
- bundle install
- bundle exec rake setup_git default
- cp tasks/unlinked-images.sh ../gitlab/unlinked-images.sh
diff --git a/.yamllint b/.yamllint
index df7cdf40..1f381e64 100644
--- a/.yamllint
+++ b/.yamllint
@@ -3,5 +3,7 @@
extends: default
rules:
- line-length: disable
+ comments-indentation:
+ ignore: content/_data/navigation.yaml
document-start: disable
+ line-length: disable
diff --git a/Brewfile b/Brewfile
index 29dde855..9cef599c 100644
--- a/Brewfile
+++ b/Brewfile
@@ -1 +1,2 @@
brew "hadolint"
+brew "yamllint"
diff --git a/Makefile b/Makefile
index 84ad2f93..0b911ef1 100644
--- a/Makefile
+++ b/Makefile
@@ -97,4 +97,4 @@ brew-bundle:
test: setup brew-bundle
@printf "\n$(INFO)INFO: Running all tests..$(INFO_END)\n"
- @bundle exec rspec && yarn test && yarn eslint && yarn prettier && hadolint latest.Dockerfile .gitpod.Dockerfile **/*.Dockerfile
+ @bundle exec rspec && yarn test && yarn eslint && yarn prettier && hadolint latest.Dockerfile .gitpod.Dockerfile **/*.Dockerfile && yamllint .gitlab-ci.yml content/_data
diff --git a/doc/testing.md b/doc/testing.md
index bb0e5497..e0ee93aa 100644
--- a/doc/testing.md
+++ b/doc/testing.md
@@ -1,41 +1,75 @@
-# Testing the GitLab docs site
+# Testing the GitLab Docs site
-Before any changes to the `gitlab-docs` project are merged, they are tested in a merge request's
-CI/CD pipeline. The pipeline configuration is in the [`.gitlab-ci.yml`](../.gitlab-ci.yml) file.
+Tests for the GitLab Docs site include tests for code and tests for links in content. For more information, see
+[Documentation testing](https://docs.gitlab.com/ee/development/documentation/testing.html).
-You can [run the same tests locally](#run-tests-locally), before pushing your changes
-to the project.
+Tests are run in `gitlab-docs` [CI/CD pipeline](https://gitlab.com/gitlab-org/gitlab-docs/-/pipelines), which is
+configured in the project's [`.gitlab-ci.yml`](../.gitlab-ci.yml) file.
-## What do we test?
+## Code tests
-| Test target | Tool | Purpose |
-| ------------ | ----------- | ------------------- |
-| CSS | Stylelint | Code quality |
-| Dockerfiles | Hadolint | Syntax checks |
-| JavaScript | ESLint | Syntax checks |
-| JavaScript | Prettier | Code formatting |
-| Links | Nanoc check | Find broken links |
-| Ruby | RSpec | Unit tests |
-| Vue | Jest | Unit tests |
-| YAML | yamllint | Syntax checks |
+These code tests are included in the project:
-## Run tests locally
+| Test target | Tool | Purpose |
+|:------------|:------------|:------------------|
+| CSS | Stylelint | Code quality |
+| Dockerfiles | Hadolint | Syntax checks |
+| JavaScript | ESLint | Syntax checks |
+| JavaScript | Prettier | Code formatting |
+| Ruby | RSpec | Unit tests |
+| Vue | Jest | Unit tests |
+| YAML | yamllint | Syntax checks |
-You must install the dependencies before you can run tests locally:
+Stylelint tests are run in the CI/CD pipeline only.
-- node modules: `yarn install`
-- Ruby gems: `bundle install`
-- hadolint (MacOS: `brew install hadolint`)
-- yamllint (MacOS: `brew install yamllint`)
+### Run code tests locally
To run the tests:
-`make test`
+```shell
+make test
+```
-### Lefthook
+### Install Lefthook
-Optionally, you can use Lefthook to automatically run tests before pushing code.
-Install Lefthook with `lefthook install`, then the tests run each time you run a
-`git push` command
+If you want to run the tests before pushing changes, use [Lefthook](https://github.com/evilmartians/lefthook#readme).
+To install Lefthook, run:
-Lefthook settings are configured in [`lefthook.yml`](../lefthook.yml).
+```shell
+lefthook install
+```
+
+Tests are run whenever you run `git push`.
+
+Lefthook is configured in [`lefthook.yml`](../lefthook.yml).
+
+## Link tests
+
+You can use `gitlab-docs` to test links in content. These tests don't test `gitlab-docs`, but the content in the
+projects that comprise the published GitLab Docs site.
+
+### Run link tests locally
+
+To test links between content pages, run:
+
+```shell
+make internal-links-check
+```
+
+To test anchor links, run:
+
+```shell
+make internal-anchors-check
+```
+
+To test both links between content pages and anchor links, run:
+
+```shell
+make internal-links-and-anchors-check
+```
+
+To test external links, run:
+
+```shell
+make external-links-check
+```