-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add molecule test for upload_helm_chart 'copy' method
This patch also extends the molecule test to cover the case where a new version of a chart is uploaded which should result in a file being removed from the destination.
- Loading branch information
Jonathan Rosser
committed
Dec 6, 2023
1 parent
b8b9b56
commit 80b8623
Showing
10 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ | |
become: true | ||
roles: | ||
- role: test-role | ||
vars: | ||
test_relative_path : "chart-v1/" |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
dependencies: | ||
- role: vexxhost.kubernetes.upload_helm_chart | ||
vars: | ||
upload_helm_chart_src: "./files/chart/" | ||
upload_helm_chart_dest: /usr/local/src/chart-1 | ||
# with rsync | ||
upload_helm_chart_src: "{{ test_relative_path }}" | ||
upload_helm_chart_dest: /usr/local/src/chart-one | ||
- role: vexxhost.kubernetes.upload_helm_chart | ||
vars: | ||
upload_helm_chart_src: "../../charts/foo/" | ||
upload_helm_chart_dest: /usr/local/src/chart-2 | ||
# with multi_copy | ||
upload_helm_chart_src: "{{ test_relative_path }}" | ||
upload_helm_chart_dest: /usr/local/src/chart-two | ||
upload_helm_chart_method: copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2023 VEXXHOST, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
- name: Side effect | ||
hosts: all | ||
become: true | ||
roles: | ||
- role: test-role | ||
vars: | ||
test_relative_path: "chart-v2/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
- name: Verify | ||
hosts: all | ||
become: true | ||
tasks: | ||
- name: Stat file 1 | ||
ansible.builtin.stat: | ||
path: /usr/local/src/chart-one/.gitkeep | ||
register: stat_1 | ||
|
||
- name: Stat file 2 | ||
ansible.builtin.stat: | ||
path: /usr/local/src/chart-two/.gitkeep | ||
register: stat_2 | ||
|
||
- name: Stat removed file 1 | ||
ansible.builtin.stat: | ||
path: /usr/local/src/chart-one/file | ||
register: stat_r1 | ||
|
||
- name: Stat removed file 2 | ||
ansible.builtin.stat: | ||
path: /usr/local/src/chart-two/file | ||
register: stat_r2 | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- stat_1.stat.exists | ||
- stat_2.stat.exists | ||
- not stat_r1.stat.exists | ||
- not stat_r2.stat.exists |