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:
authorSarah German <sgerman@gitlab.com>2022-05-12 19:39:51 +0300
committerSarah German <sgerman@gitlab.com>2022-05-12 19:39:51 +0300
commit9dd91e1b376985bb34a51108fddf4d7f11c45d89 (patch)
tree7ed5c9ea805e6cdcf74fd607da0fb1b66bf38098
parent7b2035e066508808bfc5e6b4404f69d718000748 (diff)
Document automated tests
-rw-r--r--doc/index.md5
-rw-r--r--doc/testing.md41
2 files changed, 44 insertions, 2 deletions
diff --git a/doc/index.md b/doc/index.md
index 293e6611..8ba03a31 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -2,12 +2,13 @@
## Projects we pull from
-There are currently 4 products that are pulled and generate the docs website:
+There are currently 5 products that are pulled and generate the docs website:
- [GitLab](https://gitlab.com/gitlab-org/gitlab)
- [Omnibus GitLab](https://gitlab.com/gitlab-org/omnibus-gitlab)
- [GitLab Runner](https://gitlab.com/gitlab-org/gitlab-runner)
- [GitLab Chart](https://gitlab.com/gitlab-org/charts/gitlab)
+- [GitLab Operator](https://gitlab.com/gitlab-org/gitlab-operator)
NOTE:
Although GitLab Community Edition is generated, it is hidden from the website
@@ -36,7 +37,7 @@ There are multiple ways to preview GitLab documentation changes, you can:
## Develop and maintain the docs site
If you are interested in making contributions to the GitLab documentation site itself,
-see the [GitLab docs site development](development.md) page.
+see the [GitLab docs site development](development.md) and [Testing the GitLab docs site](testing.md) pages.
GitLab technical writing team members sometimes have to do maintenance tasks:
diff --git a/doc/testing.md b/doc/testing.md
new file mode 100644
index 00000000..bb0e5497
--- /dev/null
+++ b/doc/testing.md
@@ -0,0 +1,41 @@
+# 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.
+
+You can [run the same tests locally](#run-tests-locally), before pushing your changes
+to the project.
+
+## What do we test?
+
+| 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 |
+
+## Run tests locally
+
+You must install the dependencies before you can run tests locally:
+
+- node modules: `yarn install`
+- Ruby gems: `bundle install`
+- hadolint (MacOS: `brew install hadolint`)
+- yamllint (MacOS: `brew install yamllint`)
+
+To run the tests:
+
+`make test`
+
+### 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
+
+Lefthook settings are configured in [`lefthook.yml`](../lefthook.yml).