Skip to content
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(client): Fix "group" command group and client test-suite #204

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

ketiltrout
Copy link
Member

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 via click.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 as create. It can also fix broken JSON in the database.
  • rename trivial
  • show 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 the node stats command in Client command list #202) and will be implemented when node stats is implemented.

Also

Fixed common.logger.echo which was broken from the start.

@ketiltrout
Copy link
Member Author

In case it helps, here's typical output from group list:

$ alpenhorn group list
Name    I/O Class    Notes
------  -----------  -------
Group1  Default      Note1
Group2  Class2       Note2

and group show:

$ alpenhorn group show SGroup --node-details
Storage Group: SGroup
        Notes: Comment
    I/O Class: IOClass

I/O Config:

  Param1: 1
  Param2: 2

Nodes:

Name    Host        Active    I/O Class
------  ----------  --------  -----------
Node1   over_here   Yes       Default
Node2   over_there  No        NodeClass

(These are composed from several tests in the test suite).

Commands per the list in #201.

Re-engineered running the client in the test-suite.

Also, fixed common.logger.echo
@ketiltrout ketiltrout merged commit c83b8a6 into master Nov 4, 2024
3 checks passed
@ketiltrout ketiltrout deleted the client_group branch November 4, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants