[dovetail] Add TESTAREA to support run mandatory or optional test cases 47/59747/3
authorxudan <xudan16@huawei.com>
Thu, 12 Jul 2018 12:16:34 +0000 (08:16 -0400)
committerxudan <xudan16@huawei.com>
Mon, 16 Jul 2018 09:35:36 +0000 (05:35 -0400)
JIRA: DOVETAIL-694

Change-Id: I4d2f4342bb10b5199c0dd1ed6ee579df14cb1517
Signed-off-by: xudan <xudan16@huawei.com>
jjb/dovetail/dovetail-ci-jobs.yaml
jjb/dovetail/dovetail-run.sh

index a95617a..8d47616 100644 (file)
       - 'default'
       - 'proposed_tests'
 
+    testarea:
+      - 'mandatory'
+      - 'optional'
+
     jobs:
       - 'dovetail-{SUT}-{pod}-{testsuite}-{stream}'
+      - 'dovetail-{SUT}-{pod}-{testsuite}-{testarea}-{stream}'
 
 ################################
 # job templates
           name: TESTSUITE
           default: '{testsuite}'
           description: "dovetail testsuite to run"
+      - string:
+          name: TESTAREA
+          default: 'all'
+          description: "dovetail testarea to run"
+      - string:
+          name: DOVETAIL_REPO_DIR
+          default: "/home/opnfv/dovetail"
+          description: "Directory where the dovetail repository is cloned"
+      - string:
+          name: SUT_BRANCH
+          default: '{branch}'
+          description: "SUT branch"
+
+    scm:
+      - git-scm
+
+    builders:
+      - description-setter:
+          description: "POD: $NODE_NAME"
+      - 'dovetail-cleanup'
+      - 'dovetail-run'
+
+    publishers:
+      - archive:
+          artifacts: 'results/**/*'
+          allow-empty: true
+          fingerprint: true
+      - email-jenkins-admins-on-failure
+
+- job-template:
+    name: 'dovetail-{SUT}-{pod}-{testsuite}-{testarea}-{stream}'
+
+    disabled: false
+
+    concurrent: true
+
+    properties:
+      - logrotate-default
+      - throttle:
+          enabled: true
+          max-per-node: 1
+          option: 'project'
+
+    wrappers:
+      - build-name:
+          name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
+      - timeout:
+          timeout: 300
+          abort: true
+      - fix-workspace-permissions
+
+    triggers:
+      - '{auto-trigger-name}'
+
+    parameters:
+      - project-parameter:
+          project: '{project}'
+          branch: '{dovetail-branch}'
+      - '{SUT}-defaults'
+      - '{slave-label}-defaults'
+      - string:
+          name: DEPLOY_SCENARIO
+          default: 'os-nosdn-nofeature-ha'
+      - string:
+          name: DOCKER_TAG
+          default: '{docker-tag}'
+          description: 'Tag to pull dovetail docker image'
+      - string:
+          name: CI_DEBUG
+          default: 'true'
+          description: "Show debug output information"
+      - string:
+          name: TESTSUITE
+          default: '{testsuite}'
+          description: "dovetail testsuite to run"
+      - string:
+          name: TESTAREA
+          default: '{testarea}'
+          description: "dovetail testarea to run"
       - string:
           name: DOVETAIL_REPO_DIR
           default: "/home/opnfv/dovetail"
index 2a9c73c..b171703 100755 (executable)
@@ -345,7 +345,17 @@ else
     testsuite="--testsuite ${TESTSUITE}"
 fi
 
-run_cmd="dovetail run ${testsuite} -d"
+if [[ ${TESTAREA} == 'mandatory' ]]; then
+    testarea='--mandatory'
+elif [[ ${TESTAREA} == 'optional' ]]; then
+    testarea="--optional"
+elif [[ ${TESTAREA} == 'all' ]]; then
+    testarea=""
+else
+    testarea="--testarea ${TESTAREA}"
+fi
+
+run_cmd="dovetail run ${testsuite} ${testarea} -d"
 echo "Container exec command: ${run_cmd}"
 docker exec $container_id ${run_cmd}