From e55c00eca7e70e2d02860cda3cdc9169a88ece36 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Sat, 27 Aug 2016 19:21:05 +0200 Subject: Run the tests in parallel This saves about 1s, or 1/3 of the test runtime. The linking is still much slower, but this we can control. --- git_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git_test.go') diff --git a/git_test.go b/git_test.go index 58caf71..bdb6837 100644 --- a/git_test.go +++ b/git_test.go @@ -109,6 +109,7 @@ func updateReadme(t *testing.T, repo *Repository, content string) (*Oid, *Oid) { } func TestOidZero(t *testing.T) { + t.Parallel() var zeroId Oid if !zeroId.IsZero() { @@ -117,6 +118,7 @@ func TestOidZero(t *testing.T) { } func TestEmptyOid(t *testing.T) { + t.Parallel() _, err := NewOid("") if err == nil || !IsErrorCode(err, ErrGeneric) { t.Fatal("Should have returned invalid error") -- cgit v1.2.3 From a16e24a99e0138e5ee897f80a53a97a2bd4b9c49 Mon Sep 17 00:00:00 2001 From: Geordie Henderson Date: Fri, 16 Sep 2016 21:49:54 -0700 Subject: Write the index before writing the index tree in seedTestRepo test helper func --- git_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git_test.go') diff --git a/git_test.go b/git_test.go index bdb6837..3385a72 100644 --- a/git_test.go +++ b/git_test.go @@ -58,6 +58,8 @@ func seedTestRepo(t *testing.T, repo *Repository) (*Oid, *Oid) { checkFatal(t, err) err = idx.AddByPath("README") checkFatal(t, err) + err = idx.Write() + checkFatal(t, err) treeId, err := idx.WriteTree() checkFatal(t, err) -- cgit v1.2.3