-
Notifications
You must be signed in to change notification settings - Fork 355
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
molecule + testinfra environment breaks event collection #200
Comments
Attempting to reduce this down to something simple hasn't yielded a reproducer yet ...
|
The file descriptors for stdout/stderr are the same in both cases ...
|
I think I've found the culprit. This line in utils.py calls a regex to check if the data coming from pexpect should be emitted: https://github.com/ansible/ansible-runner/blob/master/ansible_runner/utils.py#L242 When running outside of molecule, there are matches. When running inside molecule there are NO matches. I've captured example data from both scenarios and uploaded to ... |
Some examples of data that should have matched in the regex but did not ...
|
This is tricky, it looks like something is adding ansicolor codes to what Runner expects to be b64 encoded data, normally our event payloads look like:
Our b64 payload start/end separator is This gets put together with stdout
Something is inserting ansicolor clear codes into what should be a plain b64 string.
and I'm not sure yet why that's happening. |
This looks like it's happening because |
After disabling colorama on molecule I can get past this error. |
btw, molecule now honours a PY_COLORS variable, see ansible/molecule#1533 👍 |
What does this mean for molecule+runner integration? |
summary
Ansible-runner inside the molecule environment isn't able to store job events in the results object. The events are written to disk and can be read manually. They do have a "partial" suffix in the filename, but are otherwise complete/valid json.
http://tannerjc.net/ansible/tmp/jobdata.tar.gz
ansible-runner version
Reproduced with HEAD and 1.2.0
steps to reproduce
actual result
Molecule raises a NotImplemented exception, which really means that a fact wasn't in the return data (because no events) and the distro algorithm in their code couldn't find a match for null.
The text was updated successfully, but these errors were encountered: