Files
computer-playbook/roles/test-e2e-cli/tasks/main.yml
T
kevinveenbirkenbachandClaude Fable 5 f2defbe69f fix(test-e2e-cli): install DB client modules into the PATH python
test.sh spawns its SOCKS forwarders with the bare python3 from PATH -
the baked /opt/venvs/infinito venv on swarm nodes - which neither
sys-pip-install (targets ansible_python_interpreter) nor the system pip
reaches. python3 -m pip hits exactly the interpreter test.sh sees;
--break-system-packages keeps the compose CI system python accepting it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 15:30:47 +02:00

59 lines
1.6 KiB
YAML

---
- name: 🧩 Apply role include/exclude filters
ansible.builtin.set_fact:
_cli_apps: >-
{{
playbook_dir
| discover_cli_roles(
group_names=group_names,
only_roles=TEST_E2E_CLI_ONLY_ROLES,
skip_roles=TEST_E2E_CLI_SKIP_ROLES
)
}}
- name: 🔍 Show detected CLI test roles
ansible.builtin.debug:
msg: "CLI-test-enabled roles: {{ _cli_apps }}"
changed_when: false
- name: 📂 Ensure stage base dir exists
ansible.builtin.file:
path: "{{ TEST_E2E_CLI_STAGE_BASE_DIR }}"
state: directory
mode: "0700"
- name: 📦 Install DB client modules for the CLI tests
ansible.builtin.command:
argv:
- python3
- -m
- pip
- install
- --quiet
- --break-system-packages
- pymysql
- psycopg2-binary
- ldap3
register: _cli_pip_install
changed_when: "'Successfully installed' in _cli_pip_install.stdout"
when: (_cli_apps | length) > 0
- name: 🧪 Run CLI tests, always purging the staged secrets afterwards
block:
- name: 🚀 Run CLI test for each detected role
ansible.builtin.include_tasks: run_one.yml
loop: "{{ _cli_apps }}"
loop_control:
loop_var: application_id
label: "{{ application_id }}"
- name: ✅ Fail if there were CLI test failures
ansible.builtin.fail:
msg: "CLI tests failed for roles: {{ _cli_failures }}"
when: (_cli_failures | default([])) | length > 0
always:
- name: 🧹 Remove CLI test stage dir (holds decodable DB secrets)
ansible.builtin.file:
path: "{{ TEST_E2E_CLI_STAGE_BASE_DIR }}"
state: absent