prepare: ../default/prepare.yml
converge: ../default/converge.yml
cleanup: ../default/cleanup.yml
-scenario:
- test_sequence:
- - lint
- - cleanup
- - destroy
- - dependency
- - syntax
- - create
- - prepare
- - converge
- - verify
- - cleanup
- - destroy
verifier:
name: testinfra
- onap
app_helm_chart_name: "{{ app_name }}"
helm_version: v3
-scenario:
- test_sequence:
- - lint
- - cleanup
- - destroy
- - dependency
- - syntax
- - create
- - prepare
- - converge
- # - idempotence
- # --> Action: 'idempotence'
- # ERROR: Idempotence test failed because of the following tasks:
- # * [instance] => application : Get helm dir
- # * [instance] => application : Helm init and upgrade
- # * [instance] => application : Helm Serve
- # * [instance] => application : Helm Add Repo
- # * [instance] => application : Helm Install application moleculetestapp
- - side_effect
- - verify
- - cleanup
- - destroy
verifier:
name: testinfra
deploy moleculetestapp local/moleculetestapp --namespace \
moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
+--timeout 1800s
+env
+repo list
+repo add local http://127.0.0.1:8879
+deploy moleculetestapp local/moleculetestapp --namespace \
+moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
+overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
--timeout 1800s"""
expected_plugin_path = '/root/.local/share/helm/plugins/deploy/' +\
'deploy.sh'
prepare: ../default/prepare.yml
converge: ../default/converge.yml
cleanup: ../default/cleanup.yml
-scenario:
- test_sequence:
- - lint
- - cleanup
- - destroy
- - dependency
- - syntax
- - create
- - prepare
- - converge
- # - idempotence
- # --> Action: 'idempotence'
- # ERROR: Idempotence test failed because of the following tasks:
- # * [instance] => application : Get helm dir
- # * [instance] => application : Helm init and upgrade
- # * [instance] => application : Helm Serve
- # * [instance] => application : Helm Add Repo
- # * [instance] => application : Helm Install application moleculetestapp
- - side_effect
- - verify
- - cleanup
- - destroy
verifier:
name: testinfra
directory: ../default/tests/
- name: Get helm environment information
command: "{{ helm_bin_dir }}/helm env"
register: helm_env
+ changed_when: false
- name: Set helm data dir
set_fact:
helm_data_dir:
--namespace {{ app_kubernetes_namespace }}
{{ helm_override_files | map('regex_replace', '^', '-f ') | join(' ') }}
{{ helm_extra_install_options | map(attribute='opt') | join(' ') }}
- changed_when: true # when executed its a changed type of action
+ changed_when: false # for idempotency
register: helm_install
failed_when: "'FAILED' in (helm_install.stdout | upper()) or helm_install.rc != 0"
- name: Helm Add Repo
command: "{{ helm_bin_dir }}/helm repo add {{ helm_repository_name | mandatory }} {{ helm_repository_url | mandatory }}"
when: "'local' not in helm_repo_list.stdout"
- changed_when: true # when executed its a changed type of action
+ changed_when: false # for idempotency
- name: Check for deploy plugin presence
stat:
warn: false
tags:
- skip_ansible_lint # Prevent '[303] tar used in place of unarchive module'
- changed_when: false # for idempotency
delegate_to: localhost
- name: Create helm charts dir on infra
file:
unarchive:
src: "{{ app_helm_charts_install_directory }}.tgz"
dest: "{{ app_helm_charts_infra_directory }}"
+ tags: molecule-idempotence-notest
- include_tasks: install-helm-plugins.yml