Skip to content

Add kuttl tests for lightspeed-app-server /metrics endpoint - #22

Closed
jancervenka wants to merge 3 commits into
openstack-k8s-operators:mainfrom
jancervenka:kuttl-tests-for-metrics-endpoint
Closed

Add kuttl tests for lightspeed-app-server /metrics endpoint#22
jancervenka wants to merge 3 commits into
openstack-k8s-operators:mainfrom
jancervenka:kuttl-tests-for-metrics-endpoint

Conversation

@jancervenka

Copy link
Copy Markdown
Contributor

The kuttl test asserts that the endpoint is reachable and responds with a valid Prometheus format.

@openshift-ci
openshift-ci Bot requested review from Akrog and lpiwowar July 15, 2026 15:07
@openshift-ci

openshift-ci Bot commented Jul 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jancervenka
Once this PR has been reviewed and has the lgtm label, please assign akrog for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jul 15, 2026

Copy link
Copy Markdown

Hi @jancervenka. Thanks for your PR.

I'm waiting for a openstack-k8s-operators member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jancervenka
jancervenka force-pushed the kuttl-tests-for-metrics-endpoint branch from b371d7d to 4fef44e Compare July 15, 2026 15:11
The kuttl test asserts that the endpoint is reachable and responds with a valid Prometheus format.
@jancervenka
jancervenka force-pushed the kuttl-tests-for-metrics-endpoint branch from 4fef44e to 3c85e10 Compare July 15, 2026 15:12
@umago

umago commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

/ok-to-test

@umago
umago self-requested a review July 15, 2026 15:20
- kind: ServiceAccount
name: ${SA_NAME}
namespace: ${NAMESPACE}
EOF

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These ClusterRole and ClusterRoleBinding are beeing created but I don't see them being cleaned up at the end, so they will stay in the cluster as leftovers artifacts.

Also, I think we can create them in a declarative way ? Instead of inside the TestAssert

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@umago Thank you Lucas! I moved the creation to create-openstack-lightspeed-instance.yaml and also added it to cleanup-openstanck-lightspeed-instance.yaml and errors-openstack-lightspeed-instance.yaml.

echo "Response (first 500 chars):"
echo "$METRICS_OUTPUT" | head -c 500
exit 1
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would to hear @lpiwowar and/or @malingatembo opinion on using kuttl tests this ^

It seems like it fits more into the new test framework than kuttl. Because this is asserting some behavior from our API endpoint rather than just asserting the state of the cluster (which I believe kuttl is better designed for).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems like it fits more into the new test framework than kuttl. ...

issue (blocking): I agree with this. If we did not have the foundation for the test framework laid out by @malingatembo, then I would consider this as an exception, maybe. But since the foundation is laid out, I think we should start adding tests there. It will force us to polish the test framework, and it will make the usage of it much easier later since the relevant tests will already be there and we won't be forced to migrate them there.

echo "$METRICS_OUTPUT" | head -c 500
exit 1
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, if we are OK with the kuttl tests running these type of tests, I think we should also check for at least one lightspeed_ specific metric here ? Making sure it's the right endpoint and not just any other prometheus endpoint

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a check for the presence of the ls_llm_calls_total metric. 👍

@jancervenka
jancervenka requested a review from umago July 17, 2026 07:17

@lpiwowar lpiwowar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR:) 🎉

I just agree with @umago on this one. I'm not sure whether we agreed to implement the tests for the /metrics endpoint in the Kuttl tests while I was gone. If so then I won't fight it. Otherwise, I think they should be added into the test framework created by @malingatembo.

echo "Response (first 500 chars):"
echo "$METRICS_OUTPUT" | head -c 500
exit 1
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems like it fits more into the new test framework than kuttl. ...

issue (blocking): I agree with this. If we did not have the foundation for the test framework laid out by @malingatembo, then I would consider this as an exception, maybe. But since the foundation is laid out, I think we should start adding tests there. It will force us to polish the test framework, and it will make the usage of it much easier later since the relevant tests will already be there and we won't be forced to migrate them there.

@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown

@jancervenka: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/openstack-lightspeed-kuttl-4-18 6b757bf link true /test openstack-lightspeed-kuttl-4-18

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@lpiwowar

Copy link
Copy Markdown
Collaborator

/hold

We need to agree on whether we want to include the /metrics endpoint test in the Kuttl tests. As of now, the agreement seems to be for the test to be present in @malingatembo's framework.

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.

3 participants