dovetail tool: unittest added 35/23135/2
authorMatthewLi <matthew.lijun@huawei.com>
Fri, 14 Oct 2016 03:40:31 +0000 (23:40 -0400)
committerMatthewLi <matthew.lijun@huawei.com>
Fri, 14 Oct 2016 03:43:21 +0000 (23:43 -0400)
JIRA: DOVETAIL-14

this should be merged after https://gerrit.opnfv.org/gerrit/#/c/23135/

Change-Id: I9bb341c4c4de454ba9246c435e169d948205d2ba
Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
jjb/dovetail/dovetail-project-jobs.yml
jjb/dovetail/dovetail-run.sh

index bf05522..41fd8cd 100644 (file)
@@ -57,9 +57,7 @@
                   - branch-compare-type: 'ANT'
                     branch-pattern: '**/{branch}'
     builders:
-         - shell: |
-             echo "dovetail: verify job"
-         #unittest will be added future
+        - dovetail-unit-tests
 
 - job-template:
     name: 'dovetail-merge-{stream}'
                       branch-pattern: '**/{branch}'
 
     builders:
-         - shell: |
-             echo "dovetail: merge"
-         #unittest will be added future
+        - dovetail-unit-tests
+
+################################
+#builders for dovetail project
+###############################
+- builder:
+    name: dovetail-unit-tests
+    builders:
+        - shell: |
+            #!/bin/bash
+            set -o errexit
+            set -o pipefail
+
+            echo "Running unit tests..."
+            cd $WORKSPACE
+            virtualenv $WORKSPACE/dovetail_venv
+            source $WORKSPACE/dovetail_venv/bin/activate
+
+            #packages installation
+            easy_install -U setuptools
+            easy_install -U pip
+            pip install -r unittests/requirements.txt
+            pip install -e .
+
+            #unit tests
+            /bin/bash $WORKSPACE/unittests/unittest.sh
+
+            deactivate
index f7a9655..098b7db 100755 (executable)
@@ -48,7 +48,7 @@ docker pull opnfv/dovetail:$DOCKER_TAG >$redirect
 # Run docker
 echo "Dovetail: docker running..."
 sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/dovetail:${DOCKER_TAG} \
-"/home/opnfv/dovetail/scripts/run.py"
+"/home/opnfv/dovetail/dovetail/run.py"
 
 echo "Dovetail: store results..."
 sudo cp -r /home/opnfv/dovetail/results ./