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

Add diagnostics tox env #472

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add diagnostics tox env #472

wants to merge 2 commits into from

Conversation

sed-i
Copy link
Contributor

@sed-i sed-i commented Apr 3, 2023

Issue

When doing manual tests, I keep using the same lengthy commands over and over.

Solution

Add a diagnostics script to output all the interesting integration-related content.

Context

Came up in during work on canonical/grafana-agent-k8s-operator#160.

Testing Instructions

tox -e diag -- prom/0

Release Notes

Add diagnostics tox env.

Copy link
Contributor

@rbarry82 rbarry82 left a comment

Choose a reason for hiding this comment

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

Rather than leaving line-by-line comments, I'll give a generalized take:

This is nice.

The README note is probably less than clear, and something like "to fetch a summary of alert rules and metrics series present in Prometheus...", as the diagnostics may imply that it actually does some diagnostic work (rather than giving the user information which may help bisect juju data and workload-visible/rendered data) may work, but the actual verbiage is less important.

diagnostics.sh probably doesn't belong in tests/. Rather, some new folder which we don't have a name for. hack/ would be common in "operators", and while that's mostly used for bootstrapping the kubebuilder stuff itself, the paradigm could work here.

@lucabello
Copy link
Contributor

I feel like this type of content could have its own cos-operations repository, or something similar, collecting commands/scripts/recipes we commonly use; I guess it depends on the scope :)

Regardless, I'd use the word diagnostic (or diagnostics) instead of diag since all the other tox environments are full names, not a shorthand

@sed-i
Copy link
Contributor Author

sed-i commented Apr 13, 2023

How about:

pip install cosl
cosl.diag prometheus prom/0

@rbarry82
Copy link
Contributor

How about:

pip install cosl
cosl.diag prometheus prom/0

I mean, couldn't tox just install it as part of the env? And run the command?

I still don't think diag provides enough context. "Hit the API for this particular workload type and print the results" is useful, but it should have a name which reflects what it actually does, because it definitely isn't "diagnosing" anything. Just different kind of juju show-....

Arguably, the best would be to get the Juju team to extend jujuc to behave like kubectl or others, where juju-show-unit -> juju show-unit, juju-show-workload -> juju show-workload ... (which could be further be extended with workload types by different charming teams)

@sed-i
Copy link
Contributor Author

sed-i commented Apr 14, 2023

It's not diagnosing anything yet :)
But I'm not fixed on the name. self-test, check, whatever is fine.

Not sure what you mean about jujuc. Are you talking about juju plugins?

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

3 participants