You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/07/15 08:31:11 UTC

[GitHub] [camel-k] tadayosi opened a new pull request, #3451: chore(e2e): reuse namespaces as much as possible for E2E tests

tadayosi opened a new pull request, #3451:
URL: https://github.com/apache/camel-k/pull/3451

   <!-- Description -->
   
   This applies our e2e policy to reuse namespaces as much as possible on the E2E tests, discussed at #3298:
   
   > Have a single `TestRun()` function and define multiple `t.Run("xxx", ...)` blocks inside `WithNewTestNamespace()`, which uses only a single namespace and platform throughout the test suite.
   
   as well as some refactoring too.
   
   Fix #3298 
   
   
   <!--
   Enter your extended release note in the below block. If the PR requires
   additional action from users switching to the new release, include the string
   "action required". If no release note is required, write "NONE". 
   
   You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
   the text is added to the right section of the release notes. 
   -->
   
   **Release Note**
   ```release-note
   NONE
   ```
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] phantomjinx commented on a diff in pull request #3451: chore(e2e): reuse namespaces as much as possible for E2E tests

Posted by GitBox <gi...@apache.org>.
phantomjinx commented on code in PR #3451:
URL: https://github.com/apache/camel-k/pull/3451#discussion_r922159620


##########
e2e/namespace/install/cli/run_test.go:
##########
@@ -36,78 +36,75 @@ import (
 	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
 )
 
-func TestRunExamplesFromGitHub(t *testing.T) {
+func TestRun(t *testing.T) {

Review Comment:
   Given these names show up the test log and can be a great way of finding the "needle in the haystack", can you make this less generic?



##########
e2e/global/builder/registry_test.go:
##########
@@ -0,0 +1,89 @@
+//go:build integration
+// +build integration
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+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 builder
+
+import (
+	"os"
+	"testing"
+
+	. "github.com/onsi/gomega"
+
+	v1 "k8s.io/api/core/v1"
+
+	. "github.com/apache/camel-k/e2e/support"
+)
+
+func TestRunWithDockerHubRegistry(t *testing.T) {
+	user := os.Getenv("TEST_DOCKER_HUB_USERNAME")
+	pass := os.Getenv("TEST_DOCKER_HUB_PASSWORD")
+	if user == "" || pass == "" {
+		t.Skip("no docker hub credentials: skipping")
+		return
+	}
+
+	WithNewTestNamespace(t, func(ns string) {
+		operatorID := "camel-k-docker-hub"
+		Expect(KamelInstallWithID(operatorID, ns,
+			"--registry", "docker.io",

Review Comment:
   Is `--registry` an operator switch or a platform switch?
   If under global, an operator switch becomes problematic as the operator is not reinstalled so that switch may not be re-applied. If platform then all is good because a new platform is always created in the new namespace.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] tadayosi merged pull request #3451: chore(e2e): reuse namespaces as much as possible for E2E tests

Posted by GitBox <gi...@apache.org>.
tadayosi merged PR #3451:
URL: https://github.com/apache/camel-k/pull/3451


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] tadayosi commented on a diff in pull request #3451: chore(e2e): reuse namespaces as much as possible for E2E tests

Posted by GitBox <gi...@apache.org>.
tadayosi commented on code in PR #3451:
URL: https://github.com/apache/camel-k/pull/3451#discussion_r922622943


##########
e2e/global/builder/registry_test.go:
##########
@@ -0,0 +1,89 @@
+//go:build integration
+// +build integration
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+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 builder
+
+import (
+	"os"
+	"testing"
+
+	. "github.com/onsi/gomega"
+
+	v1 "k8s.io/api/core/v1"
+
+	. "github.com/apache/camel-k/e2e/support"
+)
+
+func TestRunWithDockerHubRegistry(t *testing.T) {
+	user := os.Getenv("TEST_DOCKER_HUB_USERNAME")
+	pass := os.Getenv("TEST_DOCKER_HUB_PASSWORD")
+	if user == "" || pass == "" {
+		t.Skip("no docker hub credentials: skipping")
+		return
+	}
+
+	WithNewTestNamespace(t, func(ns string) {
+		operatorID := "camel-k-docker-hub"
+		Expect(KamelInstallWithID(operatorID, ns,
+			"--registry", "docker.io",

Review Comment:
   fyi @squakez @christophd @astefanutti 



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] tadayosi commented on a diff in pull request #3451: chore(e2e): reuse namespaces as much as possible for E2E tests

Posted by GitBox <gi...@apache.org>.
tadayosi commented on code in PR #3451:
URL: https://github.com/apache/camel-k/pull/3451#discussion_r922622781


##########
e2e/global/builder/registry_test.go:
##########
@@ -0,0 +1,89 @@
+//go:build integration
+// +build integration
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+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 builder
+
+import (
+	"os"
+	"testing"
+
+	. "github.com/onsi/gomega"
+
+	v1 "k8s.io/api/core/v1"
+
+	. "github.com/apache/camel-k/e2e/support"
+)
+
+func TestRunWithDockerHubRegistry(t *testing.T) {
+	user := os.Getenv("TEST_DOCKER_HUB_USERNAME")
+	pass := os.Getenv("TEST_DOCKER_HUB_PASSWORD")
+	if user == "" || pass == "" {
+		t.Skip("no docker hub credentials: skipping")
+		return
+	}
+
+	WithNewTestNamespace(t, func(ns string) {
+		operatorID := "camel-k-docker-hub"
+		Expect(KamelInstallWithID(operatorID, ns,
+			"--registry", "docker.io",

Review Comment:
   It's a platform switch encoded into `IntegrationPlatform`, so it should be ok.
   
   As a side note, now `kamel install` seems to be a bit overloaded with those flags for different concerns. There's no easy way to distinguish between operator swtiches and platform switches. Maybe we should split the command into two: operator installation and platform installation.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org