-
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
Fix various test skip logic issues #3015
Conversation
`sudo -nv` can be used to verify whether the sudo command is prepared to execute commands non-interactively, i.e. it will not ask for a password. If the password has already been cached by previous sudo commands, or sudo is configured to give passwordless access, we can move on. Otherwise, interactive sudo or lack of sudo access cannot be used to run tests in an automated fashion.
Some pping tests require starting up the pping daemon and killing it after some time. These tests seem to rely on the external `timeout` program, which isn't always available on a system (e.g. it's not available on MacOS).
The python tidylib module loads the system library dynamically. This ensure we skip the HTML validation tests if tidylib isn't properly installed.
If nbtscan is not available (it is, after all, an optional dependency of NAV), netbiostracker.py cannot run, so we might as well skip it.
These tests are supposed to be skipped if we CANNOT be root, not if we *can*.
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Test results 9 files 9 suites 8m 21s ⏱️ Results for commit eabd099. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3015 +/- ##
=======================================
Coverage 60.45% 60.45%
=======================================
Files 605 605
Lines 43801 43801
Branches 48 48
=======================================
Hits 26482 26482
Misses 17307 17307
Partials 12 12 ☔ View full report in Codecov by Sentry. |
Returning to draft mode- This did not have the intended effect, as many tests were now skipped for reasons unknown... |
Too broad exception catching caused a `NameError` to be masked and all the tests to be skipped: The `get_root_method` function was not available at test definition time, since it was defined below the tests. This narrows the exception catcher and moves the `get_root_method()` before the first test is defined.
4d28efb
to
bf85f9f
Compare
LDAP *is* marked as an optional dependency, so the test suite should still complete without it.
bf85f9f
to
936aa34
Compare
Found several more issues that were revealed only by pushing this PR to GitHub in the first place :-) |
|
This PR contains various fixes to the test suite, all extracted from #2675: