Skip to content
代码片段 群组 项目
提交 1c2b7374 编辑于 作者: Jacob Vosmaer's avatar Jacob Vosmaer
浏览文件

Add test guidelines

上级 8a339b46
No related branches found
No related tags found
无相关合并请求
...@@ -70,42 +70,21 @@ make install PREFIX=/foo ...@@ -70,42 +70,21 @@ make install PREFIX=/foo
## Tests ## Tests
``` Run the tests with:
make clean test
```
## Try it out
You can try out the Git server without authentication as follows:
``` ```
# Start a fake auth backend that allows everything/everybody make clean test
make test/data/test.git
go run support/fake-auth-backend.go ~+/test/data/test.git &
# Start gitlab-workhorse
make
./gitlab-workhorse
``` ```
Now you can try things like: ### Coverage / what to test
``` Each feature in gitlab-workhorse should have an integration test that
git clone http://localhost:8181/test.git verifies that the feature 'kicks in' on the right requests and leaves
curl -JO http://localhost:8181/test/repository/archive.zip other requests unaffected. It is better to also have package-level tests
``` for specific behavior but the high-level integration tests should have
the first priority during development.
## Example request flow It is OK if a feature is only covered by integration tests.
- start POST repo.git/git-receive-pack to NGINX
- ..start POST repo.git/git-receive-pack to gitlab-workhorse
- ....start POST repo.git/git-receive-pack to Unicorn for auth
- ....end POST to Unicorn for auth
- ....start git-receive-pack process from gitlab-workhorse
- ......start POST /api/v3/internal/allowed to Unicorn from Git hook (check protected branches)
- ......end POST to Unicorn from Git hook
- ....end git-receive-pack process
- ..end POST to gitlab-workhorse
- end POST to NGINX
## License ## License
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册