1
0
mirror of https://github.com/go-task/task.git synced 2025-11-29 22:48:03 +02:00

feat: add parallel test execution to improve runtime (#1882)

This commit is contained in:
christiandins
2024-12-12 01:47:10 +01:00
committed by GitHub
parent b9a5d1c573
commit 4dffab2e0a
14 changed files with 441 additions and 34 deletions

View File

@@ -9,6 +9,8 @@ import (
)
func TestAlphaNumericWithRootTasksFirst_Sort(t *testing.T) {
t.Parallel()
task1 := &ast.Task{Task: "task1"}
task2 := &ast.Task{Task: "task2"}
task3 := &ast.Task{Task: "ns1:task3"}
@@ -40,6 +42,8 @@ func TestAlphaNumericWithRootTasksFirst_Sort(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
s := &AlphaNumericWithRootTasksFirst{}
s.Sort(tt.tasks)
assert.Equal(t, tt.want, tt.tasks)
@@ -48,6 +52,8 @@ func TestAlphaNumericWithRootTasksFirst_Sort(t *testing.T) {
}
func TestAlphaNumeric_Sort(t *testing.T) {
t.Parallel()
task1 := &ast.Task{Task: "task1"}
task2 := &ast.Task{Task: "task2"}
task3 := &ast.Task{Task: "ns1:task3"}
@@ -69,6 +75,8 @@ func TestAlphaNumeric_Sort(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
s := &AlphaNumeric{}
s.Sort(tt.tasks)
assert.Equal(t, tt.tasks, tt.want)