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

README.md « frontend_integration « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee7601133077eaa28aaba42c474fe259fd24e8b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
## Frontend Integration Specs

This directory contains Frontend integration specs. Go to `spec/frontend` if you're looking for Frontend unit tests.

Frontend integration specs:

- Mock out the Backend.
- Don't test individual components, but instead test use cases.
- Are expected to run slower than unit tests.
- Could end up having their own environment.

As a result, they deserve their own special place.

## Run frontend integration tests locally

The frontend integration specs are all about testing integration frontend bundles against a
mock backend. The mock backend is built using the fixtures and GraphQL schema.

We can generate the necessary fixtures and GraphQL schema by running:

```shell
bundle exec rake frontend:fixtures gitlab:graphql:schema:dump
```

You can also download those fixtures from the package registry: see [download fixtures](https://docs.gitlab.com/ee/development/testing_guide/frontend_testing.html#download-fixtures) for more info.

Then we can use [Jest](https://jestjs.io/) to run the frontend integration tests:

```shell
yarn jest:integration <path-to-integration-test>
```

If you'd like to run the frontend integration specs **without** setting up the fixtures first, then you
can set `GL_IGNORE_WARNINGS=1`:

```shell
GL_IGNORE_WARNINGS=1 yarn jest:integration <path-to-integration-test>
```

The `jest-integration` job executes the frontend integration tests in our
CI/CD pipelines.

## References

- https://docs.gitlab.com/ee/development/testing_guide/testing_levels.html#frontend-integration-tests
- https://gitlab.com/gitlab-org/gitlab/-/issues/208800