| |
@@ -52,29 +52,7 @@
|
| |
|
| |
- block:
|
| |
- name: Run beakerlib tests
|
| |
- shell: |
|
| |
- export OUTPUTFILE=/dev/stdout TEST={{ item }}
|
| |
- export PATH="$PATH:{{ tenv_workdir }}"
|
| |
- logfile={{ remote_artifacts }}/$(echo {{ item }} | sed -e 's/\//-/g').log
|
| |
- exec 2>>$logfile 1>>$logfile
|
| |
- cd {{ tenv_workdir }}
|
| |
- if [ -f {{ item }} ]; then
|
| |
- cd $(dirname {{ item }})
|
| |
- /bin/sh -e ./$(basename {{ item }})
|
| |
- elif [ -d {{ item }} ]; then
|
| |
- cd {{ item }}
|
| |
- # get-test-deps - is part of beakerlib-libraries
|
| |
- get-test-deps -i .
|
| |
- if [ -f Makefile ] && command -p -v make >/dev/null 2>&1; then
|
| |
- make run
|
| |
- elif [ -f runtest.sh ]; then
|
| |
- /bin/sh -e ./runtest.sh
|
| |
- else
|
| |
- echo "FAIL don't know how to run test {{ item }}"
|
| |
- fi
|
| |
- else
|
| |
- echo "FAIL test {{ item }} does not appear to be a file or directory"
|
| |
- fi
|
| |
+ script: ../files/beakerlib-test.sh {{ tenv_workdir }} {{ remote_artifacts }} {{ item }}
|
| |
with_items:
|
| |
- "{{ tests }}"
|
| |
- "{{ filter_tests }}"
|
| |
@@ -83,23 +61,7 @@
|
| |
|
| |
always:
|
| |
- name: Make the master tests summary log artifact
|
| |
- shell: |
|
| |
- log_file_name=$(echo {{ item }} | sed -e 's/\//-/g').log
|
| |
- logfile={{ remote_artifacts }}/${log_file_name}
|
| |
- status="FAIL"
|
| |
- if grep -q '\[ *FAIL *\]' "$logfile"; then
|
| |
- status="FAIL"
|
| |
- elif grep -q '\[ *PASS *\]' "$logfile"; then
|
| |
- status="PASS"
|
| |
- elif grep -q FAIL "$logfile"; then
|
| |
- status="FAIL"
|
| |
- elif grep -q PASS "$logfile"; then
|
| |
- status="PASS"
|
| |
- else
|
| |
- status="FAIL"
|
| |
- fi
|
| |
- echo "${status} {{ item }}" >> {{ remote_artifacts }}/test.log
|
| |
- mv ${logfile} {{ remote_artifacts }}/${status}_${log_file_name}
|
| |
+ script: ../files/log-summary-artifact.sh {{ remote_artifacts }} {{ item }}
|
| |
with_items:
|
| |
- "{{ tests }}"
|
| |
- "{{ filter_tests }}"
|
| |
Is there a way to drop relative path? Does Ansible support it?