diff --git a/docs/modules/ROOT/pages/contributing/e2e.adoc b/docs/modules/ROOT/pages/contributing/e2e.adoc index 91b81d6bd2..68a0bc281c 100644 --- a/docs/modules/ROOT/pages/contributing/e2e.adoc +++ b/docs/modules/ROOT/pages/contributing/e2e.adoc @@ -24,7 +24,9 @@ The test script will install the operators needed in a random namespace, execute [[testing-e2e-structure]] == End-To-End tests structure -We have several kind of end-to-end tests. Most of them will only require the installation of Camel K operator, but, others need some particular configuration. This is the reason why they may not work out of the box on your cluster. The main goal of the test is to run in a CI environment, so, all requirements are scripted accordingly. If you want to run a test in your cluster, make sure to provide the configuration as expected by the test suite. +We have several groups of end-to-end tests. Most of them will only require the installation of Camel K operator, but, others need some particular configuration. This is the reason why they may not work out of the box on your cluster. The main goal of the test is to run in a CI environment, so, all requirements are scripted accordingly. If you want to run a test in your cluster, make sure to provide the configuration as expected by the test suite. + +There may be a `files/setup.sh` script in some groups (e.g. knative) that can help to get the required configuration in place. This is the list of the groups we are using (please, notice that they can slightly change in the future): diff --git a/e2e/common/languages/files/yaml-polyglot.yaml b/e2e/common/languages/files/yaml-polyglot.yaml index 6ba0332293..c835c43c22 100644 --- a/e2e/common/languages/files/yaml-polyglot.yaml +++ b/e2e/common/languages/files/yaml-polyglot.yaml @@ -1,3 +1,5 @@ +# camel-k: language=yaml + # --------------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/e2e/common/languages/files/yaml.yaml b/e2e/common/languages/files/yaml.yaml index 8877c8557d..767bbe44fe 100644 --- a/e2e/common/languages/files/yaml.yaml +++ b/e2e/common/languages/files/yaml.yaml @@ -1,3 +1,5 @@ +# camel-k: language=yaml + # --------------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/e2e/knative/files/flow.yaml b/e2e/knative/files/flow.yaml index 0742e95223..85c1ab5d97 100644 --- a/e2e/knative/files/flow.yaml +++ b/e2e/knative/files/flow.yaml @@ -1,3 +1,4 @@ +# camel-k: language=yaml # --------------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -20,4 +21,4 @@ steps: - setBody: constant: "Hello Camel K from yaml" - - to: "log:info" \ No newline at end of file + - to: "log:info" diff --git a/e2e/knative/files/http_out.groovy b/e2e/knative/files/http_out.groovy deleted file mode 100644 index 40f75a639e..0000000000 --- a/e2e/knative/files/http_out.groovy +++ /dev/null @@ -1,18 +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("rest:get:hello/") - .transform().simple("Hello"); \ No newline at end of file diff --git a/e2e/knative/files/http_out.yaml b/e2e/knative/files/http_out.yaml new file mode 100644 index 0000000000..59a6a99f61 --- /dev/null +++ b/e2e/knative/files/http_out.yaml @@ -0,0 +1,24 @@ +# 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. +# 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: "rest:get:hello/" + steps: + - setBody: + constant: "Hello" + - to: "log:info" diff --git a/e2e/knative/files/knative1.groovy b/e2e/knative/files/knative1.groovy deleted file mode 100644 index a089525648..0000000000 --- a/e2e/knative/files/knative1.groovy +++ /dev/null @@ -1,27 +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('timer:tick') - .setBody().constant("") - .choice() - .when().simple('${random(0, 2)} == 0') - .to('knative:endpoint/knative2') - .log('Received from 2: ${body}') - .otherwise() - .to('knative:endpoint/knative3') - .log('Received from 3: ${body}') - .end() diff --git a/e2e/knative/files/knative1.yaml b/e2e/knative/files/knative1.yaml new file mode 100644 index 0000000000..7ee49eef9e --- /dev/null +++ b/e2e/knative/files/knative1.yaml @@ -0,0 +1,37 @@ +# 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. +# 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: "timer:tick" + steps: + - setBody: + constant: "" + - choice: + when: + - simple: "${random(0, 2)} == 0" + steps: + - to: + uri: "knative:endpoint/knative2" + - log: "Received from 2: ${body}" + otherwise: + steps: + - to: + uri: "knative:endpoint/knative3" + - log: "Received from 3: ${body}" + + diff --git a/e2e/knative/files/knative2.groovy b/e2e/knative/files/knative2.groovy deleted file mode 100644 index cb1c6fbda9..0000000000 --- a/e2e/knative/files/knative2.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('knative:endpoint/knative2') - .setBody().constant("Hello from knative2") diff --git a/e2e/knative/files/knative2.yaml b/e2e/knative/files/knative2.yaml new file mode 100644 index 0000000000..a6a0b03adf --- /dev/null +++ b/e2e/knative/files/knative2.yaml @@ -0,0 +1,23 @@ +# 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. +# 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: "knative:endpoint/knative2" + steps: + - setBody: + constant: "Hello from knative2" diff --git a/e2e/knative/files/knative3.groovy b/e2e/knative/files/knative3.groovy deleted file mode 100644 index 56032983e7..0000000000 --- a/e2e/knative/files/knative3.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('knative:endpoint/knative3') - .setBody().constant("Hello from knative3") diff --git a/e2e/knative/files/knative3.yaml b/e2e/knative/files/knative3.yaml new file mode 100644 index 0000000000..c80b7c47c6 --- /dev/null +++ b/e2e/knative/files/knative3.yaml @@ -0,0 +1,23 @@ +# 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. +# 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: "knative:endpoint/knative3" + steps: + - setBody: + constant: "Hello from knative3" diff --git a/e2e/knative/files/knative_broker_receiver.groovy b/e2e/knative/files/knative_broker_receiver.groovy deleted file mode 100644 index f88c5325cd..0000000000 --- a/e2e/knative/files/knative_broker_receiver.groovy +++ /dev/null @@ -1,22 +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('knative:event/hello.1?name=sample-broker') - .log('Received 1: ${body}') - -from('knative:event/hello.2?name=sample-broker') - .log('Received 2: ${body}') diff --git a/e2e/knative/files/knative_broker_sender.groovy b/e2e/knative/files/knative_broker_sender.groovy deleted file mode 100644 index 04345d8aae..0000000000 --- a/e2e/knative/files/knative_broker_sender.groovy +++ /dev/null @@ -1,24 +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('timer:tick') - .setBody().constant("Hello 1 from sample-broker") - .to('knative:event/hello.1?name=sample-broker') - -from('timer:tick') - .setBody().constant("Hello 2 from sample-broker") - .to('knative:event/hello.2?name=sample-broker') diff --git a/e2e/knative/files/knativech1.groovy b/e2e/knative/files/knativech1.groovy deleted file mode 100644 index 1a32a64889..0000000000 --- a/e2e/knative/files/knativech1.groovy +++ /dev/null @@ -1,20 +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('timer:tick') - .setBody().constant("Hello from knativech1") - .to('knative:channel/messages') diff --git a/e2e/knative/files/knativech1.yaml b/e2e/knative/files/knativech1.yaml new file mode 100644 index 0000000000..3c63e8240b --- /dev/null +++ b/e2e/knative/files/knativech1.yaml @@ -0,0 +1,24 @@ +# 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. +# 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: "timer:tick" + steps: + - setBody: + constant: "Hello from knativech1" + - to: "knative:channel/messages" diff --git a/e2e/knative/files/knativech2.groovy b/e2e/knative/files/knativech2.groovy deleted file mode 100644 index 65eeb2eb9b..0000000000 --- a/e2e/knative/files/knativech2.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('knative:channel/messages') - .log('Received: ${body}') diff --git a/e2e/knative/files/knativech2.yaml b/e2e/knative/files/knativech2.yaml new file mode 100644 index 0000000000..ca9aa38bda --- /dev/null +++ b/e2e/knative/files/knativech2.yaml @@ -0,0 +1,22 @@ +# 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. +# 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: "knative:channel/messages" + steps: + - log: "Received: ${body}" diff --git a/e2e/knative/files/knativeevt1.groovy b/e2e/knative/files/knativeevt1.groovy deleted file mode 100644 index afd2d4b076..0000000000 --- a/e2e/knative/files/knativeevt1.groovy +++ /dev/null @@ -1,24 +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('timer:tick') - .setBody().constant("Hello 1") - .to('knative:event/hello.1') - -from('timer:tick') - .setBody().constant("Hello 2") - .to('knative:event/hello.2') diff --git a/e2e/knative/files/knativeevt1.yaml b/e2e/knative/files/knativeevt1.yaml new file mode 100644 index 0000000000..395e0956de --- /dev/null +++ b/e2e/knative/files/knativeevt1.yaml @@ -0,0 +1,31 @@ +# 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. +# 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: "timer:tick" + steps: + - setBody: + constant: "Hello 1" + - to: "knative:event/hello.1" + +- from: + uri: "timer:tick" + steps: + - setBody: + constant: "Hello 2" + - to: "knative:event/hello.2" diff --git a/e2e/knative/files/knativeevt2.groovy b/e2e/knative/files/knativeevt2.groovy deleted file mode 100644 index 7047751a4c..0000000000 --- a/e2e/knative/files/knativeevt2.groovy +++ /dev/null @@ -1,22 +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('knative:event/hello.1') - .log('Received 1: ${body}') - -from('knative:event/hello.2') - .log('Received 2: ${body}') diff --git a/e2e/knative/files/knativeevt2.yaml b/e2e/knative/files/knativeevt2.yaml new file mode 100644 index 0000000000..8e91bb0070 --- /dev/null +++ b/e2e/knative/files/knativeevt2.yaml @@ -0,0 +1,27 @@ +# 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. +# 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: "knative:event/hello.1" + steps: + - log: "Received 1: ${body}" + +- from: + uri: "knative:event/hello.2" + steps: + - log: "Received 2: ${body}" diff --git a/e2e/knative/files/knativegetpost1.groovy b/e2e/knative/files/knativegetpost1.groovy deleted file mode 100644 index 37c09e3962..0000000000 --- a/e2e/knative/files/knativegetpost1.groovy +++ /dev/null @@ -1,21 +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('timer:tick') - .setBody().constant("") - .setHeader("CamelHttpMethod").constant("GET") - .to('knative:channel/messages') diff --git a/e2e/knative/files/knativegetpost1.yaml b/e2e/knative/files/knativegetpost1.yaml new file mode 100644 index 0000000000..da0c2dc188 --- /dev/null +++ b/e2e/knative/files/knativegetpost1.yaml @@ -0,0 +1,27 @@ +# 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. +# 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: "timer:tick" + steps: + - setBody: + constant: "" + - setHeader: + name: "CamelHttpMethod" + constant: "GET" + - to: "knative:channel/messages" diff --git a/e2e/knative/files/knativegetpost2.groovy b/e2e/knative/files/knativegetpost2.groovy deleted file mode 100644 index d21e2e94e0..0000000000 --- a/e2e/knative/files/knativegetpost2.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('knative:channel/messages') - .log('Received "${body}"') diff --git a/e2e/knative/files/knativegetpost2.yaml b/e2e/knative/files/knativegetpost2.yaml new file mode 100644 index 0000000000..2faf7ecd35 --- /dev/null +++ b/e2e/knative/files/knativegetpost2.yaml @@ -0,0 +1,22 @@ +# 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. +# 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: "knative:channel/messages" + steps: + - log: "Received: [${body}]" diff --git a/e2e/knative/files/knativemultihop1.groovy b/e2e/knative/files/knativemultihop1.groovy deleted file mode 100644 index 64103d7fc2..0000000000 --- a/e2e/knative/files/knativemultihop1.groovy +++ /dev/null @@ -1,24 +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('timer:tick') - .setBody().constant("message") - .to('knative:channel/messages') - -from('timer:tick') - .setBody().constant("word") - .to('knative:channel/words') diff --git a/e2e/knative/files/knativemultihop1.yaml b/e2e/knative/files/knativemultihop1.yaml new file mode 100644 index 0000000000..78206859cc --- /dev/null +++ b/e2e/knative/files/knativemultihop1.yaml @@ -0,0 +1,31 @@ +# 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. +# 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: "timer:tick" + steps: + - setBody: + constant: "message" + - to: "knative:channel/messages" + +- from: + uri: "timer:tick" + steps: + - setBody: + constant: "word" + - to: "knative:channel/words" diff --git a/e2e/knative/files/knativemultihop2.groovy b/e2e/knative/files/knativemultihop2.groovy deleted file mode 100644 index a5f48a0723..0000000000 --- a/e2e/knative/files/knativemultihop2.groovy +++ /dev/null @@ -1,21 +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('knative:channel/messages') - .transform().simple('transformed ${body}') - .log('Forwarding: ${body}') - .to('knative:channel/words') diff --git a/e2e/knative/files/knativemultihop2.yaml b/e2e/knative/files/knativemultihop2.yaml new file mode 100644 index 0000000000..c7723dc81e --- /dev/null +++ b/e2e/knative/files/knativemultihop2.yaml @@ -0,0 +1,25 @@ +# 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. +# 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: "knative:channel/messages" + steps: + - setBody: + simple: "transformed ${body}" + - log: "Forwarding: ${body}" + - to: "knative:channel/words" diff --git a/e2e/knative/files/knativemultihop3.groovy b/e2e/knative/files/knativemultihop3.groovy deleted file mode 100644 index 5567c45510..0000000000 --- a/e2e/knative/files/knativemultihop3.groovy +++ /dev/null @@ -1,24 +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('knative:channel/messages') - .log('From messages: ${body}') - .to('log:messages?showHeaders=true') - -from('knative:channel/words') - .log('From words: ${body}') - .to('log:words?showHeaders=true') diff --git a/e2e/knative/files/knativemultihop3.yaml b/e2e/knative/files/knativemultihop3.yaml new file mode 100644 index 0000000000..1e169880b0 --- /dev/null +++ b/e2e/knative/files/knativemultihop3.yaml @@ -0,0 +1,29 @@ +# 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. +# 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: "knative:channel/messages" + steps: + - log: "From messages: ${body}" + - to: "log:messages?showHeaders=true" + +- from: + uri: "knative:channel/words" + steps: + - log: "From words: ${body}" + - to: "log:words?showHeaders=true" diff --git a/e2e/knative/files/petstore.groovy b/e2e/knative/files/petstore.groovy deleted file mode 100644 index d382b217c6..0000000000 --- a/e2e/knative/files/petstore.groovy +++ /dev/null @@ -1,29 +0,0 @@ -// 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. - */ - -// -// kamel run --dev --name petstore --open-api examples/petstore-api.yaml examples/petstore.groovy -// - -from('direct:listPets') - .log('listPets') -from('direct:createPets') - .log('createPets') -from('direct:showPetById') - .log('showPetById') - diff --git a/e2e/knative/files/petstore.yaml b/e2e/knative/files/petstore.yaml new file mode 100644 index 0000000000..72087814fe --- /dev/null +++ b/e2e/knative/files/petstore.yaml @@ -0,0 +1,39 @@ +# 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. +# 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: "direct:listPets" + steps: + - setBody: + simple: "listPets" + - to: "log:info" + +- from: + uri: "direct:createPets" + steps: + - setBody: + simple: "createPets" + - to: "log:info" + +- from: + uri: "direct:showPetById" + steps: + - setBody: + simple: "showPetById" + - to: "log:info" diff --git a/e2e/knative/files/podtest-knative1.groovy b/e2e/knative/files/podtest-knative1.groovy deleted file mode 100644 index 8e7bd75e07..0000000000 --- a/e2e/knative/files/podtest-knative1.groovy +++ /dev/null @@ -1,21 +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('timer:tick') - .setBody().constant("") -.to('knative:endpoint/podtest-knative2') -.log('Received: ${body}') diff --git a/e2e/knative/files/podtest-knative1.yaml b/e2e/knative/files/podtest-knative1.yaml new file mode 100644 index 0000000000..348cf24fe3 --- /dev/null +++ b/e2e/knative/files/podtest-knative1.yaml @@ -0,0 +1,25 @@ +# 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. +# 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: "timer:tick" + steps: + - setBody: + constant: "" + - to: "knative:endpoint/podtest-knative2" + - log: "Received: ${body}" diff --git a/e2e/knative/files/podtest-knative2.groovy b/e2e/knative/files/podtest-knative2.groovy deleted file mode 100644 index 62a8411dc6..0000000000 --- a/e2e/knative/files/podtest-knative2.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('knative:endpoint/podtest-knative2') - .setBody().constant("{{TEST_ENV_VARIABLE}}") diff --git a/e2e/knative/files/podtest-knative2.yaml b/e2e/knative/files/podtest-knative2.yaml new file mode 100644 index 0000000000..7950f03614 --- /dev/null +++ b/e2e/knative/files/podtest-knative2.yaml @@ -0,0 +1,23 @@ +# 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. +# 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: "knative:endpoint/podtest-knative2" + steps: + - setBody: + constant: "{{TEST_ENV_VARIABLE}}" diff --git a/e2e/knative/files/test-kamelet-display.groovy b/e2e/knative/files/test-kamelet-display.groovy deleted file mode 100644 index fcde17d22c..0000000000 --- a/e2e/knative/files/test-kamelet-display.groovy +++ /dev/null @@ -1,20 +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('knative:channel/test-kamelet-messages') - .convertBodyTo(String.class) - .to('log:info?showAll=false') diff --git a/e2e/knative/files/test-kamelet-display.yaml b/e2e/knative/files/test-kamelet-display.yaml new file mode 100644 index 0000000000..9dc85e2c4e --- /dev/null +++ b/e2e/knative/files/test-kamelet-display.yaml @@ -0,0 +1,22 @@ +# 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. +# 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: "knative:channel/test-kamelet-messages" + steps: + - to: "log:info?showAll=false" diff --git a/e2e/knative/files/yaml.yaml b/e2e/knative/files/yaml.yaml index 8877c8557d..e69c8db7a8 100644 --- a/e2e/knative/files/yaml.yaml +++ b/e2e/knative/files/yaml.yaml @@ -1,3 +1,4 @@ +# camel-k: language=yaml # --------------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/e2e/knative/kamelet_test.go b/e2e/knative/kamelet_test.go index 1ae16ffe22..080401d746 100644 --- a/e2e/knative/kamelet_test.go +++ b/e2e/knative/kamelet_test.go @@ -48,7 +48,7 @@ func TestKameletChange(t *testing.T) { g.Expect(CreateTimerKamelet(t, ctx, operatorID, ns, timerSource)()).To(Succeed()) g.Expect(CreateKnativeChannel(t, ctx, ns, knChannel)()).To(Succeed()) // Consumer route that will read from the Knative channel - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/test-kamelet-display.groovy", "-w").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/test-kamelet-display.yaml", "-w").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "test-kamelet-display")).Should(Equal(corev1.PodRunning)) // Create the Pipe diff --git a/e2e/knative/knative_test.go b/e2e/knative/knative_pipes_test.go similarity index 91% rename from e2e/knative/knative_test.go rename to e2e/knative/knative_pipes_test.go index bd7ef3b800..eb5a63fd29 100644 --- a/e2e/knative/knative_test.go +++ b/e2e/knative/knative_pipes_test.go @@ -25,18 +25,16 @@ package knative import ( "context" "fmt" - "testing" - "time" - . "github.com/onsi/gomega" - v1 "k8s.io/api/core/v1" + "testing" + "time" . "github.com/apache/camel-k/v2/e2e/support" camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" ) -func TestKnative(t *testing.T) { +func TestKnativePipes(t *testing.T) { WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { knChannelMessages := "messages" knChannelWords := "words" @@ -44,13 +42,13 @@ func TestKnative(t *testing.T) { g.Expect(CreateKnativeChannel(t, ctx, ns, knChannelWords)()).To(Succeed()) t.Run("Service combo", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative2.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative2.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "knative2", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue)) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative3.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative3.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative3"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "knative3", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue)) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative1.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "knative1", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue)) // Correct logs @@ -64,8 +62,8 @@ func TestKnative(t *testing.T) { }) t.Run("Channel combo v1beta1", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativech2.groovy").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativech1.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativech2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativech1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativech2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativech1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns, "knativech2"), TestTimeoutMedium).Should(ContainSubstring("Received: Hello from knativech1")) @@ -73,18 +71,18 @@ func TestKnative(t *testing.T) { }) t.Run("Channel combo get to post", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativegetpost2.groovy").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativegetpost1.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativegetpost2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativegetpost1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativegetpost2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativegetpost1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) - g.Eventually(IntegrationLogs(t, ctx, ns, "knativegetpost2"), TestTimeoutMedium).Should(ContainSubstring(`Received ""`)) + g.Eventually(IntegrationLogs(t, ctx, ns, "knativegetpost2"), TestTimeoutMedium).Should(ContainSubstring("Received: []")) g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) t.Run("Multi channel chain", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop3.groovy").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop2.groovy").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop1.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop3.yaml").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativemultihop3"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativemultihop2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativemultihop1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) @@ -110,7 +108,7 @@ func TestKnative(t *testing.T) { }) t.Run("Knative-service disabled", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/http_out.groovy", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/http_out.yaml", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "http-out"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(Service(t, ctx, ns, "http-out"), TestTimeoutShort).ShouldNot(BeNil()) g.Consistently(KnativeService(t, ctx, ns, "http-out"), TestTimeoutShort).Should(BeNil()) @@ -118,14 +116,14 @@ func TestKnative(t *testing.T) { }) t.Run("Knative-service priority", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/http_out.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/http_out.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "http-out"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(KnativeService(t, ctx, ns, "http-out"), TestTimeoutShort).ShouldNot(BeNil()) g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) t.Run("Knative-service annotation", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative2.groovy", "-t", "knative-service.annotations.'haproxy.router.openshift.io/balance'=roundrobin").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative2.yaml", "-t", "knative-service.annotations.'haproxy.router.openshift.io/balance'=roundrobin").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(KnativeService(t, ctx, ns, "knative2"), TestTimeoutShort).ShouldNot(BeNil()) ks := KnativeService(t, ctx, ns, "knative2")() @@ -143,8 +141,8 @@ func TestRunBroker(t *testing.T) { g.Eventually(SelectedPlatformPhase(t, ctx, ns, operatorID), TestTimeoutMedium).Should(Equal(camelv1.IntegrationPlatformPhaseReady)) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativeevt1.groovy").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativeevt2.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativeevt1.yaml").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativeevt2.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativeevt1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativeevt2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns, "knativeevt2"), TestTimeoutMedium).Should(ContainSubstring("Received 1: Hello 1")) diff --git a/e2e/knative/openapi_test.go b/e2e/knative/openapi_test.go index ea726b75e7..0677c5e539 100644 --- a/e2e/knative/openapi_test.go +++ b/e2e/knative/openapi_test.go @@ -45,7 +45,7 @@ func TestOpenAPIService(t *testing.T) { cmDataProps["petstore-api.yaml"] = string(openapiContent) CreatePlainTextConfigmap(t, ctx, ns, "my-openapi-knative", cmDataProps) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name", "petstore", "--open-api", "configmap:my-openapi-knative", "files/petstore.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name", "petstore", "--open-api", "configmap:my-openapi-knative", "files/petstore.yaml").Execute()).To(Succeed()) g.Eventually(KnativeService(t, ctx, ns, "petstore"), TestTimeoutLong). Should(Not(BeNil())) diff --git a/e2e/knative/pod_test.go b/e2e/knative/pod_test.go index 21d52dfb44..7ebdaa04a3 100644 --- a/e2e/knative/pod_test.go +++ b/e2e/knative/pod_test.go @@ -36,10 +36,10 @@ import ( func TestPodTraitWithKnative(t *testing.T) { WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/podtest-knative2.groovy", "--pod-template", "files/template-knative.yaml").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/podtest-knative2.yaml", "--pod-template", "files/template-knative.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "podtest-knative2"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "podtest-knative2", v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue)) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/podtest-knative1.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/podtest-knative1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "podtest-knative1"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "podtest-knative1", v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "podtest-knative1"), TestTimeoutShort).Should(ContainSubstring("hello from the template"))