Skip to content

Commit

Permalink
fix: Fix budget adjustments e2e tests (#611)
Browse files Browse the repository at this point in the history
## Motivation

Fix broken budgetadjustments e2e tests

---------

Co-authored-by: kubaceg <[email protected]>
  • Loading branch information
kubaceg and kubaceg authored Dec 13, 2024
1 parent d597b56 commit 49b4b19
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/v1alpha_budgetadjustment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func Test_Objects_V1_V1alpha_BudgetAdjustments(t *testing.T) {
},
v1alphaBudgetAdjustment.Spec{
Description: objectDescription,
FirstEventStart: time.Now().Add(time.Hour).Truncate(time.Millisecond).UTC(),
FirstEventStart: time.Now().Add(time.Hour).Truncate(time.Second).UTC(),
Duration: "1h",
Filters: v1alphaBudgetAdjustment.Filters{
SLOs: []v1alphaBudgetAdjustment.SLORef{
Expand All @@ -51,7 +51,7 @@ func Test_Objects_V1_V1alpha_BudgetAdjustments(t *testing.T) {
},
v1alphaBudgetAdjustment.Spec{
Description: objectDescription,
FirstEventStart: time.Now().Add(time.Hour).Truncate(time.Millisecond).UTC(),
FirstEventStart: time.Now().Add(time.Hour).Truncate(time.Second).UTC(),
Duration: "5h",
Rrule: "FREQ=DAILY;COUNT=5",
Filters: v1alphaBudgetAdjustment.Filters{
Expand Down Expand Up @@ -107,6 +107,7 @@ func Test_Objects_V1_V1alpha_BudgetAdjustments_validation(t *testing.T) {
t.Parallel()
ctx := context.Background()
slo := generateSLO(t)
ts := time.Now().Truncate(time.Second).UTC()

validationTests := map[string]struct {
request v1alphaBudgetAdjustment.BudgetAdjustment
Expand All @@ -118,7 +119,7 @@ func Test_Objects_V1_V1alpha_BudgetAdjustments_validation(t *testing.T) {
Name: "!#$%^&*()",
},
v1alphaBudgetAdjustment.Spec{
FirstEventStart: time.Now(),
FirstEventStart: ts,
Duration: "1h",
Filters: v1alphaBudgetAdjustment.Filters{
SLOs: []v1alphaBudgetAdjustment.SLORef{
Expand All @@ -137,7 +138,7 @@ func Test_Objects_V1_V1alpha_BudgetAdjustments_validation(t *testing.T) {
Name: "missing-duration",
},
v1alphaBudgetAdjustment.Spec{
FirstEventStart: time.Now(),
FirstEventStart: ts,
Filters: v1alphaBudgetAdjustment.Filters{
SLOs: []v1alphaBudgetAdjustment.SLORef{
{
Expand Down Expand Up @@ -173,7 +174,7 @@ func Test_Objects_V1_V1alpha_BudgetAdjustments_validation(t *testing.T) {
Name: "missing-duration",
},
v1alphaBudgetAdjustment.Spec{
FirstEventStart: time.Now(),
FirstEventStart: ts,
Duration: "1h",
Filters: v1alphaBudgetAdjustment.Filters{
SLOs: []v1alphaBudgetAdjustment.SLORef{
Expand All @@ -196,7 +197,7 @@ func Test_Objects_V1_V1alpha_BudgetAdjustments_validation(t *testing.T) {
Name: "missing-duration",
},
v1alphaBudgetAdjustment.Spec{
FirstEventStart: time.Now(),
FirstEventStart: ts,
Duration: "1h",
Filters: v1alphaBudgetAdjustment.Filters{
SLOs: []v1alphaBudgetAdjustment.SLORef{
Expand Down

0 comments on commit 49b4b19

Please sign in to comment.