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

tests: Don't ignore annotations with direct reconciler #1919

Merged

Conversation

justinsb
Copy link
Collaborator

We should update the golden data, rather than ignoring it.

@justinsb justinsb force-pushed the dont_hide_state_into_spec branch 2 times, most recently from 7ae436e to 3367cd1 Compare June 2, 2024 18:47
}
}

func postWriteNormalization(wantMap map[string]interface{}) map[string]interface{} {
if os.Getenv("KCC_USE_DIRECT_RECONCILERS") != "" {
if os.Getenv("XXX_KCC_USE_DIRECT_RECONCILERS") != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this intended?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's a quick hack while this is WIP!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That said it was confusing, so I just deleted it instead of hacking-it-out

@justinsb justinsb force-pushed the dont_hide_state_into_spec branch 2 times, most recently from e7b81cd to 3c320cd Compare June 4, 2024 15:16
@acpana
Copy link
Collaborator

acpana commented Jun 4, 2024

Yes I think this should work well now that the LoggingLogMetric resource is a direct controller based one. For resource conversions some normalization might still be needed.

We should update the golden data, rather than ignoring it.
Update the scenario data to match the transition of LoggingLogMetric
to direct actuation.
@justinsb justinsb changed the title WIP: Don't ignore annotations with direct reconciler tests: Don't ignore annotations with direct reconciler Jun 4, 2024
@yuwenma
Copy link
Collaborator

yuwenma commented Jun 4, 2024

/lgtm
/approve

Thank you!

}
}

func postWriteNormalization(wantMap map[string]interface{}) map[string]interface{} {
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 to not override the test expectations.
What is the current LLM behavior if user specify those two annotations? Is it a no-op or we have some handling in the direct controller(I don't recall I see any, just to double check in case I miss anything)?

I recall in SIS, we decide to add some warnings if user specify the unexpected annotations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's a no-op, I believe, but @acpana can confirm

@@ -24,24 +24,23 @@ cd ${REPO_ROOT}/
echo "Downloading envtest assets..."
export KUBEBUILDER_ASSETS=$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use -p path)

#export KCC_USE_DIRECT_RECONCILERS=LoggingLogMetric
Copy link
Collaborator

Choose a reason for hiding this comment

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

cleanup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do!

echo "Running e2e tests samples for LoggingLogMetric direct reconciliation..."

KCC_USE_DIRECT_RECONCILERS=LoggingLogMetric \
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah! you bit me. I fix this in my WIP PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Happy to merge yours first if you prefer!

@@ -255,74 +171,18 @@ X-Xss-Protection: 0
"labels": [
{
"description": "a label description",
"key": "testkey"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the previous log from the real GCP service? From the deleted part, I think we want to modify the mock llm to use operation metadata to reflect the real http as much as possible. May be a good follow-up task for @acpana ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the mock for LoggingLogMetric is pretty good, but agree we should ensure that we do have a recording with real GCP. This is currently recorded with the mock

@google-oss-prow google-oss-prow bot added the lgtm label Jun 4, 2024
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yuwenma

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

The pull request process is described here

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

@google-oss-prow google-oss-prow bot merged commit eae1fe8 into GoogleCloudPlatform:master Jun 4, 2024
13 checks passed
@yuwenma yuwenma added this to the 1.118 milestone Oct 25, 2024
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