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

flux-resource: add -q, --queue=QUEUE option #5935

Merged
merged 5 commits into from
May 3, 2024

Conversation

grondo
Copy link
Contributor

@grondo grondo commented May 3, 2024

This PR adds a -q, --queue=QUEUE option to flux resource subcommands list, status, info, and R.

@@ -0,0 +1 @@
101 Nodes, 404 Cores, 0 GPUs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message "input input"

Comment on lines 120 to 151
test_expect_success 'flux-resource list supports -q, --queue' '
flux resource list --queue=debug \
--from-stdin --config-file=$FLUKE_CONFIG \
< $FLUKE_INPUT > fluke-debug.output &&
test_debug "cat fluke-debug.output" &&
test_must_fail grep batch fluke-debug.output &&
flux resource list --queue=batch \
--from-stdin --config-file=$FLUKE_CONFIG \
< $FLUKE_INPUT > fluke-batch.output &&
test_debug "cat fluke-batch.output" &&
test_must_fail grep debug fluke-batch.output &&
flux resource list --queue=debug,batch \
--from-stdin --config-file=$FLUKE_CONFIG \
< $FLUKE_INPUT > fluke-both.output &&
grep debug fluke-both.output &&
grep batch fluke-both.output
'
test_expect_success 'flux-resource list supports -q, --queue' '
flux resource list --queue=debug \
--from-stdin --config-file=$FLUKE_CONFIG \
< $FLUKE_INPUT > fluke-debug.output &&
test_debug "cat fluke-debug.output" &&
test_must_fail grep batch fluke-debug.output &&
flux resource list --queue=batch \
--from-stdin --config-file=$FLUKE_CONFIG \
< $FLUKE_INPUT > fluke-batch.output &&
test_debug "cat fluke-batch.output" &&
test_must_fail grep debug fluke-batch.output &&
flux resource list --queue=debug,batch \
--from-stdin --config-file=$FLUKE_CONFIG \
< $FLUKE_INPUT > fluke-both.output &&
grep debug fluke-both.output &&
grep batch fluke-both.output
'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated test? or am i not seeing the difference?

Copy link
Member

@chu11 chu11 May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, cut and paste and intended to test flux resource R? i think a flux resource R test is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, good catch. I think it is just a duplicate because flux resource R uses the same code as flux resource list, but might as well add similar tests for flux resource R here just using grep.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that and force-pushed

Copy link
Member

@chu11 chu11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

grondo added 5 commits May 3, 2024 15:00
Problem: flux-resource(1) subcommands don't support filtering output
by queue.

Add a -q, --queue=QUEUE option to most subcommands to allow filtering
resources to one or more queues.
Problem: When using --from-stdin in tests there is no way to provide
a corresponding Flux config for determining queues.

Add a hidden --config-file=PATH option which can be used to provide
a config object for testing.
Problem: There are no tests of flux-resource(1) -q, --queue option
handling.

Add some sample resource.sched-status and resource.status
payloads derived from the fluke test system to
t/flux-resource/{status,list}. Also add a flux.config input file
capturing the queues configuration.

Use these new input files to test `-q, --queues` handling for the
flux-resource(1) subcommands: list, info, R, and status.
Problem: The -q, --queue=QUEUE option is not documented in
flux-resource(1).

Document the option.
Problem: The bash completions file distributed with flux does not
complete the -q, --queue option in flux-resource(1) commands.

Add this option to the completions.
@grondo
Copy link
Contributor Author

grondo commented May 3, 2024

Thanks! Setting MWP.

Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 83.36%. Comparing base (135d8af) to head (bb58bc3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5935      +/-   ##
==========================================
+ Coverage   83.34%   83.36%   +0.01%     
==========================================
  Files         514      514              
  Lines       83053    83104      +51     
==========================================
+ Hits        69218    69276      +58     
+ Misses      13835    13828       -7     
Files Coverage Δ
src/cmd/flux-resource.py 95.04% <92.30%> (-0.40%) ⬇️

... and 7 files with indirect coverage changes

@mergify mergify bot merged commit 25d186e into flux-framework:master May 3, 2024
35 checks passed
@grondo grondo deleted the issue#5925 branch May 3, 2024 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants