Skip to content

Commit

Permalink
[FIX] fix helm_template molecule test and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
WissemChb committed Oct 3, 2021
1 parent 3b32f64 commit dd67750
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions molecule/default/roles/helm/tasks/test_up_dep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
- test-chart
- dep-up

- name: Test Helm dependency update block exist in the helm_template module and dependency_update true
- name: Test Helm dependency update true
helm_template:
binary_path: "{{ helm_binary }}"
chart_ref: "/tmp/dep-up"
Expand All @@ -125,22 +125,6 @@
success_msg: "subchart exist in the charts directory"
fail_msg: "There is no Subchart pulled"

- name: Test Helm dependency update block not exist in the helm_template module and dependency_update true
helm_template:
binary_path: "{{ helm_binary }}"
chart_ref: "/tmp/test-chart"
chart_version: "{{ chart_source_version | default(omit) }}"
output_dir: "/tmp"
dependency_update: true
register: release
ignore_errors: true

- assert:
that:
- release.failed
- release.msg == "No subchart will be pulled for /tmp/test-chart. Please make sure to add dependencies block in Chart.yaml or requirements.yaml. For more information please visite https://helm.sh/docs/helm/helm_dependency/"
success_msg: "Failed when there is no dependencies block with dependency_update enabled"

- name: Test Helm subchart not pulled when dependency_update false for helm_template
helm_template:
binary_path: "{{ helm_binary }}"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_helm_template_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import unittest

from unittest.mock import MagicMock, patch, call
from unittest.mock import patch

from ansible.module_utils import basic
from ansible_collections.kubernetes.core.plugins.modules import helm_template
Expand Down

0 comments on commit dd67750

Please sign in to comment.