-
Notifications
You must be signed in to change notification settings - Fork 337
fix: ansible-runner bugs and add unit tests #5024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Taken from adityahase/pilot@ab1811a Co-authored-by: Aditya <aditya@adityahase.com>
Systemd-timesyncd is installed by default In newer versions of os and that cause conflict
On ubuntu 20.04, the service name is ssh.service instead of sshd.service So, try to figure out the servic and then reload
Fixes: - Import os directly instead of from ansible.inventory.manager - Add trailing comma to single-host inventory string (prevents ansible treating it as a file path) - Fix verbosity flag (was inverted: 0 for debug, 1 for normal) - Save ansible_job_id from async task runner_on_ok events so polling can find them later Tests: - _parse_tasks output parsing (5 tests) - Inventory format validation (3 tests) - generate_cmdline with/without bastion host (3 tests) - Async job_id detection in runner_on_ok (2 tests) - Event handler dispatch routing (2 tests) - AnsibleAdHoc duration parsing (5 tests) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
We're solving Ansible compatibility issue along with 3.14 support. https://github.com/frappe/press/pull/4962/changes Also, please don't send AI-generated code. |
yes, I saw the other PR #4220 but didn't see it on the tracker yet, that's what the code linked in this draft PR this is intended to add to (it's not standalone or intended as such). |
Summary
Bug fixes and unit tests for the ansible-runner refactor in #4220. This PR is intended to be merged into #4220 (or cherry-picked).
Fixes:
from ansible.inventory.manager import os→import os(unrelated import side-channel)0 if self.debug else 1→1 if self.debug else 0)ansible_job_idfrom async taskrunner_on_okevents so polling jobs can find them later (was silently lost)Tests (20 tests in
press/tests/test_runner.py):_parse_tasksoutput parsing (5 tests)generate_cmdlinewith/without bastion host (3 tests)runner_on_ok(2 tests)AnsibleAdHocduration parsing (5 tests)Test plan
python -m unittest press.tests.test_runner -v)🤖 Generated with Claude Code