Add jobs to verify changes sent to infra/test repo 26/726/6
authorFatih Degirmenci <fdegir@gmail.com>
Sun, 24 Mar 2019 17:25:37 +0000 (18:25 +0100)
committerFatih Degirmenci <fdegir@gmail.com>
Sun, 24 Mar 2019 18:01:08 +0000 (19:01 +0100)
This change adds jobs to verify changes sent to infra/test repo in
order to ensure changes do not break things as infra/test repo will
be used for gating, post-merge and periodic jobs and have blocking
effect.

The job is expected to run on a slave with an existing deployment.
See the comments in cloud-infra-verify-test.yaml for details.

Change-Id: Ibe6271bbfd71c0a0d599964189f64619b582da45

jjb/cloud-infra/cloud-infra-test.sh
jjb/cloud-infra/cloud-infra-verify-test.yaml [new file with mode: 0644]

index d12c943bd769ada519a5531841325009fae5fa43..952a7fd15571d827136c45de825b08dff3af973e 100644 (file)
@@ -26,14 +26,10 @@ set -o pipefail
 # executed when the job that uses this script gets triggered due to Gerrit change.
 #
 # Logic in this script should be kept at minimum and the changes should be pushed into
-# the cloud infra engine and/or test repo.
+# the cloud infra test test.sh script.
 
-# The verify job will verify changes coming to other repositories as well such as
-# infra/swconfig so it needs to be handled here in order to ensure $WORKSPACE contains
-# the actual engine repo clone. This will be added later on.
-
-# we currently only do Hello World here and this will be adapted to do test instead
+# execute cloud engine test.sh script
 cd $WORKSPACE
-echo "Hello World!"
+./test/test.sh
 
 # vim: set ts=2 sw=2 expandtab:
diff --git a/jjb/cloud-infra/cloud-infra-verify-test.yaml b/jjb/cloud-infra/cloud-infra-verify-test.yaml
new file mode 100644 (file)
index 0000000..4c7e16a
--- /dev/null
@@ -0,0 +1,140 @@
+---
+#
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 Nordix Foundation.
+# ================================================================================
+# 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=========================================================
+
+#--------------------------------------------------------------------------------------
+# The jobs declared in this JJB configuration file are used for verifying patches
+# that are sent to the repositories below
+#   - cloud-infra/test
+#
+# These jobs verify changes that
+#   - implement new features or fix bugs to the playbooks and roles used for utilizing
+#     open source test frameworks such as opnfv/functest, and opnfv/yardstick
+#   - bump versions of the open source test frameworks
+#
+# These jobs are set to run on slaves with label vpod-test-ubuntu1604.
+# The slaves have
+#   - Ubuntu1604 as the base distro
+#   - nested virtualization
+#   - internet access
+#   - passwordless sudo
+#   - 16 CPUs/32GB RAM/200 GB Disk
+#   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
+#     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
+#
+# The slaves should have a promoted version of a cloud infra scenario deployed on them.
+# Currently k8-calico-nofeature scenario is deployed on the slaves.
+#--------------------------------------------------------------------------------------
+
+- project:
+    name: 'cloud-infra-verify-test'
+
+    project: 'infra/test'
+
+    stream:
+      - 'master':
+          branch: '{stream}'
+          disabled: 'false'
+
+    os:
+      - ubuntu1804:
+          disabled: 'false'
+          distribution: 'ubuntu18'
+      - centos7:
+          disabled: 'true'
+          distribution: 'centos7'
+
+    type:
+      - virtual
+
+    jobs:
+      - 'cloud-infra-verify-test-{os}-{type}-{stream}'
+
+- job-template:
+    name: 'cloud-infra-verify-test-{os}-{type}-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    concurrent: true
+
+    parameters:
+      - project-parameters:
+          project: '{project}'
+          branch: '{branch}'
+      - nordix-gerrit-parameters
+      - label:
+          name: SLAVE_LABEL
+          default: 'vpod-test-{os}'
+          description: 'Slave label to schedule this job on. These slaves have cloud infra installed on them.'
+      - string:
+          name: DISTRIBUTION
+          default: '{distribution}'
+          description: 'Distribution to use for configuring target nodes (networking etc.)'
+      - string:
+          name: TESTFW_NAME
+          default: 'opnfv/functest'
+          description: 'Test framework to use'
+      - string:
+          name: SUITE_NAME
+          default: 'healthcheck'
+          description: 'Test suite to use'
+
+    properties:
+      - logrotate
+      - build-blocker:
+          use-build-blocker: true
+          blocking-jobs:
+            - 'cloud-infra-verify-test-{os}-.*'
+          block-level: 'NODE'
+      - throttle:
+          max-per-node: 1
+          max-total: 3
+          option: project
+
+    wrappers:
+      - build-timeout:
+          timeout: 120
+      - fix-workspace-permissions
+
+    scm:
+      - git-scm-gerrit:
+          ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
+          branch: '{branch}'
+          refspec: $GERRIT_REFSPEC
+
+    triggers:
+      - nordix-gerrit-trigger-patchset-created:
+          project: 'infra\/test'
+          branch: '{branch}'
+          files: '**'
+
+    builders:
+      - 'cloud-infra-verify-testfw-macro'
+
+# -------------------------------
+# builder macros
+# -------------------------------
+
+- builder:
+    name: 'cloud-infra-verify-testfw-macro'
+    builders:
+      - shell:
+          !include-raw: ./cloud-infra-test.sh
+
+# vim: set ts=2 sw=2 expandtab: