Skip to content

Commit

Permalink
symlink runme.sh to be across all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
shellymiron authored and machacekondra committed Jun 25, 2024
1 parent 6fb8759 commit 77657c0
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 100 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ install-python-packages:
install-ansible-collections:
ansible-galaxy collection install --upgrade -r tests/integration/requirements.yml

# this playbook aims to create a symlink for the runme.sh script
# for each integration target so that ansible-test will recognize it for the target
# and the script will run the test
.PHONY: prepare_symlinks
prepare_symlinks:
ansible-playbook tools/prepare_symlinks.yml

# workaround pyvmomy issue till latest version
# is available to use in requirements.txt
.PHONY: install-pyvmomy-latest
install-pyvmomy-latest:
pip3 install pyVmomi --force

.PHONY: integration
integration: install-python-packages install-ansible-collections
integration: install-python-packages install-ansible-collections prepare_symlinks
ansible-test integration --no-temp-workdir

.PHONY: eco-vcenter-ci
eco-vcenter-ci: install-python-packages install-ansible-collections install-pyvmomy-latest
eco-vcenter-ci: install-python-packages install-ansible-collections prepare_symlinks install-pyvmomy-latest
@for dir in $(shell ansible-test integration --list-target --no-temp-workdir | grep 'vmware_ops_'); do \
ansible-test integration --no-temp-workdir $$dir; \
done
Expand Down
4 changes: 4 additions & 0 deletions changelogs/fragments/63__make_runme_symlink.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
minor_changes:
- general change to the testing structure which duplicate runme.sh for each target
instead of recreating it manaully
File renamed without changes.

This file was deleted.

14 changes: 0 additions & 14 deletions tests/integration/targets/vmware_ops_content_library_test/runme.sh

This file was deleted.

14 changes: 0 additions & 14 deletions tests/integration/targets/vmware_ops_deploy_ovf_test/runme.sh

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions tests/integration/targets/vmware_ops_info_test/runme.sh

This file was deleted.

14 changes: 0 additions & 14 deletions tests/integration/targets/vmware_ops_manage_folder_test/runme.sh

This file was deleted.

14 changes: 0 additions & 14 deletions tests/integration/targets/vmware_ops_provision_vm_test/runme.sh

This file was deleted.

19 changes: 19 additions & 0 deletions tools/prepare_symlinks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: Create symlink to the runme.sh script in specific target directories
hosts: localhost
tasks:
- name: Find all target directories with specific prefix
ansible.builtin.find:
paths: ../tests/integration/targets
recurse: false
file_type: directory
register: target_dirs

- name: Create symlink and set executable permission in each target directory with prefix 'vmware_ops_'
ansible.builtin.file:
src: "{{ playbook_dir }}/../tests/integration/targets/runme.sh"
dest: "{{ item.path }}/runme.sh"
state: link
mode: '0755'
force: true
loop: "{{ target_dirs.files }}"
when: item.path | basename | regex_search('^vmware_ops_')

0 comments on commit 77657c0

Please sign in to comment.