Skip to content
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

Update tests for <reboot_suggested> XML element #327

Merged
merged 1 commit into from
Jul 1, 2016
Merged

Update tests for <reboot_suggested> XML element #327

merged 1 commit into from
Jul 1, 2016

Conversation

Ichimonji10
Copy link
Contributor

@Ichimonji10 Ichimonji10 commented Jul 1, 2016

According to Pulp issue 2032, [1] if an erratum uploaded to Pulp doesn't
suggest a reboot, then the updateinfo.xml file published by Pulp
should omit the <reboot_suggested> element. Update the relevant test
accordingly.

Thanks to @goosemania for help with making this fix.

[1] https://pulp.plan.io/issues/2032

@Ichimonji10
Copy link
Contributor Author

Successfully tested against Pulp 2.8.5 and master. I'll comment here again if I test against Pulp 2.8.6.

@Ichimonji10
Copy link
Contributor Author

This should fix one test failure for each element of our Pulp 2.9 test matrix. In total, that should be four failures.

@coveralls
Copy link

coveralls commented Jul 1, 2016

Coverage Status

Coverage remained the same at 70.543% when pulling 52ebcba on Ichimonji10:pulp-2032 into 1a32249 on PulpQE:master.

@danuzclaudes
Copy link
Contributor

Test fails under 2.9.0b1. And here's the test result:

    [vagrant@dev pulp-smash]$ python -m unittest pulp_smash.tests.rpm
.api_v2.test_updateinfo
    .....F.....
    ======================================================================
    FAIL: test_reboot_not_suggested (pulp_smash.tests.rpm.api_v2.
test_updateinfo.UpdateInfoTestCase)
    Assert the update info tree does not suggest a spurious reboot.
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "pulp_smash/tests/rpm/api_v2/test_updateinfo.py", line 238,
in test_reboot_not_suggested
        self.assertEqual(len(reboot_elements), 0, reboot_elements)
    AssertionError: 1 != 0 : [<Element 'reboot_suggested' at 0x7fc9e2df1750>]

    ----------------------------------------------------------------------
    Ran 11 tests in 38.064s

    FAILED (failures=1)

According to Pulp issue 2032, [1] if an erratum uploaded to Pulp doesn't
suggest a reboot, then the `updateinfo.xml` file published by Pulp
should omit the `<reboot_suggested>` element. Update the relevant test
accordingly.

Thanks to @goosemania for help with making this fix.

[1] https://pulp.plan.io/issues/2032
@coveralls
Copy link

coveralls commented Jul 1, 2016

Coverage Status

Coverage remained the same at 70.543% when pulling 0ec2b73 on Ichimonji10:pulp-2032 into 1a32249 on PulpQE:master.

@Ichimonji10
Copy link
Contributor Author

I've updated this pull request to better detail what's wrong. Pulp Smash now produces the following error message when targeting Pulp 2.8.6:

(pulp-smash2) [ichimonji10@beech:pulp-smash]$ python -m unittest2 pulp_smash.tests.rpm.api_v2.test_updateinfo.UpdateInfoTestCase
...F.....
======================================================================
FAIL: test_reboot_not_suggested (pulp_smash.tests.rpm.api_v2.test_updateinfo.UpdateInfoTestCase)
Assert the update info tree does not suggest a spurious reboot.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pulp_smash/tests/rpm/api_v2/test_updateinfo.py", line 243, in test_reboot_not_suggested
    [ElementTree.tostring(elem) for elem in reboot_elements],
AssertionError: 1 != 0 : ['<reboot_suggested>False</reboot_suggested>']

This error indicates that the Pulp issue targeted by this test fails. I've re-opened the issue. See here.

This test now passes against Pulp 2.8.6 and master.

@Ichimonji10
Copy link
Contributor Author

Thanks for the feedback, @danuzclaudes. You've helped me really polish this PR.

@elyezer elyezer added the LGTM label Jul 1, 2016
@Ichimonji10 Ichimonji10 merged commit 0ec2b73 into pulp:master Jul 1, 2016
@Ichimonji10 Ichimonji10 deleted the pulp-2032 branch July 1, 2016 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants