mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-10 12:47:04 +00:00
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>
59 lines
1.6 KiB
YAML
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
|