GoogleCloudPlatform / k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
https://cloud.google.com/config-connector/docs/overview
Apache License 2.0
866 stars 204 forks source link

Generate set-unset golden output for gkehubfeaturemembership #2027

Open ziyue-101 opened 1 month ago

ziyue-101 commented 1 month ago

Change description

Add stepwise tests to cover the scenario where a user sets all configsync fields and then unset those. The golden KRM and http logs are generated using the existing DCL controller.

Steps I took: I used E2E_KUBE_TARGET=envtest RUN_E2E=1 E2E_GCP_TARGET=mock WRITE_GOLDEN_OUTPUT=1 go test -test.count=1 -timeout 600s -v ./tests/e2e -run 'TestE2EScript/scenarios/fields/gkehubfeaturemembership' | tee log to generate golden files.

I then used E2E_KUBE_TARGET=envtest RUN_E2E=1 E2E_GCP_TARGET=mock GOLDEN_OBJECT_CHECKS=1 GOLDEN_REQUEST_CHECKS=1 go test -test.count=1 -timeout 600s -v ./tests/e2e -run TestE2EScript/scenarios/fields/gkehubfeaturemembership 2>&1 | tee log to verify

    harness.go:549: controller-runtime manager is shutdown
2024/06/20 21:35:23 [DEBUG] parent context canceled, cleaning up batcher batches
--- PASS: TestE2EScript (91.15s)
    --- PASS: TestE2EScript/scenarios (91.15s)
        --- PASS: TestE2EScript/scenarios/fields/gkehubfeaturemembership/set_unset (91.15s)

Note to reviewer(s): review the commit 'Generate set-unset golden output'

Tests you have done

ziyue-101 commented 1 month ago

/cc @haiyanmeng

ziyue-101 commented 4 weeks ago

/assign @justinsb

google-oss-prow[bot] commented 4 weeks ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment