#72 Get the tests to run in all the test environment/python version
Closed 4 years ago by asaleh. Opened 4 years ago by pingou.

@@ -3,6 +3,7 @@ 

  import logging

  import os

  import re

+ import sys

  import time

  from unittest.mock import call, MagicMock, Mock, patch

  import xmlrpc
@@ -700,35 +701,67 @@ 

              ),

          ]

  

-         assert toddler.errors == {

-             "bugzilla_raw": [

-                 "foo -- The name khorne@fedoraproject.org is not a valid username",

-                 "foo -- The name khorne@fedoraproject.org is not a valid username",

-             ],

-             "bugzilla": [

-                 "Failed to update: `Fedora/foo`:\n"

-                 "    Error('The name khorne@fedoraproject.org is not a valid username')\n"

+         if sys.version_info.major == 3 and sys.version_info.minor == 6:

+             assert toddler.errors == {

+                 "bugzilla_raw": [

+                     "foo -- The name khorne@fedoraproject.org is not a valid username",

+                     "foo -- The name khorne@fedoraproject.org is not a valid username",

+                 ],

+                 "bugzilla": [

+                     "Failed to update: `Fedora/foo`:\n"

+                     "    Error('The name khorne@fedoraproject.org is not a valid username',)\n"

+                     "    ('The name khorne@fedoraproject.org is not a valid username',)",

+                     "Failed to update: `Fedora EPEL/foo`:\n"

+                     "    Error('The name khorne@fedoraproject.org is not a valid username',)\n"

+                     "    ('The name khorne@fedoraproject.org is not a valid username',)",

+                 ],

+                 "configuration": [],

+                 "PDC": [],

+                 "mails": [],

+             }

+         else:

+             assert toddler.errors == {

+                 "bugzilla_raw": [

+                     "foo -- The name khorne@fedoraproject.org is not a valid username",

+                     "foo -- The name khorne@fedoraproject.org is not a valid username",

+                 ],

+                 "bugzilla": [

+                     "Failed to update: `Fedora/foo`:\n"

+                     "    Error('The name khorne@fedoraproject.org is not a valid username')\n"

+                     "    ('The name khorne@fedoraproject.org is not a valid username',)",

+                     "Failed to update: `Fedora EPEL/foo`:\n"

+                     "    Error('The name khorne@fedoraproject.org is not a valid username')\n"

+                     "    ('The name khorne@fedoraproject.org is not a valid username',)",

+                 ],

+                 "configuration": [],

+                 "PDC": [],

+                 "mails": [],

+             }

+ 

+         if sys.version_info.major == 3 and sys.version_info.minor == 6:

+             report = [

+                 "ERROR REPORT",

+                 "bugzilla",

+                 "  - Failed to update: `Fedora/foo`:\n"

+                 "    Error('The name khorne@fedoraproject.org is not a valid username',)\n"

+                 "    ('The name khorne@fedoraproject.org is not a valid username',)\n"

+                 "  - Failed to update: `Fedora EPEL/foo`:\n"

+                 "    Error('The name khorne@fedoraproject.org is not a valid username',)\n"

                  "    ('The name khorne@fedoraproject.org is not a valid username',)",

-                 "Failed to update: `Fedora EPEL/foo`:\n"

+                 "",

+             ]

+         else:

+             report = [

+                 "ERROR REPORT",

+                 "bugzilla",

+                 "  - Failed to update: `Fedora/foo`:\n"

+                 "    Error('The name khorne@fedoraproject.org is not a valid username')\n"

+                 "    ('The name khorne@fedoraproject.org is not a valid username',)\n"

+                 "  - Failed to update: `Fedora EPEL/foo`:\n"

                  "    Error('The name khorne@fedoraproject.org is not a valid username')\n"

                  "    ('The name khorne@fedoraproject.org is not a valid username',)",

-             ],

-             "PDC": [],

-             "configuration": [],

-             "mails": [],

-         }

- 

-         report = [

-             "ERROR REPORT",

-             "bugzilla",

-             "  - Failed to update: `Fedora/foo`:\n"

-             "    Error('The name khorne@fedoraproject.org is not a valid username')\n"

-             "    ('The name khorne@fedoraproject.org is not a valid username',)\n"

-             "  - Failed to update: `Fedora EPEL/foo`:\n"

-             "    Error('The name khorne@fedoraproject.org is not a valid username')\n"

-             "    ('The name khorne@fedoraproject.org is not a valid username',)",

-             "",

-         ]

+                 "",

+             ]

  

          mock_notify.notify_admins_distgit_sync_error.assert_called_with(

              "bastion", "root@localhost", ["root@localhost.localdomain"], report
@@ -908,15 +941,14 @@ 

              "********************************************************************************"

              in caplog.text

          )

- 

-         assert (

-             "ERROR REPORT\n"

-             "mails\n"

-             "  - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora/foo`\n"

-             "  - `Khorne` has no bugzilla_email or mailing_list set on `Fedora/foo`\n"

-             "  - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora EPEL/foo`\n"

-             in caplog.text

-         )

+         for line in (

+             "ERROR REPORT\n",

+             "mails\n",

+             "  - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora/foo`\n",

+             "  - `Khorne` has no bugzilla_email or mailing_list set on `Fedora/foo`\n",

+             "  - `Slaanesh` has no bugzilla_email or mailing_list set on `Fedora EPEL/foo`\n",

+         ):

+             assert line in caplog.text

  

          assert "Building the data structure" in caplog.text

  

It looks like python 3.6 behaves differently from 3.7 and 3.8 which are
in the test matrix and the error message in the tests need to take that
into account.

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

Build succeeded.

  • tox : SUCCESS in 6m 28s

rebased onto 0c2e22f89f6cf8c6eb02914b3ac1bb8cc9c626e2

4 years ago

Build succeeded.

  • tox : SUCCESS in 6m 50s

rebased onto d84663e

4 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

  • tox : FAILURE in 6m 27s

We have decided to remove py36 instead.

Pull-Request has been closed by asaleh

4 years ago
Metadata