]> git.immae.eu Git - github/fretlink/ansible-clever.git/blob - tests/test-scalability.yml
Bump clever waiting time to 1 hour
[github/fretlink/ansible-clever.git] / tests / test-scalability.yml
1 ---
2 - name: Configure scalability (fixed instances and ranged flavors)
3 hosts: localhost
4 remote_user: root
5 roles:
6 - role: clever
7 vars:
8 clever_token: 123abc
9 clever_secret: cba321
10 clever_app: app_00000000-0000-0000-0000-000000000000
11 clever_scaling:
12 instances: { fixed: 1 }
13 flavors: { min: "nano", max: "XS" }
14
15 - name: Configure scalability (no instances and ranged flavors)
16 hosts: localhost
17 remote_user: root
18 pre_tasks:
19 - file:
20 state: absent
21 path: ../clever-commands
22 roles:
23 - role: clever
24 vars:
25 clever_token: 123abc
26 clever_secret: cba321
27 clever_app: app_00000000-0000-0000-0000-000000000000
28 clever_scaling:
29 flavors: { min: "nano", max: "XS" }
30 post_tasks:
31 - name: Check stubbed commands
32 shell: "{{ item.cmd }}"
33 ignore_errors: true
34 vars:
35 display: "{{ item.display }}"
36 with_list:
37 - cmd: "grep deploy ../clever-commands"
38 display: "Expected 'clever deploy' command to be called"
39 - cmd: "grep scale ../clever-commands"
40 display: "Expected 'clever scale' command to be called"
41 - cmd: "! grep restart ../clever-commands"
42 display: "Expected 'clever restart' command to NOT be called"
43 register: tests_results
44 - name: show results
45 debug:
46 msg:
47 - "failed_results: {{ failed_results }}"
48 - "success_results: {{ success_results }}"
49 failed_when: tests_results is failed
50 vars:
51 failed_results: "{{ tests_results.results | selectattr('failed') | map(attribute='item.display') | list }}"
52 success_results: "{{ tests_results.results | rejectattr('failed') | map(attribute='item.display') | list }}"
53
54 - name: Configure scalability (incomplete flavors)
55 hosts: localhost
56 remote_user: root
57 roles:
58 - role: clever
59 vars:
60 clever_token: 123abc
61 clever_secret: cba321
62 clever_app: app_00000000-0000-0000-0000-000000000000
63 clever_scaling:
64 flavors: { min: "nano" }