Merge "Validate zuul_stream func test output" into feature/zuulv3
diff --git a/playbooks/zuul-stream/fixtures/test-stream-failure.yaml b/playbooks/zuul-stream/fixtures/test-stream-failure.yaml
index 272431a..3e7b27a 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 29bbf47..6a31ff8 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 4f67673..7b5b84f 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