Stop compressing files during intermediate steps part 1

Stop compressing files that would otherwise be handled uncompressed in
intermediate log handling. The reason for this is final log/artifact
upload should decide if a file need to be compressed or not as some file
hosting services (like swift) may not return the expected data if we get
this wrong.

This was noticed when we used swift to store intermediate tar.gz
tarballs before final upload to permanent storage. When retrieving the
tar.gz files from swift we got them back as uncompressed .tar files
(because swift was being helpful) and then later when we try to
uncompress these files we break.

Instead we'll let the upload to swift (or other storage) decide if files
should be compressed further than their existing state.

This is the first change in the stack that updates this behavior for
fetch-subunit-output.

Change-Id: I5727b270d6d34c256fe78a443baa1ad6c3474108
This commit is contained in:
Clark Boylan 2020-01-08 09:22:45 -08:00
parent 0e23325a12
commit bbca430417
2 changed files with 9 additions and 14 deletions

View File

@ -16,15 +16,10 @@
- testrepository.subunit
register: subunit_files
- name: Compress subunit files
archive:
path: "{{ item.path }}"
with_items: "{{ subunit_files.files }}"
- name: Collect test-results
synchronize:
dest: "{{ zuul.executor.log_root }}"
mode: pull
src: "{{ item.path }}.gz"
src: "{{ item.path }}"
verify_host: true
with_items: "{{ subunit_files.files }}"

View File

@ -45,14 +45,14 @@
- name: Check that the testrepository file has been pulled
delegate_to: localhost
file:
path: "{{ zuul.executor.log_root }}/testrepository.subunit.gz"
path: "{{ zuul.executor.log_root }}/testrepository.subunit"
state: file
register: local_subunit_file
- name: Check that HTML test result file has been pulled
delegate_to: localhost
file:
path: "{{ zuul.executor.log_root }}/testr_results.html.gz"
path: "{{ zuul.executor.log_root }}/testr_results.html"
state: file
register: local_html_test_results
@ -70,10 +70,10 @@
shell: |
GLOBAL_RESULT=1
zgrep -q -E 'subunit_tests.test_working.WorkingTest.test_success$' \
{{ zuul.executor.log_root }}/testr_results.html.gz
{{ zuul.executor.log_root }}/testr_results.html
T1=$?
zgrep -q -E 'subunit_tests.test_failing.FailingTest.test_failure.*_StringException:' \
{{ zuul.executor.log_root }}/testr_results.html.gz
{{ zuul.executor.log_root }}/testr_results.html
T2=$?
if [ ${T1} -eq 0 ] && [ ${T2} -ne 0 ]; then
GLOBAL_RESULT=0
@ -92,14 +92,14 @@
- name: Check that the testrepository file has been pulled
delegate_to: localhost
file:
path: "{{ zuul.executor.log_root }}/testrepository.subunit.gz"
path: "{{ zuul.executor.log_root }}/testrepository.subunit"
state: file
register: local_subunit_file
- name: Check that HTML test result file has been pulled
delegate_to: localhost
file:
path: "{{ zuul.executor.log_root }}/testr_results.html.gz"
path: "{{ zuul.executor.log_root }}/testr_results.html"
state: file
register: local_html_test_results
@ -116,10 +116,10 @@
shell: |
GLOBAL_RESULT=1
zgrep -q -E 'subunit_tests.test_working.WorkingTest.test_success$' \
{{ zuul.executor.log_root }}/testr_results.html.gz
{{ zuul.executor.log_root }}/testr_results.html
T1=$?
zgrep -q -E 'subunit_tests.test_failing.FailingTest.test_failure.*_StringException:' \
{{ zuul.executor.log_root }}/testr_results.html.gz
{{ zuul.executor.log_root }}/testr_results.html
T2=$?
if [ ${T1} -eq 0 ] && [ ${T2} -eq 0 ]; then
GLOBAL_RESULT=0