Commit 8b9f31be authored by Jacob Vosmaer's avatar Jacob Vosmaer

Merge branch 'test-guidelines' into 'master'

Add test guidelines



See merge request !39
parents 1500542c 1c2b7374
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment