diff options
author | Sarah German <sgerman@gitlab.com> | 2022-05-12 19:39:51 +0300 |
---|---|---|
committer | Sarah German <sgerman@gitlab.com> | 2022-05-12 19:39:51 +0300 |
commit | e0cf214694e72d0ebde80f21219037e1387b37e6 (patch) | |
tree | 7ed5c9ea805e6cdcf74fd607da0fb1b66bf38098 | |
parent | 7b2035e066508808bfc5e6b4404f69d718000748 (diff) | |
parent | 9dd91e1b376985bb34a51108fddf4d7f11c45d89 (diff) |
Merge branch 'testing-docs' into 'main'
Document automated tests
See merge request gitlab-org/gitlab-docs!2649
-rw-r--r-- | doc/index.md | 5 | ||||
-rw-r--r-- | doc/testing.md | 41 |
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). |