File: test_repos.md

package info (click to toggle)
gitlab-shell 14.35.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,652 kB
  • sloc: ruby: 1,129; makefile: 583; sql: 391; sh: 384
file content (34 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (5)
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
# Repositories used by the Gitaly test suite

Gitaly uses two test repositories. One should be enough but we got a
second one for free when importing code from `gitlab-ce`.

These repositories get cloned by `make prepare-tests`. They end up in:

- `_build/testrepos/gitlab-test.git`

To prevent fragile tests, we use fixed `packed-refs` files for these
repositories. They get installed by make (see `_support/makegen.go`)
from files in `_support`.

To update `packed-refs` run `git gc` in your test repo and copy the new
`packed-refs` to the right location in `_support`.

## Example

Let's add a new branch to `gitlab-test`.

```shell
make prepare-tests
git clone _build/testrepos/gitlab-test.git _build/gitlab-test

cd _build/gitlab-test
# make new branch etc.
git push origin my-new-branch # push to local copy of gitlab-test

cd ../..

git -C _build/testrepos/gitlab-test.git push origin refs/heads/my-new-branch # push to public, official copy of gitlab-test
git -C _build/testrepos/gitlab-test.git gc
cp _build/testrepos/gitlab-test.git/packed-refs _support/gitlab-test.git-packed-refs
```