This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit afe8cb783a2b09379c77b7bc84c271c60964f62c
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Tue May 18 15:07:21 2021 +0200

    feat(e2e): build-property integration test
---
 e2e/common/config/config_test.go                   | 20 +++++++++++++++
 .../config/files/build-property-route.groovy       | 29 ++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/e2e/common/config/config_test.go b/e2e/common/config/config_test.go
index 03a0add..ece48fa 100644
--- a/e2e/common/config/config_test.go
+++ b/e2e/common/config/config_test.go
@@ -119,5 +119,25 @@ func TestRunConfigExamples(t *testing.T) {
                        Expect(Kamel("delete", "--all", "-n", 
ns).Execute()).To(Succeed())
                })
 
+               // Build-Properties
+               t.Run("Build time property", func(t *testing.T) {
+                       Expect(Kamel("run", "-n", ns, 
"./files/build-property-route.groovy", "--build-property", 
"quarkus.application.name=my-super-application").Execute()).To(Succeed())
+                       Eventually(IntegrationPodPhase(ns, 
"build-property-route"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+                       Eventually(IntegrationCondition(ns, 
"build-property-route", camelv1.IntegrationConditionReady), 
TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+                       Eventually(IntegrationLogs(ns, "build-property-route"), 
TestTimeoutShort).Should(ContainSubstring("my-super-application"))
+                       // Don't delete - we need it for next test execution
+               })
+
+               // We need to check also that the property (which is available 
in the IntegrationKit) is correctly replaced and we don't reuse the same kit
+               t.Run("Build time property updated", func(t *testing.T) {
+                       Expect(Kamel("run", "-n", ns, 
"./files/build-property-route.groovy", "--name", "build-property-route-updated",
+                               "--build-property", 
"quarkus.application.name=my-super-application-updated").Execute()).To(Succeed())
+                       Eventually(IntegrationPodPhase(ns, 
"build-property-route-updated"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
+                       Eventually(IntegrationCondition(ns, 
"build-property-route-updated", camelv1.IntegrationConditionReady), 
TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+                       Eventually(IntegrationLogs(ns, 
"build-property-route-updated"), 
TestTimeoutShort).Should(ContainSubstring("my-super-application-updated"))
+                       // Verify the integration kits are different
+                       Expect(IntegrationKit(ns, 
"build-property-route")).ShouldNot(Equal(IntegrationKit(ns, 
"build-property-route-updated")))
+                       Expect(Kamel("delete", "--all", "-n", 
ns).Execute()).To(Succeed())
+               })
        })
 }
diff --git a/e2e/common/config/files/build-property-route.groovy 
b/e2e/common/config/files/build-property-route.groovy
new file mode 100644
index 0000000..c32e5e6
--- /dev/null
+++ b/e2e/common/config/files/build-property-route.groovy
@@ -0,0 +1,29 @@
+// camel-k: language=groovy
+/*
+ * 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.
+ */
+
+//
+// Provide a build time configuration property (the application name)
+//
+// To run this integrations use:
+//
+// kamel run --build-property=quarkus.application.name=my-super-application 
build-property-route.groovy --dev
+//
+
+from('timer:build-property')
+    .routeId('build-property')
+    .log('The application name: {{quarkus.application.name}}')

Reply via email to