You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/10/25 08:15:24 UTC

[camel-k] 05/07: chore(ci): split install-it workflow into two jobs: install, native

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

tsato pushed a commit to branch release-1.10.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit f81d5f25b1faf5c6577c628a57091fca2d05397b
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Thu Sep 1 16:35:59 2022 +0900

    chore(ci): split install-it workflow into two jobs: install, native
---
 .github/actions/e2e-install-native/action.yml      | 117 +++++++++++++++++++++
 .../exec-tests.sh                                  |  16 +--
 .github/actions/e2e-install/exec-tests.sh          |  14 +--
 .github/actions/e2e-knative/exec-tests.sh          |   3 +-
 .github/workflows/install.yml                      |  24 ++++-
 5 files changed, 150 insertions(+), 24 deletions(-)

diff --git a/.github/actions/e2e-install-native/action.yml b/.github/actions/e2e-install-native/action.yml
new file mode 100644
index 000000000..1061ff8e5
--- /dev/null
+++ b/.github/actions/e2e-install-native/action.yml
@@ -0,0 +1,117 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: e2e-install-native
+description: 'End-to-End tests for install use-cases (namespaced rather than global operator so no global operator install) with native builds'
+
+inputs:
+  cluster-config-data:
+    description: 'The configuration of the underlying cluster (if cluster-type is custom)'
+    required: false
+  cluster-kube-config-data:
+    description: 'Base16 encoded kube config - required for custom cluster type only'
+    required: false
+
+runs:
+  using: "composite"
+
+  steps:
+  - id: prepare-env
+    name: Prepare Test Environment
+    uses: ./.github/actions/kamel-prepare-env
+
+  - id: config-cluster
+    name: Configure Platform
+    uses: ./.github/actions/kamel-config-cluster
+    with:
+      cluster-type: ${{ env.TEST_CLUSTER }}
+      cluster-config-data: ${{ inputs.cluster-config-data }}
+      cluster-kube-config-data: ${{ inputs.cluster-kube-config-data }}
+
+  #
+  # Try and ensure the cluster is in a vanilla state before
+  # starting in on an installation
+  #
+  - id: pre-clean-cluster
+    name: Pre Clean Cluster
+    uses: ./.github/actions/kamel-cleanup
+    if: ${{ always() }}
+    with:
+      catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }}
+      catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }}
+      image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }}
+      global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }}
+
+  - id: build-kamel
+    name: Build Kamel
+    uses: ./.github/actions/kamel-build
+    with:
+      image-registry-push-host: ${{ steps.config-cluster.outputs.cluster-image-registry-push-host }}
+      image-registry-pull-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }}
+      image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }}
+      # Builds the bundle if an OLM is available - depends on cluster being tested
+      build-bundle: ${{ steps.config-cluster.outputs.cluster-has-olm }}
+      # Both can be empty and so catalog source will not be created
+      catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }}
+      catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }}
+
+  - id: install-kamel-cluster-setup
+    name: Install Kamel Cluster Setup
+    uses: ./.github/actions/kamel-install-cluster-setup
+    with:
+      kube-admin-user-ctx: ${{ steps.config-cluster.outputs.cluster-kube-admin-user-ctx }}
+
+  - id: preflight-test
+    name: Preflight Check Test
+    uses: ./.github/actions/kamel-preflight-test
+    with:
+      catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }}
+      catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }}
+      image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }}
+      image-registry-host: ${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }}
+      image-name: ${{ steps.build-kamel.outputs.build-binary-local-image-name }}
+      image-registry-insecure: ${{steps.config-cluster.outputs.cluster-image-registry-insecure }}
+      image-version: ${{ steps.build-kamel.outputs.build-binary-local-image-version }}
+
+  - id: report-problematic
+    name: List Tests Marked As Problematic
+    uses: ./.github/actions/kamel-report-problematic
+    with:
+      test-suite: namespace/install
+
+  - id: run-it
+    name: Run IT
+    shell: bash
+    run: |
+      ./.github/actions/e2e-install-native/exec-tests.sh \
+        -b "${{ steps.config-cluster.outputs.cluster-catalog-source-name }}" \
+        -c "${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }}" \
+        -i "${{ steps.config-cluster.outputs.cluster-image-namespace }}" \
+        -l "${{ steps.config-cluster.outputs.cluster-image-registry-pull-host }}" \
+        -n "${{ steps.build-kamel.outputs.build-binary-local-image-name }}" \
+        -s "${{steps.config-cluster.outputs.cluster-image-registry-insecure }}" \
+        -v "${{ steps.build-kamel.outputs.build-binary-local-image-version }}" \
+        -x "${{ env.CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE }}"
+
+  - name: Cleanup
+    uses: ./.github/actions/kamel-cleanup
+    if: ${{ always() }}
+    with:
+      catalog-source-name: ${{ steps.config-cluster.outputs.cluster-catalog-source-name }}
+      catalog-source-namespace: ${{ steps.config-cluster.outputs.cluster-catalog-source-namespace }}
+      image-namespace: ${{ steps.config-cluster.outputs.cluster-image-namespace }}
+      global-operator-namespace: ${{ steps.config-cluster.outputs.cluster-global-operator-namespace }}
diff --git a/.github/actions/e2e-install/exec-tests.sh b/.github/actions/e2e-install-native/exec-tests.sh
similarity index 89%
copy from .github/actions/e2e-install/exec-tests.sh
copy to .github/actions/e2e-install-native/exec-tests.sh
index 1b2a206ca..db67931c1 100755
--- a/.github/actions/e2e-install/exec-tests.sh
+++ b/.github/actions/e2e-install-native/exec-tests.sh
@@ -19,7 +19,7 @@
 
 ####
 #
-# Execute the install tests
+# Execute the install native tests
 #
 ####
 
@@ -101,7 +101,8 @@ if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then
   export KAMEL_INSTALL_OLM_CHANNEL="${NEW_XY_CHANNEL}"
 fi
 
-export KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
+KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
+export KAMEL_INSTALL_MAVEN_REPOSITORIES
 export KAMEL_INSTALL_REGISTRY=${REGISTRY_PULL_HOST}
 export KAMEL_INSTALL_REGISTRY_INSECURE=${REGISTRY_INSECURE}
 export KAMEL_INSTALL_OPERATOR_IMAGE=${CUSTOM_IMAGE}:${CUSTOM_VERSION}
@@ -115,12 +116,5 @@ export CAMEL_K_TEST_IMAGE_NAME=${CUSTOM_IMAGE}
 export CAMEL_K_TEST_IMAGE_VERSION=${CUSTOM_VERSION}
 export CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE=${SAVE_FAILED_TEST_NS}
 
-# Then run all integration tests rather than ending on first failure
-set -e
-exit_code=0
-DO_TEST_PREBUILD=false make test-install || exit_code=1
-DO_TEST_PREBUILD=false make test-quarkus-native || exit_code=1
-set +e
-
-echo "Tests completed with exit code: ${exit_code}"
-exit ${exit_code}
+# Then run integration tests
+DO_TEST_PREBUILD=false make test-quarkus-native
diff --git a/.github/actions/e2e-install/exec-tests.sh b/.github/actions/e2e-install/exec-tests.sh
index 1b2a206ca..3b780d7f3 100755
--- a/.github/actions/e2e-install/exec-tests.sh
+++ b/.github/actions/e2e-install/exec-tests.sh
@@ -101,7 +101,8 @@ if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then
   export KAMEL_INSTALL_OLM_CHANNEL="${NEW_XY_CHANNEL}"
 fi
 
-export KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
+KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
+export KAMEL_INSTALL_MAVEN_REPOSITORIES
 export KAMEL_INSTALL_REGISTRY=${REGISTRY_PULL_HOST}
 export KAMEL_INSTALL_REGISTRY_INSECURE=${REGISTRY_INSECURE}
 export KAMEL_INSTALL_OPERATOR_IMAGE=${CUSTOM_IMAGE}:${CUSTOM_VERSION}
@@ -115,12 +116,5 @@ export CAMEL_K_TEST_IMAGE_NAME=${CUSTOM_IMAGE}
 export CAMEL_K_TEST_IMAGE_VERSION=${CUSTOM_VERSION}
 export CAMEL_K_TEST_SAVE_FAILED_TEST_NAMESPACE=${SAVE_FAILED_TEST_NS}
 
-# Then run all integration tests rather than ending on first failure
-set -e
-exit_code=0
-DO_TEST_PREBUILD=false make test-install || exit_code=1
-DO_TEST_PREBUILD=false make test-quarkus-native || exit_code=1
-set +e
-
-echo "Tests completed with exit code: ${exit_code}"
-exit ${exit_code}
+# Then run integration tests
+DO_TEST_PREBUILD=false make test-install
diff --git a/.github/actions/e2e-knative/exec-tests.sh b/.github/actions/e2e-knative/exec-tests.sh
index 328571b3d..fd591cbb7 100755
--- a/.github/actions/e2e-knative/exec-tests.sh
+++ b/.github/actions/e2e-knative/exec-tests.sh
@@ -104,7 +104,8 @@ if [ -n "${BUILD_CATALOG_SOURCE_NAMESPACE}" ]; then
   export KAMEL_INSTALL_OLM_CHANNEL="${NEW_XY_CHANNEL}"
 fi
 
-export KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
+KAMEL_INSTALL_MAVEN_REPOSITORIES=$(make get-staging-repo)
+export KAMEL_INSTALL_MAVEN_REPOSITORIES
 export KAMEL_INSTALL_REGISTRY=${REGISTRY_PULL_HOST}
 export KAMEL_INSTALL_REGISTRY_INSECURE=${REGISTRY_INSECURE}
 export KAMEL_INSTALL_OPERATOR_IMAGE=${CUSTOM_IMAGE}:${CUSTOM_VERSION}
diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml
index 158b1444f..261316c37 100644
--- a/.github/workflows/install.yml
+++ b/.github/workflows/install.yml
@@ -68,9 +68,7 @@ concurrency:
 
 jobs:
   install-it:
-
     runs-on: ubuntu-20.04
-
     steps:
     - name: Checkout code
       uses: actions/checkout@v2
@@ -90,3 +88,25 @@ jobs:
       with:
         cluster-config-data: ${{ secrets.E2E_CLUSTER_CONFIG }}
         cluster-kube-config-data: ${{ secrets.E2E_KUBE_CONFIG }}
+
+  native-it:
+    runs-on: ubuntu-20.04
+    steps:
+    - name: Checkout code
+      uses: actions/checkout@v2
+      with:
+        persist-credentials: false
+        submodules: recursive
+    - name: Convert input parameters to env vars
+      shell: bash
+      run: |
+        ./.github/workflows/manual-exec-process-inputs.sh \
+          -i "${{ github.event.inputs.pre-built-kamel-image }}" \
+          -p "${{ github.event.inputs.skip-problematic }}" \
+          -t "${{ github.event.inputs.test-filters }}"
+
+    - name: Execute Tests
+      uses: ./.github/actions/e2e-install-native
+      with:
+        cluster-config-data: ${{ secrets.E2E_CLUSTER_CONFIG }}
+        cluster-kube-config-data: ${{ secrets.E2E_KUBE_CONFIG }}