mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-13 14:59:03 +00:00
Add project secret & bug fix
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/simon987/task_tracker/api"
|
||||
"github.com/simon987/task_tracker/storage"
|
||||
"math"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -780,6 +781,42 @@ func TestTaskChain(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskReleaseBigInt(t *testing.T) {
|
||||
|
||||
createTask(api.SubmitTaskRequest{
|
||||
Project: testProject,
|
||||
VerificationCount: 1,
|
||||
Recipe: "bigint",
|
||||
}, testWorker)
|
||||
createTask(api.SubmitTaskRequest{
|
||||
Project: testProject,
|
||||
VerificationCount: 1,
|
||||
Recipe: "smallint",
|
||||
}, testWorker)
|
||||
|
||||
tid := getTaskFromProject(testProject, testWorker).Content.Task.Id
|
||||
tid2 := getTaskFromProject(testProject, testWorker).Content.Task.Id
|
||||
|
||||
r := releaseTask(api.ReleaseTaskRequest{
|
||||
Verification: math.MaxInt64,
|
||||
Result: storage.TR_OK,
|
||||
TaskId: tid,
|
||||
}, testWorker)
|
||||
|
||||
r2 := releaseTask(api.ReleaseTaskRequest{
|
||||
Verification: math.MinInt64,
|
||||
Result: storage.TR_OK,
|
||||
TaskId: tid2,
|
||||
}, testWorker)
|
||||
|
||||
if r.Content.Updated != true {
|
||||
t.Error()
|
||||
}
|
||||
if r2.Content.Updated != true {
|
||||
t.Error()
|
||||
}
|
||||
}
|
||||
|
||||
func createTask(request api.SubmitTaskRequest, worker *storage.Worker) (ar api.JsonResponse) {
|
||||
r := Post("/task/submit", request, worker, nil)
|
||||
UnmarshalResponse(r, &ar)
|
||||
|
||||
Reference in New Issue
Block a user