From 5167502048fbd32cbd0e32b390945346193be882 Mon Sep 17 00:00:00 2001 From: Julien Girardin Date: Mon, 11 Dec 2023 15:14:35 +0100 Subject: [PATCH] Fix dry-run of haproxy migration path --- tests/features/haproxy.feature | 2 ++ tests/helpers/ansible.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/features/haproxy.feature b/tests/features/haproxy.feature index f00e300..932eb33 100644 --- a/tests/features/haproxy.feature +++ b/tests/features/haproxy.feature @@ -35,6 +35,8 @@ Feature: Haproxy When With those group_vars on group all: apiserver_proxy_use_docker: false When I reset tasks counters + When I dry-run the playbooks 00_apiserver_proxy.yml + When I reset tasks counters When I run the playbooks 00_apiserver_proxy.yml 01_site.yml Then I should have a working cluster diff --git a/tests/helpers/ansible.py b/tests/helpers/ansible.py index 9f809ee..35e789f 100644 --- a/tests/helpers/ansible.py +++ b/tests/helpers/ansible.py @@ -1,5 +1,6 @@ import itertools import os +import re import ansible_runner @@ -56,5 +57,6 @@ def run_ansible_playbook( def assert_ansible_error(run): assert run.status == "successful" + assert len(re.findall(r"fatal: [.*]: FAILED! =>.*", run.stdout.read())) == 0 for host_failed, number_failed in run.stats.get("failures", {}).items(): assert number_failed == 0