aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/middleware_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/admin/middleware_test.go')
-rw-r--r--internal/admin/middleware_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/admin/middleware_test.go b/internal/admin/middleware_test.go
index a50d02d..ffc2e2c 100644
--- a/internal/admin/middleware_test.go
+++ b/internal/admin/middleware_test.go
@@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"testing"
+ "time"
"github.com/go-git/go-billy/v5/util"
"github.com/go-git/go-git/v5"
@@ -88,13 +89,15 @@ func TestHooks(t *testing.T) {
if err != nil {
t.Fatal("couldn't commit file", err)
}
- req := httptest.NewRequest(http.MethodPost, "http://localhost:3456/mgmt.git/git-receive-pack", bytes.NewBuffer([]byte("stuff")))
+ req := httptest.NewRequest(http.MethodPost, "http://localhost:3456/mgmt/git-receive-pack", bytes.NewBuffer([]byte("stuff")))
recorder := httptest.NewRecorder()
adminHandler := Hooks(adminService, junkTestHandler())
adminHandler.ServeHTTP(recorder, req)
result := recorder.Result()
defer result.Body.Close()
found := false
+ // wait for bg job to complete
+ time.Sleep(1 * time.Second)
for _, v := range adminService.Conf.Repos {
if v.Name == newTestConfigRepo.Name {
found = true