-
Notifications
You must be signed in to change notification settings - Fork 50
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
Cleanup KVS tests #1149
Cleanup KVS tests #1149
Conversation
Huh, I got 3 build failures in travis. One hit #997, so I restarted and that passed. But in the other ones, all unit tests passed. So I'm not entirely sure why it failed. Travis didn't appear to time out either. |
Search for |
@grondo Thanks, seems to be it. |
Codecov Report
@@ Coverage Diff @@
## master #1149 +/- ##
==========================================
+ Coverage 77.6% 77.65% +0.04%
==========================================
Files 157 157
Lines 28693 28698 +5
==========================================
+ Hits 22267 22285 +18
+ Misses 6426 6413 -13
|
t/t1000-kvs-basic.t
Outdated
flux kvs link $TEST.a.b.X $TEST.a.b.link && | ||
ROOTREF=$(${KVSBASIC} get-treeobj .) && | ||
${KVSBASIC} unlink $TEST && | ||
flux kvs unlink -R $TEST && |
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.
did a -f
get missed here?
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 think we keep this one at -R
b/c we want the unlink to pass given the path created above it.
t/t1000-kvs-basic.t
Outdated
@@ -665,7 +665,7 @@ test_expect_success 'kvs: async kvs_fence allows puts with fence in progress' ' | |||
|
|||
# base64 data | |||
test_expect_success 'kvs: copy-tokvs and copy-fromkvs work' ' | |||
${KVSBASIC} unlink $TEST && | |||
flux kvs unlink -R $TEST && |
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.
missed -f
here too?
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.
yup thanks
Looks good - I probably should have removed the duplicate code/tests when I made the last round of KVS API changes. Thanks for doing that. I'm OK with renaming the tests too. |
Remove get, put, version, wait, dropcache, copy, move, mkdir, link, readlink in t/kvs/basic, as it is basically a duplicate of what is in the flux-kvs command. Update t1000-kvs-basic.t tests appropriately, using 'flux kvs' equivalent as needed. Fixes flux-framework#1127
Add -f (force) option to unlink command to allow unlink to return a successful error code even if a file is not found. Maps loosely to the -f option in rm.
In locations where we are "cleaning up" before a test, use unlink -f, because we don't care if a prior test failed and the unlink isn't removing anything.
Remove unlink in t/kvs/basic, as it is basically a duplicate of what is in the flux-kvs command. Update t1000-kvs-basic.t tests appropriately, using 'flux kvs unlink' as needed.
Remove kvs/basic exist command, as it is basically the same as flux kvs get, but just not outputting the result. Adjust tests appropriately for change.
Remove tests that are duplicates of ones in t1002-kvs-cmd.t.
Move tests that only use flux kvs command from t1000-kvs-basic.t to t1002-kvs-cmd.t.
Rename t1002-kvs-cmd.t to t1000-kvs.t, as it is now the primary kvs test file. Rename t1000-kvs-basic.t to t1002-kvs-extra.t, as it now provides the extra kvs tests we want to coverage and stress testing.
rebased on master and fixed the unlink -R @garlick mentions above. renamed |
restarted one of the builds which hit the |
Looks good and since @garlick already reviewed this I'll merge it unless I hear otherwise |
This PR cleans up a lot of the KVS tests, as legacy testing lead to duplicate code, duplicate tests, and unnecessary stuff. As well as fixing up #1127, this should make it easier to convert the KVS tests
over to treeobj at a later date.
In the middle of all this, I added the
-f
option toflux kvs unlink
, as there are several circumstances where we want to delete stuff before a test, but don't wantflux kvs unlink
to return an error if that key/directory is missing.Note that I'd like to rename the files
t1000-kvs-basic.t
andt1002-kvs-cmd.t
, as the tests are no longer "basic" and the "cmd" tests are no longer just about the kvs command. I'll rename appropriately at a later time (probably at a patch to end of this PR), as it may be hard to review this PR if I rename the files and all my changes appears to be new files.