From 4ffea44f02c333c84baef2215ea1dd811433d65e Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdh8d@virginia.edu>
Date: Thu, 8 Nov 2018 10:11:20 -0800
Subject: [PATCH] changed to support better testing across multi-os

---
 .gitlab-ci.yml                     | 34 ++++--------------------------
 cicd_testing/basic-pgms-rida-p1.sh |  8 +++++++
 cicd_testing/basic-pgms-rida.sh    |  8 +++++++
 cicd_testing/do-build.sh           | 20 ++++++++++++++++++
 cicd_testing/xform-ls.sh           | 11 ++++++++++
 5 files changed, 51 insertions(+), 30 deletions(-)
 create mode 100755 cicd_testing/basic-pgms-rida-p1.sh
 create mode 100755 cicd_testing/basic-pgms-rida.sh
 create mode 100755 cicd_testing/do-build.sh
 create mode 100755 cicd_testing/xform-ls.sh

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8ef015c26..50e0924d5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,34 +9,14 @@ do-build:
   tags:
     - ubuntu18
   script:
-    - "# update submodules" 
-    - "git submodule sync --recursive"
-    - "git submodule update --recursive --init"
-    - "# gather info for debugging later, probably not necessary "
-    - "pwd"
-    - "hostname"
-    - "whoami"
-    - "env|grep CICD"
-    - ""
-    - "time rsync -a --exclude='.git'  $CICD_TO_TEST_DIR/ /tmp/peasoup_test"
-    - "cd /tmp/peasoup_test"
-    - "source set_env_vars"
-    - "sudo ./get-peasoup-packages.sh all"
-    - "./build-all.sh --debug"
-    - "./postgres_setup.sh"
+    - ./cicd_testing/do-build.sh 
 
 xform-ls:
   stage: test
   tags:
     - ubuntu18
   script:
-    - "cd /tmp/peasoup_test"
-    - "source set_env_vars"
-    - "cd /tmp"
-    - "rm -rf xxx ped_ls; $PSZ /bin/ls ./xxx -c rida=on -s meds_static=off --tempdir ped_ls || true"
-    - "if [[ ! -x ./xxx ]]; then cat ped_ls/logs/*; fi"
-    - "rm -rf ped_ls"
-    - "./xxx"
+    - ./cicd_testing/xform-ls.sh
 
 
 basic-pgms-rida:
@@ -44,18 +24,12 @@ basic-pgms-rida:
   tags:
     - ubuntu18
   script:
-    - "cd /tmp/peasoup_test"
-    - "source set_env_vars"
-    - "cd $CICD_TO_TEST_DIR/peasoup_examples/tests"
-    - "cd $PEASOUP_HOME/tests; make clean; ./test_cmds.sh rida"
+    - ./cicd_testing/basic-pgms-rida.sh
 
 basic-pgms-rida-p1:
   stage: test
   tags:
     - ubuntu18
   script:
-    - "cd /tmp/peasoup_test"
-    - "source set_env_vars"
-    - "cd $CICD_TO_TEST_DIR/peasoup_examples/tests"
-    - "cd $PEASOUP_HOME/tests; make clean; ./test_cmds.sh rida_p1"
+    - ./cicd_testing/basic-pgms-rida-p1.sh
 
diff --git a/cicd_testing/basic-pgms-rida-p1.sh b/cicd_testing/basic-pgms-rida-p1.sh
new file mode 100755
index 000000000..ef1876d6b
--- /dev/null
+++ b/cicd_testing/basic-pgms-rida-p1.sh
@@ -0,0 +1,8 @@
+#/bin/bash 
+set -e
+
+cd /tmp/peasoup_test
+source set_env_vars
+cd $CICD_TO_TEST_DIR/peasoup_examples/tests
+cd $PEASOUP_HOME/tests; make clean; ./test_cmds.sh rida_p1
+
diff --git a/cicd_testing/basic-pgms-rida.sh b/cicd_testing/basic-pgms-rida.sh
new file mode 100755
index 000000000..f5b7eb3c4
--- /dev/null
+++ b/cicd_testing/basic-pgms-rida.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -e
+
+cd /tmp/peasoup_test
+source set_env_vars
+cd $CICD_TO_TEST_DIR/peasoup_examples/tests
+cd $PEASOUP_HOME/tests; make clean; ./test_cmds.sh rida
+
diff --git a/cicd_testing/do-build.sh b/cicd_testing/do-build.sh
new file mode 100755
index 000000000..2b8dd3c55
--- /dev/null
+++ b/cicd_testing/do-build.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+
+
+update submodules
+git submodule sync --recursive
+git submodule update --recursive --init
+gather info for debugging later, probably not necessary 
+pwd
+hostname
+whoami
+env|grep CICD
+
+time rsync -a --exclude='.git'  $CICD_TO_TEST_DIR/ /tmp/peasoup_test
+cd /tmp/peasoup_test
+source set_env_vars
+sudo ./get-peasoup-packages.sh all
+build-all.sh --debug
+postgres_setup.sh
+
diff --git a/cicd_testing/xform-ls.sh b/cicd_testing/xform-ls.sh
new file mode 100755
index 000000000..f1d0821a0
--- /dev/null
+++ b/cicd_testing/xform-ls.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+set -e
+
+cd /tmp/peasoup_test
+source set_env_vars
+cd /tmp
+rm -rf xxx ped_ls; $PSZ /bin/ls ./xxx -c rida=on -s meds_static=off --tempdir ped_ls || true
+if [[ ! -x ./xxx ]]; then cat ped_ls/logs/*; fi
+rm -rf ped_ls
+xxx
+
-- 
GitLab