-
Notifications
You must be signed in to change notification settings - Fork 375
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
Enable unit tests for Python 2.6 & 3.4 on Github Actions #3296
base: develop
Are you sure you want to change the base?
Conversation
@@ -385,19 +384,6 @@ def is_str_empty(s): | |||
return is_str_none_or_whitespace(s) or is_str_none_or_whitespace(s.rstrip(' \t\r\n\0')) | |||
|
|||
|
|||
def hash_strings(string_list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hash_strings was being used only by the Monitor thread. It has a dependency on hashlib/OpenSSL. The Monitor thread does not really need a cryptographic hash, so I replaced it with Python's own hash function.
@@ -411,8 +411,12 @@ def emulate_assertListEqual(self, seq1, seq2, msg=None, seq_type=None): | |||
diffMsg = '\n' + '\n'.join( | |||
difflib.ndiff(pprint.pformat(seq1).splitlines(), | |||
pprint.pformat(seq2).splitlines())) | |||
standardMsg = self._truncateMessage(standardMsg, diffMsg) | |||
msg = self._formatMessage(msg, standardMsg) | |||
# _truncateMessage and _formatMessage are not defined on Python 2.6; output the entire diff in that case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue has always been here. The only reason I noticed it is because a test that uses assertListEqual failed for an unrelated issue and this code raised an exception.
useradd --shell /bin/bash --create-home -g waagent waagent | ||
curl -sSf --retry 5 -o /tmp/python-${PYTHON_VERSION}.tar.bz2 https://dcrdata.blob.core.windows.net/python/python-${PYTHON_VERSION}.tar.bz2 | ||
tar xjf /tmp/python-${PYTHON_VERSION}.tar.bz2 --directory / | ||
chown -R waagent:waagent /home/waagent # The UID:GID in the tarball may not match those of the user, so we need to fix that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu 24 has a new user, ubuntu, with PID 1000 so now the PID in the tarball does not match waagent's (which now gets 1001)
The PR also
* removes unnecessary dependency on hashlib
* updates the Azure Pipeline for unit tests to use Ubuntu 24
* patches the Python virtual environments used for unit tests to run on Ubuntu > 16