mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
collect unit test results for shippable
Signed-off-by: Jake McDermott <jmcdermott@ansible.com>
This commit is contained in:
32
tools/docker-compose/unit-tests/collect_shippable_results.py
Normal file
32
tools/docker-compose/unit-tests/collect_shippable_results.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
import errno
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
def copy_if_exists(src, dst):
|
||||
if os.path.isfile(src):
|
||||
shutil.copy2(src, dst)
|
||||
|
||||
|
||||
def ensure_directory_exists(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exc:
|
||||
if exc.errno == errno.EEXIST and os.path.isdir(path):
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
def run():
|
||||
collection_path = 'shippable/testresults'
|
||||
|
||||
ensure_directory_exists(collection_path)
|
||||
|
||||
copy_if_exists('/awx_devel/awx/ui/test/spec/reports/results.spec.xml', collection_path)
|
||||
copy_if_exists('/awx_devel/awx/ui/test/unit/reports/results.unit.xml', collection_path)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
Reference in New Issue
Block a user