tests: miscellaneous improvements to container build tests
- add debug logging and recover the log files - discard database and settings file between container tests Change-Id: Ifd8a8d544c4c550873a9eb586de038710a60ba05
This commit is contained in:
parent
4fe18c6492
commit
a4f21d6e3f
@ -11,6 +11,7 @@
|
||||
command: |
|
||||
podman run --name api-server --detach --tty \
|
||||
--volume {{ ara_api_root_dir }}/server:/opt/ara:z -p 8000:8000 \
|
||||
-e ARA_LOG_LEVEL=DEBUG -e ARA_DEBUG=true \
|
||||
{{ item.name }}:{{ item.tag }}
|
||||
|
||||
- block:
|
||||
@ -67,15 +68,24 @@
|
||||
that:
|
||||
- _get_playbook.json["id"] == _post_playbook.json["id"]
|
||||
always:
|
||||
- name: Delete previous static build
|
||||
file:
|
||||
path: "{{ ara_api_root_dir }}/server/static"
|
||||
state: absent
|
||||
- name: Recover container logs
|
||||
shell: podman logs -nt api-server | tee -a {{ ara_api_root_dir }}/server/container-{{ item.tag }}.log
|
||||
changed_when: false
|
||||
|
||||
- name: Generate a static report
|
||||
command: podman exec -it api-server ara-manage generate /opt/ara/static
|
||||
command: podman exec -it api-server ara-manage generate /opt/ara/static-{{ item.tag }}
|
||||
ignore_errors: yes
|
||||
|
||||
# The container gets removed but the data persists in ~/.ara-tests/server
|
||||
- name: Stop the container and remove it
|
||||
command: podman rm -f api-server
|
||||
|
||||
# So they get re-generated by the container spinning up and at the same time
|
||||
# prevent sql migration issues because we're going back and forth between versions
|
||||
# when testing multiple containers back-to-back
|
||||
- name: Discard database and settings file
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- "{{ ara_api_root_dir }}/server/ansible.sqlite"
|
||||
- "{{ ara_api_root_dir }}/server/settings.yaml"
|
||||
|
Loading…
x
Reference in New Issue
Block a user