diff --git a/e2e/README.md b/e2e/README.md index 4119885a9e..0f44a1cc4f 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -33,7 +33,7 @@ Test suite that cover the different installation procedures we offer and any upg ### Knative -Test suite that cover the features associated with Knative. This test will assume the presence of a namespaced operator (installation provided by the same test execution suite) togheter with Knative operator configuration. +Test suite that cover the features associated with Knative. This test will assume the presence of a namespaced operator (installation provided by the same test execution suite) together with Knative operator configuration. ### Native @@ -45,7 +45,7 @@ Test suite that cover the features associated with Telemetry feature. The test e ### Yaks -Test suite that cover certain Knative features togheter with YAKS operator. +Test suite that cover certain Knative features together with YAKS operator. ## Environment variables diff --git a/e2e/builder/files/example.yaml b/e2e/builder/files/example.yaml index 861535412e..dfc43f678d 100644 --- a/e2e/builder/files/example.yaml +++ b/e2e/builder/files/example.yaml @@ -1,3 +1,6 @@ +# camel-k: language=yaml + +# --------------------------------------------------------------------------- # 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. @@ -12,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:tick" diff --git a/e2e/common/config/files/build-property-file-route.yaml b/e2e/common/config/files/build-property-file-route.yaml index 76e38ced71..0f6d64c5c2 100644 --- a/e2e/common/config/files/build-property-file-route.yaml +++ b/e2e/common/config/files/build-property-file-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:build-property" diff --git a/e2e/common/config/files/build-property-route.yaml b/e2e/common/config/files/build-property-route.yaml index 76e38ced71..0f6d64c5c2 100644 --- a/e2e/common/config/files/build-property-route.yaml +++ b/e2e/common/config/files/build-property-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:build-property" diff --git a/e2e/common/config/files/config-configmap-properties-route.yaml b/e2e/common/config/files/config-configmap-properties-route.yaml index 89e359746d..4c710304d0 100644 --- a/e2e/common/config/files/config-configmap-properties-route.yaml +++ b/e2e/common/config/files/config-configmap-properties-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:configmap" diff --git a/e2e/common/config/files/config-configmap-route.yaml b/e2e/common/config/files/config-configmap-route.yaml index 4b526d41e9..5f612f768e 100644 --- a/e2e/common/config/files/config-configmap-route.yaml +++ b/e2e/common/config/files/config-configmap-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:configmap" diff --git a/e2e/common/config/files/config-secret-key-route.yaml b/e2e/common/config/files/config-secret-key-route.yaml index ab76506a36..a41f2f7b48 100644 --- a/e2e/common/config/files/config-secret-key-route.yaml +++ b/e2e/common/config/files/config-secret-key-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:secret" diff --git a/e2e/common/config/files/config-secret-route.yaml b/e2e/common/config/files/config-secret-route.yaml index 03bd7440ed..9de829a017 100644 --- a/e2e/common/config/files/config-secret-route.yaml +++ b/e2e/common/config/files/config-secret-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:secret" diff --git a/e2e/common/config/files/property-file-route.yaml b/e2e/common/config/files/property-file-route.yaml index ea33d2a955..a9e159aa7e 100644 --- a/e2e/common/config/files/property-file-route.yaml +++ b/e2e/common/config/files/property-file-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:property-file" diff --git a/e2e/common/config/files/property-route.yaml b/e2e/common/config/files/property-route.yaml index 4d7a924b7f..858d89f8ca 100644 --- a/e2e/common/config/files/property-route.yaml +++ b/e2e/common/config/files/property-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:property" diff --git a/e2e/common/config/files/property-secret-route.yaml b/e2e/common/config/files/property-secret-route.yaml index b826aed975..8ca2159044 100644 --- a/e2e/common/config/files/property-secret-route.yaml +++ b/e2e/common/config/files/property-secret-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "timer:property" diff --git a/e2e/common/config/files/resource-configmap-key-location-route.yaml b/e2e/common/config/files/resource-configmap-key-location-route.yaml index 428ec1c3b3..b7fb09c173 100644 --- a/e2e/common/config/files/resource-configmap-key-location-route.yaml +++ b/e2e/common/config/files/resource-configmap-key-location-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "file:/tmp/app/?fileName=test.txt&noop=true&idempotent=false" diff --git a/e2e/common/config/files/resource-configmap-location-route.yaml b/e2e/common/config/files/resource-configmap-location-route.yaml index fe4638b114..093e42d2cf 100644 --- a/e2e/common/config/files/resource-configmap-location-route.yaml +++ b/e2e/common/config/files/resource-configmap-location-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "file:/tmp/app/?fileName=my-configmap-key&noop=true&idempotent=false" diff --git a/e2e/common/config/files/resource-configmap-route.yaml b/e2e/common/config/files/resource-configmap-route.yaml index d5e823f63e..3c90b8923f 100644 --- a/e2e/common/config/files/resource-configmap-route.yaml +++ b/e2e/common/config/files/resource-configmap-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "file:/etc/camel/resources/my-cm/?fileName=my-configmap-key&noop=true&idempotent=false" diff --git a/e2e/common/config/files/resource-secret-route.yaml b/e2e/common/config/files/resource-secret-route.yaml index 9407c79219..024a4d7ec4 100644 --- a/e2e/common/config/files/resource-secret-route.yaml +++ b/e2e/common/config/files/resource-secret-route.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "file:/etc/camel/resources/my-sec/?fileName=my-secret-key&noop=true&idempotent=false" diff --git a/e2e/common/traits/files/openapi/petstore.yaml b/e2e/common/traits/files/openapi/petstore.yaml index 1031c5ed39..72087814fe 100644 --- a/e2e/common/traits/files/openapi/petstore.yaml +++ b/e2e/common/traits/files/openapi/petstore.yaml @@ -1,5 +1,6 @@ # camel-k: language=yaml +# --------------------------------------------------------------------------- # 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. @@ -14,6 +15,7 @@ # 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. +# --------------------------------------------------------------------------- - from: uri: "direct:listPets" diff --git a/e2e/common/traits/openapi_test.go b/e2e/common/traits/openapi_test.go index ea3bd7d323..45ea2a75ee 100644 --- a/e2e/common/traits/openapi_test.go +++ b/e2e/common/traits/openapi_test.go @@ -24,7 +24,7 @@ package traits import ( "context" - "io/ioutil" + "os" "testing" . "github.com/onsi/gomega" @@ -39,6 +39,12 @@ import ( func TestOpenAPI(t *testing.T) { t.Parallel() + /* + kubectl create configmap my-openapi --from-file=./e2e/common/traits/files/openapi/petstore-api.yaml + + kamel run --dev --name=petstore --open-api configmap:my-openapi ./e2e/common/traits/files/openapi/petstore.yaml + */ + WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { operatorID := "camel-k-traits-openapi" g.Expect(CopyCamelCatalog(t, ctx, ns, operatorID)).To(Succeed()) @@ -47,7 +53,7 @@ func TestOpenAPI(t *testing.T) { g.Eventually(SelectedPlatformPhase(t, ctx, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady)) - openapiContent, err := ioutil.ReadFile("./files/openapi/petstore-api.yaml") + openapiContent, err := os.ReadFile("./files/openapi/petstore-api.yaml") require.NoError(t, err) var cmDataProps = make(map[string]string) cmDataProps["petstore-api.yaml"] = string(openapiContent) diff --git a/e2e/install/cli/files/timer-kamelet-usage.groovy b/e2e/install/cli/files/timer-kamelet-usage.groovy deleted file mode 100644 index 11ad5bb277..0000000000 --- a/e2e/install/cli/files/timer-kamelet-usage.groovy +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ - -from('kamelet:my-own-timer-source?message=Hello+world') - .to('log:info?showAll=false') diff --git a/e2e/install/cli/files/timer-kamelet-usage.yaml b/e2e/install/cli/files/timer-kamelet-usage.yaml new file mode 100644 index 0000000000..206ba027b0 --- /dev/null +++ b/e2e/install/cli/files/timer-kamelet-usage.yaml @@ -0,0 +1,21 @@ +# --------------------------------------------------------------------------- +# 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. +# --------------------------------------------------------------------------- + +- from: + uri: "kamelet:my-own-timer-source?message=Hello+world" + steps: + - to: "log:info?showAll=false" diff --git a/e2e/install/cli/global_kamelet_test.go b/e2e/install/cli/global_kamelet_test.go index 40a17645a8..cfaa62d1fb 100644 --- a/e2e/install/cli/global_kamelet_test.go +++ b/e2e/install/cli/global_kamelet_test.go @@ -45,7 +45,7 @@ func TestRunGlobalKamelet(t *testing.T) { g.Expect(KamelInstallWithID(t, ctx, operatorID, ns2, "--skip-operator-setup", "--olm=false")).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns2, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns2, "files/timer-kamelet-usage.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns2, "timer-kamelet-usage"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns2, "timer-kamelet-usage"), TestTimeoutShort).Should(ContainSubstring("Hello world")) g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns2).Execute()).To(Succeed()) @@ -60,7 +60,7 @@ func TestRunGlobalKamelet(t *testing.T) { WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns3 string) { g.Expect(KamelInstallWithID(t, ctx, operatorID, ns3, "--skip-operator-setup", "--olm=false")).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns3, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns3, "files/timer-kamelet-usage.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns3, "timer-kamelet-usage"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns3, "timer-kamelet-usage"), TestTimeoutShort).Should(ContainSubstring("Hello world")) g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns3).Execute()).To(Succeed())