You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible
David Wilson f9e1905ec6 issue #199: ansible: stop writing temp files for new style modules
While adding support for non-new style module types, NewStyleRunner
began writing modules to a temporary file, and sys.argv was patched to
actually include the script filename. The argv change was never required
to fix any particular bug, and a search of the standard modules reveals
no argv users. Update argv[0] to be '', like an interactive interpreter
would have.

While fixing #210, new style runner began setting __file__ to the
temporary file path in order to allow apt.py to discover the Ansiballz
temporary directory. 5 out of 1,516 standard modules follow this
pattern, but in each case, none actually attempt to access __file__,
they just call dirname on it. Therefore do not write the contents of
file, simply set it to the path as it would exist, within a real
temporary directory.

Finally move temporary directory creation out of runner and into target.
Now a single directory exists for the duration of a run, and is emptied
by runner.py as necessary after each task invocation.

This could be further extended to stop rewriting non-new-style modules
in a with_items loop, but that's another step.

Finally the last bullet point in the documentation almost isn't a lie
again.
8 years ago
..
bench tests: use test-targets group, not all group 8 years ago
integration tests: Ansible SSH timeout test 8 years ago
lib issue #199: ansible: stop writing temp files for new style modules 8 years ago
regression tests: tidy up thread_pileup for use as a toy benchmark. 8 years ago
tests issue #164: dir structure is gross, but at least tab completion works :> 8 years ago
.gitignore issue #164: whups, delete checked in binaries. 8 years ago
Makefile ansible: better planner logging, try again 8 years ago
README.md ansible: import osx_setup.yml. 8 years ago
all.yml issue #164: rearrange playbooks a little more 8 years ago
ansible.cfg tests: Ansible SSH timeout test 8 years ago
compare_output_test.py issue #164: split "examples" out into regression/integration tests. 8 years ago
gcloud-ansible-playbook.py issue #164: split "examples" out into regression/integration tests. 8 years ago
hosts tests: Ansible SSH timeout test 8 years ago
hosts.docker issue #164: split "examples" out into regression/integration tests. 8 years ago
mitogen_ansible_playbook.sh tests: import mitogen_ansible_playbook.sh helper 8 years ago
osx_setup.yml tests: Ansible SSH timeout test 8 years ago
run_ansible_playbook.sh tests: raft of fixes for vanilla Ansible 8 years ago

README.md

tests/ansible Directory

This is an an organically growing collection of integration and regression tests used for development and end-user bug reports.

It will be tidied up over time, meanwhile, the playbooks here are a useful demonstrator for what does and doesn't work.

Preparation

For OS X, run the osx_setup.yml script to create a bunch of users.

run_ansible_playbook.sh

This is necessary to set some environment variables used by future tests, as there appears to be no better way to inject them into the top-level process environment before the Mitogen connection process forks.

Running Everything

ANSIBLE_STRATEGY=mitogen_linear ./run_ansible_playbook.sh all.yml