feat: sync deployed v1.0.0-rc.38-custom.42
Publish Docker image (Multi-arch) / Build & push (amd64) (push) Failing after 1m40s
Release (Linux, macOS, Windows) / Linux Release (push) Failing after 42m16s
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Canceled after 0s
Release (Linux, macOS, Windows) / macOS Release (push) Canceled after 0s
Release (Linux, macOS, Windows) / Windows Release (push) Canceled after 0s
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Canceled after 0s
Publish Docker image (Multi-arch) / Build & push (amd64) (push) Failing after 1m40s
Release (Linux, macOS, Windows) / Linux Release (push) Failing after 42m16s
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Canceled after 0s
Release (Linux, macOS, Windows) / macOS Release (push) Canceled after 0s
Release (Linux, macOS, Windows) / Windows Release (push) Canceled after 0s
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Canceled after 0s
Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
1 parent
c2b44332d6
commit
a5f7b8e586
828 files changed
+122253
-13702
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/QuantumNous/new-api/common"
|
||||
"github.com/QuantumNous/new-api/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGroupProbeHistoryKeepsLatestEighteen(t *testing.T) {
|
||||
tasks := []model.SystemTask{}
|
||||
for i := 20; i > 0; i-- {
|
||||
state, _ := common.Marshal(ChannelAvailabilityState{Rounds: []ChannelAvailabilityRound{{ChannelID: 1, At: int64(i), Success: i != 20}, {ChannelID: 2, At: int64(i), Success: true}}})
|
||||
tasks = append(tasks, model.SystemTask{Type: model.SystemTaskTypeChannelAvailability, State: string(state)})
|
||||
}
|
||||
history := GroupProbeHistory([]int{1, 2}, tasks)
|
||||
assert.Len(t, history, 18)
|
||||
assert.Equal(t, int64(3), history[0].At)
|
||||
assert.Equal(t, 2, history[17].Status)
|
||||
assert.Empty(t, GroupProbeHistory([]int{3}, tasks))
|
||||
}
|
||||
Reference in new issue
Block a user