-
Notifications
You must be signed in to change notification settings - Fork 40
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
tests: Catch errors during tests setup #225
Conversation
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.
I do not find is_not_setup intuitive, but the fix is technically right, I provided two alternatives that will belnd better with the existing code, let me know what you think.
tests/magtests.py
Outdated
@@ -801,7 +801,10 @@ def test_mech_name(testdir, testenv, logfile): | |||
processes = dict() | |||
logfile = open(os.path.join(testdir, 'tests.log'), 'w') | |||
errs = 0 | |||
is_not_setup = True |
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.
By "is_not_setup" you mean the script "is not in the setup phase" ?
It's a bit confusing to work by negatives, I would rather have a guard named setup_phase = True, and at the end you set setup_phase = False
However an even simpler way to deal with this i to set errs to -1 and then clear it with a comment that says why before starting tests.
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.
Good idea! changed to 'errs=-1'. Thank you.
@@ -15,7 +15,7 @@ elif [ -f /etc/fedora-release ]; then | |||
dnf -y install $COMPILER python3-{gssapi,requests{,-gssapi},flake8} \ | |||
krb5-{server,workstation,pkinit} curl libfaketime \ | |||
{httpd,krb5,openssl,gssntlmssp}-devel {socket,nss}_wrapper \ | |||
autoconf automake libtool which bison make python3 \ | |||
autoconf automake libtool which bison make python3 python3-devel \ |
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.
looks ok to me but I'd defer to @frozencemetery on this
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.
Seems fine :)
2eac89e
to
474a92c
Compare
Fixes: gssapi#224 Signed-off-by: Stanislav Levin <slev@altlinux.org>
python3-devel is required to build python-gssapi within virtualenv. Signed-off-by: Stanislav Levin <slev@altlinux.org>
474a92c
to
30c5dc7
Compare
@@ -15,7 +15,7 @@ elif [ -f /etc/fedora-release ]; then | |||
dnf -y install $COMPILER python3-{gssapi,requests{,-gssapi},flake8} \ | |||
krb5-{server,workstation,pkinit} curl libfaketime \ | |||
{httpd,krb5,openssl,gssntlmssp}-devel {socket,nss}_wrapper \ | |||
autoconf automake libtool which bison make python3 \ | |||
autoconf automake libtool which bison make python3 python3-devel \ |
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.
Seems fine :)
Fixes: #224