[1.28] ENT-3759: Test on GitHub Actions#3195
Merged
ptoscano merged 11 commits intosubscription-manager-1.28from Feb 2, 2023
Merged
[1.28] ENT-3759: Test on GitHub Actions#3195ptoscano merged 11 commits intosubscription-manager-1.28from
ptoscano merged 11 commits intosubscription-manager-1.28from
Conversation
e1d9f43 to
79a1921
Compare
When tests were run in container, without having sub-man packages installed, two things happened: - Container detection kicked in and prevented CPProvider from being created. NOTE: rhsm/unit/test_config.py::InContainerTests do not inherit from fixture.py::SubManFixture and are not affected by this patch. - TCP handshake was attempted by opening a connection. Because the connection requires RHSM certificates to be installed on the system, this step crashed, when subscription-manager-rhsm-certificates (e.g., /etc/rhsm/ca/ directory) was not present. (Cherry-picked from d1b716f)
79a1921 to
805f51a
Compare
ptoscano
suggested changes
Feb 1, 2023
Contributor
ptoscano
left a comment
There was a problem hiding this comment.
Mostly LGTM, luckly almost all the issues were backports
-
wrt the commit
Lock pytest version:- I guess you can replace it with f801b69
-
wrt the commit
Fix tests for Python 3.6 runner: -
wrt the commit
ENT-3759: Test on GitHub Actions- I think we can drop centos9 stream here, as 1.28 won't reach that version
- I'd drop Fedora Rawhide, I don't think we want a fast-changing Fedora to break a stable branch
This makes --randomly-seed useless, because previously failed tests are run first instead. (Cherry-picked from e3ea1e4)
Contributor
Author
|
1/ True, I'll backport f801b69 instead |
Contributor
dd04736 to
978e956
Compare
- Stop using .addClassCleanup(). The function was added to unittest in Python 3.8, but this branch requires Python 3.6. - Fix D-Bus test of Consumer object. Patch was being stopped incorrectly. - Fix collector test for aarch64 uuid. The test was not setting up mocks properly and a real value was read. This made the test work on development machines but fail on GitHub Actions runner. - Rename argument 'auto_spec' to 'autospec' It was valid in older versions of the 'mock' library.
Python 3.3 provides it, so switch to it since the required Python version is 3.6. (Cherry-picked from 1560e82)
It is no more used now, so drop it along with its tests.
It seems like pytest 7 breaks pytest-forked somehow, as also reported in pytest-dev/pytest#9621 Hence, for now pin it to any version lower than 7 to keep the unit tests working. (Cherry-picked from f801b69)
Several tests fail when 'pytest' is run under root, even if they work correctly when run as non-root user. By adding the new pytest marker we can ensure that these tests are skipped, instead of raising false alarms. (Cherry-picked from c4bf220)
This test used to do some comprehensive testing of the translations, long time ago. Nowadays, it does few things: 1) tries to translate a certain message in some languages 2) checks that the translation of a different message is unicode First of all: these tests load translations from the system, so they should be marked as functional. Second: gettext() returns the same string in case the string is not translated in the current locale, so in some cases the original strings are checked to be unicode, which they obviously are. Third: gettext (and Weblate, which is currently used to manage translations) already do a good job in checking for wrongly encoded messages, so there is no need to do the same check locally. Hence, simply drop test_po_files.py, as there is nothing useful in it. Card ID: ENT-4484 (Cherry-picked from e9cb4bc)
* Card ID: ENT-5536 Subprocess calls to 'touch' were sometimes failing to update the modification date (race condition, probably?), making the tests fail. When 'os.utime' is used, this is no longer the case and the files are always reported as modified. (Cherry-picked from 68acefc)
Because 'get_config_parser()' and 'in_container()' functions were being imported directly, instead of as reference, the mocks that tests perform were not applying to them, causing test suite to fail when run from inside a container. Future-wise it is better to manage mocks on one place, instead of patching the functions whenever they are being imported. (Cherry-picked from 0b78761)
* Card ID: ENT-3759
978e956 to
17e72fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"Backport" of #3192. Because the branches differ in a significant way, it was required to backport some of the commits from main branch fixing test issues.