Skip to content

Commit

Permalink
XXX: Bumped test tiemouts, build timeouts and deisabled catalog and k…
Browse files Browse the repository at this point in the history
…its copy
  • Loading branch information
valdar committed Apr 16, 2024
1 parent 0312d46 commit 046ed3e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
66 changes: 33 additions & 33 deletions e2e/support/test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ const ExpectedOSClusterRoles = 1

var TestDefaultNamespace = "default"

var TestTimeoutShort = 1 * time.Minute
var TestTimeoutMedium = 5 * time.Minute
var TestTimeoutLong = 15 * time.Minute
var TestTimeoutShort = 5 * time.Minute
var TestTimeoutMedium = 20 * time.Minute
var TestTimeoutLong = 30 * time.Minute

// TestTimeoutVeryLong should be used only for testing native builds.
var TestTimeoutVeryLong = 60 * time.Minute
Expand Down Expand Up @@ -1989,36 +1989,36 @@ func PlatformByName(t *testing.T, ctx context.Context, ns string, name string) f
}

func CopyIntegrationKits(t *testing.T, ctx context.Context, ns, operatorID string) error {
opns := GetEnvOrDefault("CAMEL_K_GLOBAL_OPERATOR_NS", TestDefaultNamespace)

lst := v1.NewIntegrationKitList()
if err := TestClient(t).List(ctx, &lst, ctrl.InNamespace(opns)); err != nil {
failTest(t, err)
}
for _, kit := range lst.Items {
if kit.Status.Image != "" {
copyKit := v1.IntegrationKit{
ObjectMeta: metav1.ObjectMeta{
Namespace: ns,
Name: kit.Name,
},
Spec: *kit.Spec.DeepCopy(),
}

if copyKit.Labels == nil {
copyKit.Labels = make(map[string]string)
}

copyKit.Labels[v1.IntegrationKitTypeLabel] = v1.IntegrationKitTypeExternal
copyKit.Spec.Image = kit.Status.Image

v1.SetAnnotation(&copyKit.ObjectMeta, v1.OperatorIDAnnotation, operatorID)
fmt.Printf("Copy integration kit %s from namespace %s\n", kit.Name, opns)
if err := CreateIntegrationKit(t, ctx, &copyKit)(); err != nil {
return err
}
}
}
//opns := GetEnvOrDefault("CAMEL_K_GLOBAL_OPERATOR_NS", TestDefaultNamespace)
//
//lst := v1.NewIntegrationKitList()
//if err := TestClient(t).List(ctx, &lst, ctrl.InNamespace(opns)); err != nil {
// failTest(t, err)
//}
//for _, kit := range lst.Items {
// if kit.Status.Image != "" && kit.Status.Phase == v1.IntegrationKitPhaseReady {
// copyKit := v1.IntegrationKit{
// ObjectMeta: metav1.ObjectMeta{
// Namespace: ns,
// Name: kit.Name,
// },
// Spec: *kit.Spec.DeepCopy(),
// }
//
// if copyKit.Labels == nil {
// copyKit.Labels = make(map[string]string)
// }
//
// copyKit.Labels[v1.IntegrationKitTypeLabel] = v1.IntegrationKitTypeExternal
// copyKit.Spec.Image = kit.Status.Image
//
// v1.SetAnnotation(&copyKit.ObjectMeta, v1.OperatorIDAnnotation, operatorID)
// fmt.Printf("Copy integration kit %s from namespace %s\n", kit.Name, opns)
// if err := CreateIntegrationKit(t, ctx, &copyKit)(); err != nil {
// return err
// }
// }
//}

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/integrationplatform/initialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestTimeouts_Default(t *testing.T) {
require.NoError(t, err)
assert.NotNil(t, answer)

assert.Equal(t, 5*time.Minute, answer.Status.Build.GetTimeout().Duration)
assert.Equal(t, 10*time.Minute, answer.Status.Build.GetTimeout().Duration)
}

func TestTimeouts_MavenComputedFromBuild(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error {
// Build timeout
if p.Status.Build.GetTimeout().Duration == 0 {
p.Status.Build.Timeout = &metav1.Duration{
Duration: 5 * time.Minute,
Duration: 10 * time.Minute,
}
} else {
d := p.Status.Build.GetTimeout().Duration.Truncate(time.Second)
Expand Down

0 comments on commit 046ed3e

Please sign in to comment.