aboutsummaryrefslogblamecommitdiffhomepage
path: root/tests/test-scalability.yml
blob: 258beaf5dcabb69bd5fef50d8b8ac62734a91055 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                  



                                







                                                            

                                  
                             







                                                                  
                                                  










                                                                                                                    











                                                            
---
- name: Configure scalability (fixed instances and ranged flavors)
  hosts: localhost
  remote_user: root
  roles:
    - role: clever
      vars:
        clever_token: 123abc
        clever_secret: cba321
        clever_app: app_00000000-0000-0000-0000-000000000000
        clever_scaling:
          instances: { fixed: 1 }
          flavors: { min: "nano", max: "XS" }

- name: Configure scalability (no instances and ranged flavors)
  hosts: localhost
  remote_user: root
  pre_tasks:
    - file:
        state: absent
        path: ../clever-commands
  roles:
    - role: clever
      vars:
        clever_token: 123abc
        clever_secret: cba321
        clever_app: app_00000000-0000-0000-0000-000000000000
        clever_scaling:
          flavors: { min: "nano", max: "XS" }
  post_tasks:
    - name: Check stubbed commands
      shell: "{{ item.cmd }}"
      ignore_errors: true
      vars:
        display: "{{ item.display }}"
      with_list:
        - cmd: "grep deploy ../clever-commands"
          display: "Expected 'clever deploy' command to be called"
        - cmd: "grep scale ../clever-commands"
          display: "Expected 'clever scale' command to be called"
        - cmd: "! grep restart ../clever-commands"
          display: "Expected 'clever restart' command to NOT be called"
      register: tests_results
    - name: show results
      debug:
        msg:
          - "failed_results: {{ failed_results }}"
          - "success_results: {{ success_results }}"
      failed_when: tests_results is failed
      vars:
        failed_results: "{{ tests_results.results | selectattr('failed') | map(attribute='item.display') | list }}"
        success_results: "{{ tests_results.results | rejectattr('failed') | map(attribute='item.display') | list }}"

- name: Configure scalability (incomplete flavors)
  hosts: localhost
  remote_user: root
  roles:
    - role: clever
      vars:
        clever_token: 123abc
        clever_secret: cba321
        clever_app: app_00000000-0000-0000-0000-000000000000
        clever_scaling:
          flavors: { min: "nano" }