test(HH-572): cover PostgreSQL longest-waiting null order (#146)
Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -214,7 +214,11 @@ func TestAssignmentEligibilityRejectsSoftDeletedUserAndAccountUser(t *testing.T)
|
||||
}
|
||||
|
||||
func TestLongestWaitingSortsUnknownActivityLast(t *testing.T) {
|
||||
db := setupCapacityAssignmentDB(t)
|
||||
testLongestWaitingSortsUnknownActivityLast(t, setupCapacityAssignmentDB(t))
|
||||
}
|
||||
|
||||
func testLongestWaitingSortsUnknownActivityLast(t *testing.T, db *gorm.DB) {
|
||||
t.Helper()
|
||||
account := &model.Account{Name: "Longest waiting"}
|
||||
require.NoError(t, db.Create(account).Error)
|
||||
inbox := &model.Inbox{AccountID: account.ID, Name: "Inbox", ChannelType: string(model.InboxChannelTypeWebWidget)}
|
||||
|
||||
@@ -221,6 +221,14 @@ func TestAssignmentServiceOnlyOneConcurrentWorkerWinsPostgres(t *testing.T) {
|
||||
testAssignmentServiceOnlyOneConcurrentWorkerWins(t, db, rdb)
|
||||
}
|
||||
|
||||
func TestLongestWaitingSortsUnknownActivityLastPostgres(t *testing.T) {
|
||||
if os.Getenv("GOCHAT_TEST_DB") != "postgres" {
|
||||
t.Skip("PostgreSQL longest-waiting test")
|
||||
}
|
||||
db, _ := setupFullAAPostgresDB_Cov9(t)
|
||||
testLongestWaitingSortsUnknownActivityLast(t, db)
|
||||
}
|
||||
|
||||
func testAssignmentServiceOnlyOneConcurrentWorkerWins(t *testing.T, db *gorm.DB, rdb *redis.Client) {
|
||||
t.Helper()
|
||||
account, agent, inbox, conversation := seedAssignableConversation_Cov9(t, db)
|
||||
|
||||
Reference in New Issue
Block a user