-
Notifications
You must be signed in to change notification settings - Fork 10
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
t: reorganize t1007-flux-account.t
into multiple sharness tests
#367
Conversation
flux account add-bank --parent-bank=root B 1 && | ||
flux account add-bank --parent-bank=root C 1 && | ||
flux account add-bank --parent-bank=root D 1 && | ||
flux account add-bank --parent-bank=D E 1 |
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.
should there be a '&&' at the end of this line?
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.
Actually, my understanding of the &&
is to signal that there are additional commands to be run on the next line, so there isn't a need to put the &&
at the end of the last command in the 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.
Other than some nits, nothing huge.
I thought I'd comment that the way that you split up the commits does have a minor side effect. Basically after the first commit, technically you have "lost tests" in the commit history. i.e. for a small moment in commit history, these tests disappeared. Then in the middle few commits you added new test files but didn't add them to the Makefile. So for a small moment in history the re-added tests probably won't run when running make check
.
If you were hunting down some bug that was introduced awhile back, this could be a nuisance. i.e. make check
would not run tests that were there before.
I might suggest a commit history like:
t: split bank tests out of t1007....
(add this new file to Makefile.am)
t: split queue tests out of t1007...
(and add new file to Makefile.am)
...
t: rename t1007 to ...
that way the history is never lost momentarily and make check
works on each commit.
It's not a huge deal, so I leave it to you if you'd like to do.
t/t1007-flux-account-users.t
Outdated
@@ -0,0 +1,114 @@ | |||
#!/bin/bash | |||
|
|||
test_description='Test flux-account commands' |
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.
user commands?
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.
Yeah, all of these test descriptions should be updated/made clearer. Thanks for pointing that out!
t/t1023-flux-account-banks.t
Outdated
@@ -0,0 +1,128 @@ | |||
#!/bin/bash | |||
|
|||
test_description='Test flux-account commands' |
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.
bank? seems needs update in all new files :-)
@@ -0,0 +1,136 @@ | |||
#!/bin/bash | |||
|
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.
commit message, why mv
and not move
like other messages? NBD, thought maybe a typo.
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 used mv
here to fit the commit title in the (is it 50?) character limit for the title. I can update the titles for these commands so that they are all the same and fit in the character limit. Sorry if that caused any confusion!
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.
ahh the 50 char limit, it's fine then ... i just thought maybe you typoed it
flux account add-bank --parent-bank=root B 1 && | ||
flux account add-bank --parent-bank=root C 1 && | ||
flux account add-bank --parent-bank=root D 1 && | ||
flux account add-bank --parent-bank=D E 1 |
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.
same as last file, should this line end in '&&'?
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 good to me overall. There were a few lines that I think should have ended in '&&', but maybe not. Feel free to ignore those comments if I'm wrong.
My only other comment would be to update the 'test_description' line in the various files to describe the specific tests in the file (e.g. 'Test flux-account bank commands' rather than 'Test flux-account commands' in 'f1023-flux-account-banks.t').
flux account add-bank --parent-bank=root B 1 && | ||
flux account add-bank --parent-bank=root C 1 && | ||
flux account add-bank --parent-bank=root D 1 && | ||
flux account add-bank --parent-bank=D E 1 |
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.
&&
' | ||
|
||
test_expect_success 'add a queue with no optional args to the queue_table' ' | ||
flux account add-queue queue_1 |
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.
&&
flux account add-bank --parent-bank=root B 1 && | ||
flux account add-bank --parent-bank=root C 1 && | ||
flux account add-bank --parent-bank=root D 1 && | ||
flux account add-bank --parent-bank=D E 1 |
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.
&&
Problem: t1007-flux-account.t has grown very large because it includes tests for almost every flux account command. As a result, it is somewhat unorganized and hard to read. Move the flux account tests that deal with banks to its own sharness test file. Edit one of the expected output files to match the commands being run in t1023-flux-account-banks.t (i.e the users in this test don't have queues added to their accounts, so remove the queue lists from the expected output file).
Problem: t1007-flux-account.t has grown very large because it includes tests for almost every flux account command. As a result, it is somewhat unorganized and hard to read. Move the flux account tests that deal with queues to its own sharness test file.
Problem: t1007-flux-account.t has grown very large because it includes tests for almost every flux account command. As a result, it is somewhat unorganized and hard to read. Move the flux account tests that deal with projects to its own sharness test file.
65d3d65
to
dfba0e4
Compare
Problem: t1007-flux-account.t has grown very large because it includes tests for almost every flux account command. As a result, it is somewhat unorganized and hard to read. Move the flux account tests that deal with permissions to its own sharness test file.
Problem: t1007-flux-account.t has grown very large because it includes tests for almost every flux account command. As a result, it is somewhat unorganized and hard to read. Remove the tests in t1007-flux-account.t that don't deal with user accounts directly so that they can be placed in separate test files. Rename t1007-flux-account.t to t1007-flux-account-users.t.
dfba0e4
to
5480a1b
Compare
Codecov Report
@@ Coverage Diff @@
## master #367 +/- ##
=======================================
Coverage 83.73% 83.73%
=======================================
Files 23 23
Lines 1236 1236
=======================================
Hits 1035 1035
Misses 201 201 |
OK, I've pushed up some changes:
Thanks for the approval @chu11 and @ryanday36. I can set MWP on this shortly unless you have any other suggestions!! :) |
Problem
t1007-flux-account.t
has grown very large because it includes tests for almost everyflux account
command. As a result, it is unorganized and hard to read (my fault!!).This PR reorganizes the sharness test file and creates multiple test files according to the category of
flux account
commands it deals with. So,t1007-flux-account.t
becomes the test file that's responsible for testing all user-related commands; it is nowt1007-flux-account-users.t
. New test files are created for thebank
,queue
, andproject
commands. There is also a new file that tests the permissions for the flux-accounting commands that should only be available to administrators.This reorganization allows for an easier time to add/edit tests for the suite of
flux account
commands if necessary.