Fix/improve tests (#1052) (#1053)

* Improve unit test condition.

* Improve/fix tests.

(cherry picked from commit fdb97428a3)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot]
2025-03-08 10:17:50 +01:00
committed by GitHub
parent 9979b1e683
commit 8fb1a7e4ff
27 changed files with 130 additions and 115 deletions
@@ -30,9 +30,9 @@
assert:
that:
- 'output is changed'
- 'output.actions[0] | regex_search("New Swarm cluster created: ")'
- 'output.swarm_facts.JoinTokens.Manager'
- 'output.swarm_facts.JoinTokens.Worker'
- '(output.actions[0] | regex_search("New Swarm cluster created: ")) is truthy'
- 'output.swarm_facts.JoinTokens.Manager is truthy'
- 'output.swarm_facts.JoinTokens.Worker is truthy'
- name: Try to get docker_node_info when docker is running in swarm mode and as manager
docker_node_info:
@@ -113,7 +113,7 @@
that:
- 'set_as_worker_1 is changed'
- 'set_as_worker_2 is failed'
- 'set_as_worker_2.msg | regex_search("attempting to demote the last manager of the swarm")'
- '(set_as_worker_2.msg | regex_search("attempting to demote the last manager of the swarm")) is truthy'
####################################################################
## Set node as pasued ##############################################