mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Refactor some tests (#34580)
1. use `test.MockVariableValue` as much as possible 2. avoid `time.Sleep` as much as possible
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
auth_model "code.gitea.io/gitea/models/auth"
|
||||
"code.gitea.io/gitea/models/repo"
|
||||
@@ -889,8 +888,7 @@ jobs:
|
||||
// 4. Execute a single Job
|
||||
task := runner.fetchTask(t)
|
||||
outcome := &mockTaskOutcome{
|
||||
result: runnerv1.Result_RESULT_SUCCESS,
|
||||
execTime: time.Millisecond,
|
||||
result: runnerv1.Result_RESULT_SUCCESS,
|
||||
}
|
||||
runner.execTask(t, task, outcome)
|
||||
|
||||
@@ -926,8 +924,7 @@ jobs:
|
||||
// 6. Execute a single Job
|
||||
task = runner.fetchTask(t)
|
||||
outcome = &mockTaskOutcome{
|
||||
result: runnerv1.Result_RESULT_FAILURE,
|
||||
execTime: time.Millisecond,
|
||||
result: runnerv1.Result_RESULT_FAILURE,
|
||||
}
|
||||
runner.execTask(t, task, outcome)
|
||||
|
||||
|
Reference in New Issue
Block a user