6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-07 16:59:16 +00:00

Add test parallelization and re-enable paralleltest linter

This commit is contained in:
Grzegorz Dlugoszewski
2025-08-25 19:13:09 +02:00
parent eabef7b444
commit df6c239099
9 changed files with 50 additions and 3 deletions

View File

@@ -12,6 +12,8 @@ import (
)
func TestUncommitted(t *testing.T) {
t.Parallel()
tests := []struct {
name string
repoMaker func(*testing.T) *test.Repo
@@ -46,6 +48,7 @@ func TestUncommitted(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
r, _ := Open(test.repoMaker(t).Path())
got, err := r.Uncommitted()
@@ -60,6 +63,8 @@ func TestUncommitted(t *testing.T) {
}
}
func TestUntracked(t *testing.T) {
t.Parallel()
tests := []struct {
name string
repoMaker func(*testing.T) *test.Repo
@@ -94,6 +99,7 @@ func TestUntracked(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
r, _ := Open(test.repoMaker(t).Path())
got, err := r.Untracked()
@@ -109,6 +115,8 @@ func TestUntracked(t *testing.T) {
}
func TestCurrentBranch(t *testing.T) {
t.Parallel()
tests := []struct {
name string
repoMaker func(*testing.T) *test.Repo
@@ -133,6 +141,7 @@ func TestCurrentBranch(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
r, _ := Open(test.repoMaker(t).Path())
got, err := r.CurrentBranch()
@@ -147,6 +156,8 @@ func TestCurrentBranch(t *testing.T) {
}
}
func TestBranches(t *testing.T) {
t.Parallel()
tests := []struct {
name string
repoMaker func(*testing.T) *test.Repo
@@ -176,6 +187,7 @@ func TestBranches(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
r, _ := Open(test.repoMaker(t).Path())
got, err := r.Branches()
@@ -190,6 +202,8 @@ func TestBranches(t *testing.T) {
}
}
func TestUpstream(t *testing.T) {
t.Parallel()
tests := []struct {
name string
repoMaker func(*testing.T) *test.Repo
@@ -231,6 +245,7 @@ func TestUpstream(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
r, _ := Open(test.repoMaker(t).Path())
got, _ := r.Upstream(test.branch)
@@ -246,6 +261,8 @@ func TestUpstream(t *testing.T) {
}
}
func TestAheadBehind(t *testing.T) {
t.Parallel()
tests := []struct {
name string
repoMaker func(*testing.T) *test.Repo
@@ -281,6 +298,7 @@ func TestAheadBehind(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
r, _ := Open(test.repoMaker(t).Path())
upstream, err := r.Upstream(test.branch)
@@ -301,6 +319,7 @@ func TestAheadBehind(t *testing.T) {
}
func TestCleanupFailedClone(t *testing.T) {
t.Parallel()
// Test dir structure:
// root
// └── a/
@@ -335,6 +354,7 @@ func TestCleanupFailedClone(t *testing.T) {
for i, test := range tests {
t.Run(strconv.Itoa(i), func(t *testing.T) {
t.Parallel()
root := createTestDirTree(t)
path := filepath.Join(root, test.path)
@@ -354,6 +374,8 @@ func TestCleanupFailedClone(t *testing.T) {
}
func TestRemote(t *testing.T) {
t.Parallel()
tests := []struct {
name string
repoMaker func(*testing.T) *test.Repo
@@ -382,6 +404,7 @@ func TestRemote(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
r, _ := Open(test.repoMaker(t).Path())
got, err := r.Remote()