summaryrefslogtreecommitdiffstats
path: root/integrations/git_test.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-04-07 01:25:14 +0100
committerLauris BH <lauris@nix.lv>2019-04-07 03:25:14 +0300
commit5422f23ed8174661b6e658250e4007b7fdf0d603 (patch)
tree87d975854be55c51e0a51c49cf93c33e310d30da /integrations/git_test.go
parent7ed65a98e80a341885b8cddce971012b7fcdae4e (diff)
downloadgitea-5422f23ed8174661b6e658250e4007b7fdf0d603.tar.gz
gitea-5422f23ed8174661b6e658250e4007b7fdf0d603.zip
Quieter Integration Tests (#6513)
* Rename BaseLogger to WriterLogger to help the creation of other providers * Don't export ColorBytes and ResetBytes from ColoredValues * Make integration tests only print logs if they fail * check can color before coloring * I always forget about MSSQL * Oh and use LEVEL in sqlite.ini * Make the test logger log at info - as it means you see the router * Remove empty expected changes * Make the migrations quieter too * Don't display SQL on error - it can be looked at in the file logs if necessary * Fix skip when using onGiteaRun
Diffstat (limited to 'integrations/git_test.go')
-rw-r--r--integrations/git_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/integrations/git_test.go b/integrations/git_test.go
index 28ead9d385..ebbf04f9d0 100644
--- a/integrations/git_test.go
+++ b/integrations/git_test.go
@@ -38,6 +38,7 @@ func testGit(t *testing.T, u *url.URL) {
u.Path = baseAPITestContext.GitPath()
t.Run("HTTP", func(t *testing.T) {
+ PrintCurrentTest(t)
httpContext := baseAPITestContext
httpContext.Reponame = "repo-tmp-17"
@@ -47,6 +48,7 @@ func testGit(t *testing.T, u *url.URL) {
assert.NoError(t, err)
defer os.RemoveAll(dstPath)
t.Run("Standard", func(t *testing.T) {
+ PrintCurrentTest(t)
ensureAnonymousClone(t, u)
t.Run("CreateRepo", doAPICreateRepository(httpContext, false))
@@ -57,16 +59,21 @@ func testGit(t *testing.T, u *url.URL) {
t.Run("Clone", doGitClone(dstPath, u))
t.Run("PushCommit", func(t *testing.T) {
+ PrintCurrentTest(t)
t.Run("Little", func(t *testing.T) {
+ PrintCurrentTest(t)
little = commitAndPush(t, littleSize, dstPath)
})
t.Run("Big", func(t *testing.T) {
+ PrintCurrentTest(t)
big = commitAndPush(t, bigSize, dstPath)
})
})
})
t.Run("LFS", func(t *testing.T) {
+ PrintCurrentTest(t)
t.Run("PushCommit", func(t *testing.T) {
+ PrintCurrentTest(t)
//Setup git LFS
_, err = git.NewCommand("lfs").AddArguments("install").RunInDir(dstPath)
assert.NoError(t, err)
@@ -76,17 +83,21 @@ func testGit(t *testing.T, u *url.URL) {
assert.NoError(t, err)
t.Run("Little", func(t *testing.T) {
+ PrintCurrentTest(t)
littleLFS = commitAndPush(t, littleSize, dstPath)
})
t.Run("Big", func(t *testing.T) {
+ PrintCurrentTest(t)
bigLFS = commitAndPush(t, bigSize, dstPath)
})
})
t.Run("Locks", func(t *testing.T) {
+ PrintCurrentTest(t)
lockTest(t, u.String(), dstPath)
})
})
t.Run("Raw", func(t *testing.T) {
+ PrintCurrentTest(t)
session := loginUser(t, "user2")
// Request raw paths
@@ -110,6 +121,7 @@ func testGit(t *testing.T, u *url.URL) {
})
t.Run("Media", func(t *testing.T) {
+ PrintCurrentTest(t)
session := loginUser(t, "user2")
// Request media paths
@@ -132,12 +144,14 @@ func testGit(t *testing.T, u *url.URL) {
})
t.Run("SSH", func(t *testing.T) {
+ PrintCurrentTest(t)
sshContext := baseAPITestContext
sshContext.Reponame = "repo-tmp-18"
keyname := "my-testing-key"
//Setup key the user ssh key
withKeyFile(t, keyname, func(keyFile string) {
t.Run("CreateUserKey", doAPICreateUserKey(sshContext, "test-key", keyFile))
+ PrintCurrentTest(t)
//Setup remote link
sshURL := createSSHUrl(sshContext.GitPath(), u)
@@ -149,6 +163,7 @@ func testGit(t *testing.T, u *url.URL) {
var little, big, littleLFS, bigLFS string
t.Run("Standard", func(t *testing.T) {
+ PrintCurrentTest(t)
t.Run("CreateRepo", doAPICreateRepository(sshContext, false))
//TODO get url from api
@@ -156,16 +171,21 @@ func testGit(t *testing.T, u *url.URL) {
//time.Sleep(5 * time.Minute)
t.Run("PushCommit", func(t *testing.T) {
+ PrintCurrentTest(t)
t.Run("Little", func(t *testing.T) {
+ PrintCurrentTest(t)
little = commitAndPush(t, littleSize, dstPath)
})
t.Run("Big", func(t *testing.T) {
+ PrintCurrentTest(t)
big = commitAndPush(t, bigSize, dstPath)
})
})
})
t.Run("LFS", func(t *testing.T) {
+ PrintCurrentTest(t)
t.Run("PushCommit", func(t *testing.T) {
+ PrintCurrentTest(t)
//Setup git LFS
_, err = git.NewCommand("lfs").AddArguments("install").RunInDir(dstPath)
assert.NoError(t, err)
@@ -175,17 +195,21 @@ func testGit(t *testing.T, u *url.URL) {
assert.NoError(t, err)
t.Run("Little", func(t *testing.T) {
+ PrintCurrentTest(t)
littleLFS = commitAndPush(t, littleSize, dstPath)
})
t.Run("Big", func(t *testing.T) {
+ PrintCurrentTest(t)
bigLFS = commitAndPush(t, bigSize, dstPath)
})
})
t.Run("Locks", func(t *testing.T) {
+ PrintCurrentTest(t)
lockTest(t, u.String(), dstPath)
})
})
t.Run("Raw", func(t *testing.T) {
+ PrintCurrentTest(t)
session := loginUser(t, "user2")
// Request raw paths
@@ -209,6 +233,7 @@ func testGit(t *testing.T, u *url.URL) {
})
t.Run("Media", func(t *testing.T) {
+ PrintCurrentTest(t)
session := loginUser(t, "user2")
// Request media paths