test: add integration tests for rhc collector CLI - #540
Draft
Archana-PandeyM wants to merge 1 commit into
Draft
Conversation
Archana-PandeyM
marked this pull request as draft
August 4, 2026 10:57
Cover list, info, and timers against the packaged com.redhat.minimal collector. Resolves : CCT-2712
Archana-PandeyM
force-pushed
the
arpandey/rhcCollectorCLITests
branch
from
August 6, 2026 08:59
986cfa6 to
32878fc
Compare
Archana-PandeyM
marked this pull request as ready for review
August 6, 2026 09:15
Contributor
|
Thanks @Archana-PandeyM , Just to note @mjcr99 has a refactor PR on this same area #542 |
|
|
||
|
|
||
| @pytest.mark.tier2 | ||
| def test_collector_cli_info(rhc, minimal_collector, minimal_timer_cache): |
Contributor
There was a problem hiding this comment.
I don't think minimal_timer_cache fixture is used here?
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def rhc_server_socket(): |
| "tracked by RHEL-217910." | ||
| ) | ||
| ) | ||
| def test_collector_cli_list_format_json(rhc, minimal_collector): |
Contributor
There was a problem hiding this comment.
Maybe it's useful have a check for expected output on invalid formats?
e.g.
rhc collector info --format yaml
unsupported format: yaml (supported formats: "json")`
| result = rhc.run("collector", "info", minimal_collector["id"], check=False) | ||
|
|
||
| assert result.returncode == 0 | ||
| assert f"Name: {minimal_collector['name']}" in result.stdout |
Contributor
There was a problem hiding this comment.
What do you think about a looser match rather than exact spacing? It might make the tests a little less likely to break if the format drifts.
"Name:" in result.stdout and minimal_collector['name'] in result.stdout
Or maybe a regex allowing for any number of spaces?
r"Name:\s+Minimal Host…"
Archana-PandeyM
marked this pull request as draft
August 7, 2026 08:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Covers rhc list, info, and timers against the packaged com.redhat.minimal collector.
Resolves : CCT-2712