Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Commit 290780d changed the return value and broke a unit test in TestPlayBook.py. #2636

Closed
wants to merge 1 commit into from

3 participants

@tima

I use a Jenkins instance at the office to monitor Ansible. Last night a commit caused a unit test to start failing. Based on my understanding of the new logic, Ive updated the expected value to coincide.


Regression

TestPlayBook.TestPlaybook.test_includes (from nosetests)

Error Message

-------------------- >> begin captured stdout << ---------------------
['start', ['play start', ['all']], ['task start', [u'debug msg="foobar"', False]], ['ok', ['localhost', {'msg': u'foobar', 'invocation': {'module_name': u'debug', 'module_args': u'msg="foobar"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]], ['play start', ['all']], ['task start', [u'debug msg="foofoo"', False]], ['ok', ['localhost', {'msg': u'foofoo', 'invocation': {'module_name': u'debug', 'module_args': u'msg="foofoo"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$item"', False]], ['ok', ['localhost', {'msg': u'$item', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$item"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]]]
ACTUAL
{
"localhost": {
"changed": 0,
"failures": 0,
"ok": 6,
"skipped": 0,
"unreachable": 0
}
}
EXPECTED
{
"localhost": {
"changed": 0,
"failures": 0,
"ok": 10,
"skipped": 0,
"unreachable": 0
}
}

--------------------- >> end captured stdout << ----------------------

Stacktrace

File "/efs/dist/python/core/2.6.5/exec/lib/python2.6/unittest.py", line 279, in run
testMethod()
File "/.statelite/tmpfs/data/VCS/est-ax010-d/logs01/jenkins/workspace/ansible-devel/test/TestPlayBook.py", line 212, in test_includes
assert utils.jsonify(expected, format=True) == utils.jsonify(actual,format=True)

-------------------- >> begin captured stdout << ---------------------
['start', ['play start', ['all']], ['task start', [u'debug msg="foobar"', False]], ['ok', ['localhost', {'msg': u'foobar', 'invocation': {'module_name': u'debug', 'module_args': u'msg="foobar"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]], ['play start', ['all']], ['task start', [u'debug msg="foofoo"', False]], ['ok', ['localhost', {'msg': u'foofoo', 'invocation': {'module_name': u'debug', 'module_args': u'msg="foofoo"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$item"', False]], ['ok', ['localhost', {'msg': u'$item', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$item"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]]]
ACTUAL
{
"localhost": {
"changed": 0,
"failures": 0,
"ok": 6,
"skipped": 0,
"unreachable": 0
}
}
EXPECTED
{
"localhost": {
"changed": 0,
"failures": 0,
"ok": 10,
"skipped": 0,
"unreachable": 0
}
}

--------------------- >> end captured stdout << ----------------------

Standard Output

['start', ['play start', ['all']], ['task start', [u'debug msg="foobar"', False]], ['ok', ['localhost', {'msg': u'foobar', 'invocation': {'module_name': u'debug', 'module_args': u'msg="foobar"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]], ['play start', ['all']], ['task start', [u'debug msg="foofoo"', False]], ['ok', ['localhost', {'msg': u'foofoo', 'invocation': {'module_name': u'debug', 'module_args': u'msg="foofoo"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$item"', False]], ['ok', ['localhost', {'msg': u'$item', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$item"'}}]], ['play start', ['all']], ['task start', [u'debug msg="$variable"', False]], ['ok', ['localhost', {'msg': u'$variable', 'invocation': {'module_name': u'debug', 'module_args': u'msg="$variable"'}}]]]
ACTUAL
{
"localhost": {
"changed": 0,
"failures": 0,
"ok": 6,
"skipped": 0,
"unreachable": 0
}
}
EXPECTED
{
"localhost": {
"changed": 0,
"failures": 0,
"ok": 10,
"skipped": 0,
"unreachable": 0
}
}

@tima tima Commit 290780d changed the return value and broke a unit test in Test…
…PlayBook.py. Ive update the expected value to coincide with the previous modifications.
60c192c
@benjixx

Looks like origin commit 290780d breaks feature of including playbooks into another playbook. So it's not the test case that needs to be changed but the include-playbooks functionality needs to be restored.

@benjixx

Update: I send pull request #2637 containing the actual bugfix.

@mpdehaan
Collaborator

I made various changes addressing this on a flight yesterday and have updated code this AM.

playbooks included in playbooks have been fixed up, but playbooks + with_items (which have never been
documented) have been removed. Tests have been updated. Task includes + with_items have not been affected.

let me know if you have any issues.

@mpdehaan mpdehaan closed this
@tima tima deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2013
  1. @tima

    Commit 290780d changed the return value and broke a unit test in Test…

    tima authored
    …PlayBook.py. Ive update the expected value to coincide with the previous modifications.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  test/TestPlayBook.py
View
2  test/TestPlayBook.py
@@ -201,7 +201,7 @@ def test_includes(self):
"localhost": {
"changed": 0,
"failures": 0,
- "ok": 10,
+ "ok": 6,
"skipped": 0,
"unreachable": 0
}
Something went wrong with that request. Please try again.