-
Notifications
You must be signed in to change notification settings - Fork 58
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
testsuite: convert unit tests to TAP #121
Merged
Merged
Conversation
This file contains 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
Problem: unit testing is very ad-hoc in this project. Pull in libtap (via the flux-core project), originally from https://github.com/zorgnax/libtap
Problem: the 9p2000.L protocol encoding test run by tests/misc/t07 presents results in an ad-hoc manner. Convert to TAP and co-locate with the code under test.
Problem: the fidpool test run by tests/misc/t12 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test.
Problem: the command line opt test run by tests/misc/t05 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test.
Problem: the liblsd/list test run by tests/misc/t09 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test.
Problem: the capability test run by tests/misc/t11 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test. This test is skipped if it is not run as root. Add scripts/check-root.sh to run unit tests as root that need it, aborting if passwordless sudo does not work.
Problem: the fcntl locking test run by tests/misc/t04 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test.
Problem: the setfsuid test run by tests/misc/t00 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test. This test requires root, so add it to scripts/check-root.sh.
Problem: the setgroups tests run by tests/misc/t01 and t02 present results in an ad hoc manner. Convert the two ad hoc tests to one TAP test and co-locate with the code under test. This test requires root, so add it to scripts/check-root.sh.
Problem: the setreuid test run by tests/misc/t03 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test. This test requires root, so add it to scripts/check-root.sh.
Problem: the config file tests run by tests/misc/t06 and t08 present results in an ad hoc manner. Convert to TAP and co-locate with the code under test. Add this test to scripts/check-valgrind.sh as that might catch problems. Drop the "tlua" program for checking whether diod was built with config file support, as this is no longer needed.
Problem: the simple client/server test run by tests/misc/t10 presents results in an ad hoc manner. Convert to TAP and co-locate with the code under test. Add this test to scripts/check-valgrind.sh. Note: a sleep(1) was dropped from the end of the test and changed the np_srv_wait_conncount() count from 1 to 0. I think chaos#98 makes this possible without memory leaks.
Problem: the directory/file client/server test run by tests/misc/t13 presents results in an ad hoc manner. Convert to TAP, split into read and directory tests, and co-locate with the code under test. Add these tests to scripts/check-valgrind.sh.
Problem: the multiuser client/server test run by tests/misc/t14 presents results in an ad hoc manner. Convert to TAP, split into read and directory tests, and co-locate with the code under test. This test requires root, so add it to scripts/check-root.sh.
Problem: reworked unit tests are never run under valgrind and some require root. Run scripts/check-valgrind.sh and scripts/check-root.sh from ci.
grondo
approved these changes
Jan 14, 2025
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.
LGTM!
Thanks! I'll set MWP. |
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.
Problem: the unit tests in
tests/misc
are run with a very ad hoc test framework and are not co-located with the code they check.Import libtap (https://github.com/zorgnax/libtap) and rework the existing unit tests to use TAP, cleaning up and relocating them in the process.