mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
Full module path rebrand from Temporal to Hanzo Tasks: - go.mod module: github.com/hanzoai/tasks - All internal Go imports updated (1906 files) - cmd/server renamed to cmd/tasksd - Binary name: tasksd (was temporal-server) - Docker images: hanzoai/tasks (was temporalio/server) - README rewritten with Hanzo Tasks branding - LLM.md created with integration notes - Makefile, goreleaser, CI workflows updated - go.temporal.io/sdk and go.temporal.io/api imports preserved (separate repos) Fork of Temporal.io (MIT license).
50 lines
1.8 KiB
Go
50 lines
1.8 KiB
Go
package deletedlqtasks_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
"go.temporal.io/api/serviceerror"
|
|
commonspb "github.com/hanzoai/tasks/api/common/v1"
|
|
"github.com/hanzoai/tasks/api/historyservice/v1"
|
|
"github.com/hanzoai/tasks/common/persistence"
|
|
"github.com/hanzoai/tasks/common/persistence/persistencetest"
|
|
"github.com/hanzoai/tasks/service/history/api/deletedlqtasks"
|
|
"github.com/hanzoai/tasks/service/history/tasks"
|
|
"google.golang.org/grpc/codes"
|
|
)
|
|
|
|
func TestInvoke_InvalidCategory(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
queueKey := persistencetest.GetQueueKey(t, persistencetest.WithQueueType(persistence.QueueTypeHistoryDLQ))
|
|
_, err := deletedlqtasks.Invoke(context.Background(), nil, &historyservice.DeleteDLQTasksRequest{
|
|
DlqKey: &commonspb.HistoryDLQKey{
|
|
TaskCategory: -1,
|
|
SourceCluster: queueKey.SourceCluster,
|
|
TargetCluster: queueKey.TargetCluster,
|
|
},
|
|
}, tasks.NewDefaultTaskCategoryRegistry())
|
|
require.Error(t, err)
|
|
assert.Equal(t, codes.InvalidArgument, serviceerror.ToStatus(err).Code())
|
|
assert.ErrorContains(t, err, "-1")
|
|
}
|
|
|
|
func TestInvoke_ErrDeleteMissingMessageIDUpperBound(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
queueKey := persistencetest.GetQueueKey(t, persistencetest.WithQueueType(persistence.QueueTypeHistoryDLQ))
|
|
_, err := deletedlqtasks.Invoke(context.Background(), nil, &historyservice.DeleteDLQTasksRequest{
|
|
DlqKey: &commonspb.HistoryDLQKey{
|
|
TaskCategory: int32(queueKey.Category.ID()),
|
|
SourceCluster: queueKey.SourceCluster,
|
|
TargetCluster: queueKey.TargetCluster,
|
|
},
|
|
}, tasks.NewDefaultTaskCategoryRegistry())
|
|
require.Error(t, err)
|
|
assert.Equal(t, codes.InvalidArgument, serviceerror.ToStatus(err).Code())
|
|
assert.ErrorContains(t, err, "inclusive_max_task_metadata")
|
|
}
|