shipyard/src/bin/shipyard_airflow/tests
Andrey Volkov 4164518502 Ensure pod logs are fetched in case of exception in any operator
This patch tries to cover some edge cases could happen during Shipyard
Airflow operator execution. All operators at the moment make
interactions with other services i.e. k8s pods. In a case of exceptions
during execution of the operator, logs will be fetched from the
appropriate pod and if the operator has "fetch_failure_details" method
(see DrydockBaseOperator) it will be called as well.

What exception could happen during an operator execution?
Besides explicitly defined in code like
DrydockClientUseFailureException, other exception e.g. KeyError or
similar may be raised. It's not clear who is a culprit in that client
side (Shipyard) or server side (Drydock, Armada, Deckhand,
Promenade). So this patch applies defensive mode and gets logs from
pods and gets additional details for any exceptional situations.

For doing that do_execute method is wrapped with try..except
in UcpBaseOperator.execute. While fetching logs from a pod
and fetching failure details it makes appropriate logging by itself
and finally reraises the original exception.

Change-Id: If1501e9a24b05edb6eb32c7b1b2d27f24f3ee063
2018-09-19 09:17:13 -07:00
..
unit Ensure pod logs are fetched in case of exception in any operator 2018-09-19 09:17:13 -07:00
__init__.py Refactor shipyard to UCP target layout 2018-04-24 16:47:13 -05:00