squakez commented on code in PR #6571:
URL: https://github.com/apache/camel-k/pull/6571#discussion_r3093687411
##########
pkg/controller/integration/integration_controller_test.go:
##########
@@ -19,186 +19,58 @@ package integration
import (
"testing"
- "time"
"github.com/stretchr/testify/assert"
- corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ "github.com/stretchr/testify/require"
)
-func TestIsIntegrationUpdated(t *testing.T) {
Review Comment:
Why removing all these unit tests?
##########
pkg/controller/integrationkit/integrationkit_controller_test.go:
##########
@@ -0,0 +1,42 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package integrationkit
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestActions(t *testing.T) {
Review Comment:
This is testing nothing of business logic. Better to remove to avoid the
false impression of a coverage that does not really exits.
##########
pkg/controller/integration/integration_controller.go:
##########
@@ -79,6 +79,27 @@ func newReconciler(mgr manager.Manager, c client.Client)
reconcile.Reconciler {
client: c,
scheme: mgr.GetScheme(),
recorder:
mgr.GetEventRecorder("camel-k-integration-controller"),
+ syntheticActions: append(
+ []Action{
+ NewPlatformSetupAction(),
+ NewInitializeAction(),
+ NewBuildAction(),
+ newBuildKitAction(),
+ NewBuildCompleteAction(),
+ },
+ NewMonitorSyntheticAction(),
+ ),
+ nonSyntheticActions: append(
Review Comment:
call it "baseActions" instead
##########
pkg/controller/catalog/action.go:
##########
@@ -25,10 +25,11 @@ import (
"github.com/apache/camel-k/v2/pkg/util/log"
)
+type actionLoggerKey struct{}
+
// Action --.
type Action interface {
client.Injectable
- log.Injectable
Review Comment:
I don't think we need to include any optimization here. If any, it should be
treated with a separate PR.
##########
pkg/controller/integrationplatform/integrationplatform_controller_test.go:
##########
@@ -0,0 +1,40 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package integrationplatform
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestActions(t *testing.T) {
Review Comment:
Ditto
##########
pkg/controller/pipe/pipe_controller_test.go:
##########
@@ -0,0 +1,38 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package pipe
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestActions(t *testing.T) {
Review Comment:
Ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]