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

Handle Namespace v1 in the uptest run #19

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

ytsarev
Copy link
Member

@ytsarev ytsarev commented Jul 22, 2024

Description of your changes

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

make test
13:39:30 [ .. ] go test unit-tests
?   	github.com/crossplane/uptest/internal/config	[no test files]
	github.com/crossplane/uptest/cmd/uptest		coverage: 0.0% of statements
	github.com/crossplane/uptest/internal		coverage: 0.0% of statements
?   	github.com/crossplane/uptest/internal/version	[no test files]
ok  	github.com/crossplane/uptest/internal/templates	(cached)	coverage: 76.5% of statements
?   	github.com/crossplane/uptest/internal/config	[no test files]
	github.com/crossplane/uptest/internal		coverage: 0.0% of statements
	github.com/crossplane/uptest/cmd/uptest		coverage: 0.0% of statements
?   	github.com/crossplane/uptest/internal/version	[no test files]
=== RUN   TestRender
=== RUN   TestRender/SuccessSingleResource
=== RUN   TestRender/SuccessMultipleResource
--- PASS: TestRender (0.00s)
    --- PASS: TestRender/SuccessSingleResource (0.00s)
    --- PASS: TestRender/SuccessMultipleResource (0.00s)
=== RUN   TestRenderWithSkipDelete
=== RUN   TestRenderWithSkipDelete/SuccessSingleResource
=== RUN   TestRenderWithSkipDelete/SkipImport
=== RUN   TestRenderWithSkipDelete/SuccessMultipleResource
--- PASS: TestRenderWithSkipDelete (0.00s)
    --- PASS: TestRenderWithSkipDelete/SuccessSingleResource (0.00s)
    --- PASS: TestRenderWithSkipDelete/SkipImport (0.00s)
    --- PASS: TestRenderWithSkipDelete/SuccessMultipleResource (0.00s)
PASS
coverage: 76.5% of statements
ok  	github.com/crossplane/uptest/internal/templates	0.566s	coverage: 76.5% of statements
13:39:35 [ OK ] go test unit-tests

e2e test

Using https://github.com/upbound/configuration-azure-network as a base sample material. Adding Namespace to the test example:

diff --git a/examples/network-xr.yaml b/examples/network-xr.yaml
index d05c7e4..8c84b10 100644
--- a/examples/network-xr.yaml
+++ b/examples/network-xr.yaml
@@ -6,3 +6,8 @@ spec:
   parameters:
     id: ref-azure-network-from-xr
     region: westus
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: test-namespace

and running standard make e2e

Before the PR change
Everything is ready

k get managed
NAME                                                     SYNCED   READY   EXTERNAL-NAME             AGE
resourcegroup.azure.upbound.io/ref-azure-network-bm8fx   True     True    ref-azure-network-bm8fx   8m35s

NAME                                                                     SYNCED   READY   EXTERNAL-NAME                    AGE
virtualnetwork.network.azure.upbound.io/ref-azure-network-from-xr-vnet   True     True    ref-azure-network-from-xr-vnet   8m35s

NAME                                                           SYNCED   READY   EXTERNAL-NAME                  AGE
subnet.network.azure.upbound.io/ref-azure-network-from-xr-sn   True     True    ref-azure-network-from-xr-sn   8m35s

But uptest is in endless loop waiting for Namespace readiness and never completes(until timeout failure)

error: timed out waiting for the condition on namespaces/test-namespace

After this PR change

I inject local uptest build from this PR into the Configuration tools cache

cp ~/uptest/_output/bin/darwin_arm64/uptest ./.cache/tools/darwin_arm64/uptest-v0.11.1

and running make e2e again

--- PASS: kuttl (269.16s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/case (268.66s)
PASS
14:31:06 [ OK ] running automated tests

* Special skip of the Namespace object similar to Secret
* Fixes crossplane#18

Signed-off-by: Yury Tsarev <[email protected]>
Copy link
Member

@sergenyalcin sergenyalcin left a comment

Choose a reason for hiding this comment

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

Thanks @ytsarev LGTM!

@CasperGN
Copy link

@ytsarev the oidc-cookie-secret now depends on this change. More context in the internal PR.

@sergenyalcin sergenyalcin merged commit d016c0a into crossplane:main Jul 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uptest need to skip Namespaces/v1 similar to Secrets/v1
3 participants