Add support for ONAP testing in release jobs 51/7151/2
authoreprasad <prasad.mukhedkar@est.tech>
Thu, 21 Jan 2021 08:39:32 +0000 (08:39 +0000)
committereprasad <prasad.mukhedkar@est.tech>
Thu, 21 Jan 2021 12:17:43 +0000 (12:17 +0000)
This change request adds support for ONAP testing in release jobs.

 -  xTesting framework is used for executing tests 

 -  Healthcheck and Infra-healthcheck testsuites added

Signed-off-by: eprasad <prasad.mukhedkar@est.tech>
Change-Id: I04ba63addcf952f8ef9a57b329754e7e8a57bb5f
Signed-off-by: eprasad <prasad.mukhedkar@est.tech>
jjb/cloud-infra/engine-macros.yaml
jjb/cloud-infra/onap-jobs/onap-release-deploy-test.yaml
jjb/cloud-infra/scripts/xtesting-healthcheck.sh [new file with mode: 0755]
jjb/cloud-infra/scripts/xtesting-infra-healthcheck.sh [new file with mode: 0755]

index 4218645e9fa730fb72d1874f1c3087c1a5ba39bf..8a37b9424f26c5ea5ad16bcc068b213983585d41 100644 (file)
     builders:
       - shell:
           !include-raw: ./scripts/promote.sh
+
+- builder:
+    name: 'xtesting-infra-healthcheck-macro'
+    builders:
+      - shell:
+          !include-raw: ./scripts/xtesting-infra-healthcheck.sh
+
+- builder:
+    name: 'xtesting-healthcheck-macro'
+    builders:
+      - shell:
+          !include-raw: ./scripts/xtesting-healthcheck.sh
index f0f95d1a2e4428cdacc7b1798e43cc8dcb9ab1a8..ffc0d9e4cf93691da83858b22943f76648b6f2a6 100644 (file)
       - offline:
           disabled: false
           execution-mode: offline-deployment
-    # just deploy phase for now and ONAP testing isn't defined yet
+
     phase:
       - deploy
+      - test
 
 
     type:
@@ -67,6 +68,8 @@
       - 'onap-release-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
       - 'onap-release-{environment-type}-deploy-{distro}-{cloud}-{type}-{stream}'
       - 'onap-release-{environment-type}-deployk8s-{distro}-{cloud}-{type}-{stream}'
+      - 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
+      - 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
 
 - job-template:
     name: 'onap-release-{environment-type}-deploy-test-{distro}-{cloud}-{type}-{stream}'
           name: USE_PREBUILT_DEPLOYMENT_IMAGE
           default: 'true'
           description: 'Use prebuilt deployment image while running as part of CI/CD'
-      - string:
-          name: TEST_REPO_URL
-          default: 'https://gerrit.nordix.org/infra/test.git'
-          description: 'URL to clone the test repo from'
-      - string:
-          name: TEST_FW
-          default: 'functest'
-          description: 'Test framework to use'
-      - string:
-          name: TEST_SUITE
-          default: 'healthcheck'
-          description: 'Test suite to run'
-      - string:
-          name: YARDSTICK_DISPATCHER
-          default: 'file'
-          description: 'Dispatcher to use for Yardstick reporting'
       - string:
           name: DELETE_STACK
           default: 'false'
               node-parameters: true
               kill-phase-on: FAILURE
               abort-all-job: false
+      - multijob:
+          name: xTesting for infra-healthcheck and healthcheck
+          condition: ALWAYS
+          projects:
+            - name: 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
+              current-parameters: true
+              git-revision: true
+              node-parameters: true
+              kill-phase-on: FAILURE
+              abort-all-job: false
+            - name: 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
+              current-parameters: true
+              git-revision: true
+              node-parameters: true
+              kill-phase-on: FAILURE
+              abort-all-job: false
     publishers:
       - postbuildscript:
           builders:
       - 'wait-pkg-mgr-macro'
       - 'download-deploy-artifact-macro'
       - 'deploy-macro'
+
+- job-template:
+    name: 'onap-release-{environment-type}-xtesting-infra-healthcheck-{distro}-{cloud}-{type}-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    parameters:
+      - string:
+          name: EXECUTION_MODE
+          default: '{execution-mode}'
+          description: 'Execution mode'
+      - string:
+          name: TEST_REPO_URL
+          default: 'https://gerrit.nordix.org/infra/test.git'
+          description: 'URL to clone the test repo from'
+      - string:
+          name: TEST_FW
+          default: 'xtesting'
+          description: 'Test framework to use'
+      - string:
+          name: TEST_SUITE
+          default: 'infra-healthcheck'
+          description: 'Test suite to run'
+
+
+    properties:
+      - logrotate
+      - throttle:
+          max-per-node: 1
+          max-total: 3
+          option: project
+    wrappers:
+      - build-timeout:
+          timeout: 600
+      - mask-passwords
+      - fix-workspace-permissions
+
+    builders:
+      - 'xtesting-infra-healthcheck-macro'
+
+- job-template:
+    name: 'onap-release-{environment-type}-xtesting-healthcheck-{distro}-{cloud}-{type}-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    parameters:
+      - string:
+          name: EXECUTION_MODE
+          default: '{execution-mode}'
+          description: 'Execution mode'
+      - string:
+          name: TEST_REPO_URL
+          default: 'https://gerrit.nordix.org/infra/test.git'
+          description: 'URL to clone the test repo from'
+      - string:
+          name: TEST_FW
+          default: 'xtesting'
+          description: 'Test framework to use'
+      - string:
+          name: TEST_SUITE
+          default: 'healthcheck'
+          description: 'Test suite to run'
+
+    properties:
+      - logrotate
+      - throttle:
+          max-per-node: 1
+          max-total: 3
+          option: project
+    wrappers:
+      - build-timeout:
+          timeout: 600
+      - mask-passwords
+      - fix-workspace-permissions
+
+    builders:
+      - 'xtesting-healthcheck-macro'
diff --git a/jjb/cloud-infra/scripts/xtesting-healthcheck.sh b/jjb/cloud-infra/scripts/xtesting-healthcheck.sh
new file mode 100755 (executable)
index 0000000..a85c3a7
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2021 The Nordix Foundation. All rights reserved.
+# ================================================================================
+# Licensed 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+set -o errexit
+set -o pipefail
+
+echo "Info  : Cloning infra/test repository"
+cd $HOME && /bin/rm -rf $WORKSPACE
+git clone -q $TEST_REPO_URL $WORKSPACE
+
+# NOTE (eprasad): we need to override execution mode variable coming from change.properties file
+if [[ "$CI_LOOP" != "release" ]]; then
+  export EXECUTION_MODE=$(echo "$EXECUTION_MODE" | sed 's/deployment/test/g')
+else
+  export EXECUTION_MODE=online-test
+fi
+
+cd $WORKSPACE/test
+./test.sh -s "$STACK_TYPE" -b "$BRANCH" -c "$DEPLOY_SCENARIO" -f "$TEST_FW" -t "$TEST_SUITE" \
+    -o /tmp/openrc -i /tmp/inventory.ini -y -v
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/jjb/cloud-infra/scripts/xtesting-infra-healthcheck.sh b/jjb/cloud-infra/scripts/xtesting-infra-healthcheck.sh
new file mode 100755 (executable)
index 0000000..a85c3a7
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2021 The Nordix Foundation. All rights reserved.
+# ================================================================================
+# Licensed 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+set -o errexit
+set -o pipefail
+
+echo "Info  : Cloning infra/test repository"
+cd $HOME && /bin/rm -rf $WORKSPACE
+git clone -q $TEST_REPO_URL $WORKSPACE
+
+# NOTE (eprasad): we need to override execution mode variable coming from change.properties file
+if [[ "$CI_LOOP" != "release" ]]; then
+  export EXECUTION_MODE=$(echo "$EXECUTION_MODE" | sed 's/deployment/test/g')
+else
+  export EXECUTION_MODE=online-test
+fi
+
+cd $WORKSPACE/test
+./test.sh -s "$STACK_TYPE" -b "$BRANCH" -c "$DEPLOY_SCENARIO" -f "$TEST_FW" -t "$TEST_SUITE" \
+    -o /tmp/openrc -i /tmp/inventory.ini -y -v
+
+# vim: set ts=2 sw=2 expandtab: