fix(client): Fix "group" command group and client test-suite #204
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.
Here's a start on getting the client working, which I've done to try to gauge how much work it will entail. This PR updates and re-implements command in the
group
command group, which manipulates StorageGroups. (I think this is the easiest command group to do.)Test suite
This PR also re-engineers how the client is run in the test-suite. There's now a
client
fixture that runs the client viaclick.testing.CliRunner
and performs rudimentary checks on the result. This abstracts a lot of the routine rigamarole of running the CLI via pytest, meaning the tests themselves can be relatively simple.This system uses the same kind of persistent in-memory Sqlite database that I used for the server end-to-end test to make it possible for the client process and the test suite itself to access the same ephemeral database.
Client
Common command options (of which there are many) are being collected in
client.options
along with common code to process them.Commands
(per the list in #202):
create
lets you set I/O class and I/O config. There is no vetting of the I/O config data based on what the I/O class needs (see discussion in New parameters needing client support #165). I think it's best to punt that downfield and worry about it in the future.list
is pretty simple. Shows I/O class but not I/O config, because I don't think it fits very well in the tabular format, but I could be convinced otherwise.modify
has the same comments about I/O config vetting ascreate
. It can also fix broken JSON in the database.rename
trivialshow
definitely willing to take suggestions on formatting here, as well as what StorageNode columns should be presented with--node-details
.--node-stats
is for showing counts/sizes of files (see thenode stats
command in Client command list #202) and will be implemented whennode stats
is implemented.Also
Fixed
common.logger.echo
which was broken from the start.