chore: build
This commit is contained in:
@@ -14,55 +14,6 @@ import (
|
||||
|
||||
func ptr[T any](v T) *T { return &v }
|
||||
|
||||
func TestNextReplicas_SuspendThenResumeRestoresOriginalCount(t *testing.T) {
|
||||
annotations := map[string]string{}
|
||||
current := ptr(int32(3))
|
||||
|
||||
target, changed := nextReplicas(current, &annotations, false)
|
||||
if !changed || target != 0 {
|
||||
t.Fatalf("suspension: target=%d changed=%v", target, changed)
|
||||
}
|
||||
if annotations[replicasBeforeSuspendAnnotation] != "3" {
|
||||
t.Fatalf("annotation=%q, attendu 3", annotations[replicasBeforeSuspendAnnotation])
|
||||
}
|
||||
|
||||
// Déjà à 0 : suspendre à nouveau ne doit pas écraser l'annotation.
|
||||
current = ptr(int32(0))
|
||||
if _, changed := nextReplicas(current, &annotations, false); changed {
|
||||
t.Error("suspension répétée non idempotente")
|
||||
}
|
||||
if annotations[replicasBeforeSuspendAnnotation] != "3" {
|
||||
t.Error("l'annotation a été écrasée")
|
||||
}
|
||||
|
||||
target, changed = nextReplicas(current, &annotations, true)
|
||||
if !changed || target != 3 {
|
||||
t.Fatalf("relance: target=%d changed=%v, attendu 3", target, changed)
|
||||
}
|
||||
if _, still := annotations[replicasBeforeSuspendAnnotation]; still {
|
||||
t.Error("annotation non nettoyée après la relance")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNextReplicas_ResumeWithoutAnnotationDefaultsToOne(t *testing.T) {
|
||||
annotations := map[string]string{}
|
||||
target, changed := nextReplicas(ptr(int32(0)), &annotations, true)
|
||||
if !changed || target != 1 {
|
||||
t.Errorf("target=%d changed=%v, attendu 1", target, changed)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNextReplicas_ResumeRunningWorkloadIsNoop(t *testing.T) {
|
||||
annotations := map[string]string{}
|
||||
if _, changed := nextReplicas(ptr(int32(2)), &annotations, true); changed {
|
||||
t.Error("relance d'une charge déjà active")
|
||||
}
|
||||
}
|
||||
|
||||
// TestVitrineValuesRenderWithCharts génère les valeurs comme ProvisionProject
|
||||
// puis rend les charts de deploy/chart-vitrine avec helm : garantit que les
|
||||
// clés attendues existent, que les validations des charts passent et que les
|
||||
// noms de Services calculés côté Go sont bien ceux des charts.
|
||||
func TestVitrineValuesRenderWithCharts(t *testing.T) {
|
||||
if _, err := exec.LookPath("helm"); err != nil {
|
||||
t.Skip("helm absent du PATH")
|
||||
|
||||
Reference in New Issue
Block a user