Skip to content

Commit

Permalink
(#5489) Use yaml in e2e install
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiesler committed May 21, 2024
1 parent 2d2052a commit 2a76301
Show file tree
Hide file tree
Showing 20 changed files with 65 additions and 25 deletions.
4 changes: 2 additions & 2 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
4 changes: 4 additions & 0 deletions e2e/builder/files/example.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/build-property-file-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/build-property-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/config-configmap-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/config-secret-key-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/config-secret-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/property-file-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/property-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/property-secret-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/resource-configmap-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/config/files/resource-secret-route.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e/common/traits/files/openapi/petstore.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down
10 changes: 8 additions & 2 deletions e2e/common/traits/openapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package traits

import (
"context"
"io/ioutil"
"os"
"testing"

. "github.com/onsi/gomega"
Expand All @@ -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())
Expand All @@ -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)
Expand Down
19 changes: 0 additions & 19 deletions e2e/install/cli/files/timer-kamelet-usage.groovy

This file was deleted.

21 changes: 21 additions & 0 deletions e2e/install/cli/files/timer-kamelet-usage.yaml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions e2e/install/cli/global_kamelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand Down

0 comments on commit 2a76301

Please sign in to comment.