summaryrefslogtreecommitdiff
path: root/playbooks
diff options
context:
space:
mode:
authorDavid Shrewsbury <shrewsbury.dave@gmail.com>2017-08-31 13:03:12 -0400
committerDavid Shrewsbury <shrewsbury.dave@gmail.com>2017-09-01 15:44:39 -0400
commit13d6e58a99d550cbd5f14e83ff7b47506da543eb (patch)
treefeb02069bffeeee7d8a06f14808d24c8842967be /playbooks
parent90dca7b5ca92198a0216f3c297c33ed539902fae (diff)
downloadzuul-13d6e58a99d550cbd5f14e83ff7b47506da543eb.tar.gz
Validate zuul_stream func test output
If we have to visually inspect the output of this test on every run, we will fail, because we will certainly not visually inspect the output of this test on every run. Let's at least try to automate some of the validation. Change-Id: Ib3b060c60d6037f664636b8854aa488573826a06
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/zuul-stream/fixtures/test-stream-failure.yaml6
-rw-r--r--playbooks/zuul-stream/fixtures/test-stream.yaml4
-rw-r--r--playbooks/zuul-stream/functional.yaml44
3 files changed, 49 insertions, 5 deletions
diff --git a/playbooks/zuul-stream/fixtures/test-stream-failure.yaml b/playbooks/zuul-stream/fixtures/test-stream-failure.yaml
index 272431a9e..3e7b27a7f 100644
--- a/playbooks/zuul-stream/fixtures/test-stream-failure.yaml
+++ b/playbooks/zuul-stream/fixtures/test-stream-failure.yaml
@@ -7,9 +7,9 @@
- name: Run a shell task with an ansible python exception
command: echo foo
args:
- chdir: /somewhere/that/does/not/exist
+ chdir: /failure-shelltask/somewhere/that/does/not/exist
- - always:
+ always:
- name: Loop with items on an ansible python exception
command: "echo {{ item }}"
@@ -18,4 +18,4 @@
- item2
- item3
args:
- chdir: /somewhere/that/does/not/exist
+ chdir: /failure-itemloop/somewhere/that/does/not/exist
diff --git a/playbooks/zuul-stream/fixtures/test-stream.yaml b/playbooks/zuul-stream/fixtures/test-stream.yaml
index 29bbf4759..6a31ff8d4 100644
--- a/playbooks/zuul-stream/fixtures/test-stream.yaml
+++ b/playbooks/zuul-stream/fixtures/test-stream.yaml
@@ -30,7 +30,7 @@
- name: Run a shell task with an ansible python exception
command: echo foo
args:
- chdir: /somewhere/that/does/not/exist
+ chdir: /shelltask/somewhere/that/does/not/exist
failed_when: false
- name: Loop with items on an ansible python exception
@@ -40,5 +40,5 @@
- item2
- item3
args:
- chdir: /somewhere/that/does/not/exist
+ chdir: /itemloop/somewhere/that/does/not/exist
failed_when: false
diff --git a/playbooks/zuul-stream/functional.yaml b/playbooks/zuul-stream/functional.yaml
index 4f676730d..7b5b84f9e 100644
--- a/playbooks/zuul-stream/functional.yaml
+++ b/playbooks/zuul-stream/functional.yaml
@@ -15,6 +15,50 @@
ZUUL_JOB_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
ARA_LOG_CONFIG: "{{ ansible_user_dir}}/logging.json"
+ - name: Validate output - setupvar
+ shell: |
+ egrep "^.*\| node1 \|\s+\"setupvar\": {" job-output.txt
+ egrep "^.*\| node2 \|\s+\"setupvar\": {" job-output.txt
+
+ - name: Validate output - shell task
+ shell: |
+ egrep "^.*\| node1 \| link/loopback" job-output.txt
+ egrep "^.*\| node2 \| link/loopback" job-output.txt
+
+ - name: Validate output - loop with items
+ shell: |
+ egrep "^.+\| node1 \| ok: Item: item1" job-output.txt
+ egrep "^.+\| node1 \| ok: Item: item2" job-output.txt
+ egrep "^.+\| node1 \| ok: Item: item3" job-output.txt
+ egrep "^.+\| node2 \| ok: Item: item1" job-output.txt
+ egrep "^.+\| node2 \| ok: Item: item2" job-output.txt
+ egrep "^.+\| node2 \| ok: Item: item3" job-output.txt
+
+ - name: Validate output - loop with complex items
+ shell: |
+ egrep "^.+\| node1 \| ok: Item: Runtime" job-output.txt
+ egrep "^.+\| node2 \| ok: Item: Runtime" job-output.txt
+
+ - name: Validate output - shell task with exception
+ shell: |
+ egrep "^.+\| node1 \| OSError.+\/shelltask\/" job-output.txt
+ egrep "^.+\| node2 \| OSError.+\/shelltask\/" job-output.txt
+
+ - name: Validate output - item loop with exception
+ shell: |
+ egrep "^.+\| node1 \| OSError.+\/itemloop\/" job-output.txt
+ egrep "^.+\| node2 \| OSError.+\/itemloop\/" job-output.txt
+
+ - name: Validate output - failure shell task with exception
+ shell: |
+ egrep "^.+\| node1 \| OSError.+\/failure-shelltask\/" job-output.txt
+ egrep "^.+\| node2 \| OSError.+\/failure-shelltask\/" job-output.txt
+
+ - name: Validate output - failure item loop with exception
+ shell: |
+ egrep "^.+\| node1 \| OSError.+\/failure-itemloop\/" job-output.txt
+ egrep "^.+\| node2 \| OSError.+\/failure-itemloop\/" job-output.txt
+
- name: Generate ARA html
command: ara generate html ara-output