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: Add test suite common resource labels and fix dnsrecord cleanup #941

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

mikenairn
Copy link
Member

@mikenairn mikenairn commented Oct 15, 2024

tests: Add common label to all test suite resources

All resources created with the common helpers in the integration test suite have a common label added to more easily find resources created by the test suite:

kubectl get ns,gatewayclass,gateway,dnspolicy -l app.kubernetes.io/part-of=kuadrant-test-suite -A
NAME                             STATUS        AGE
namespace/test-namespace-4r6cl   Active        0s
namespace/test-namespace-6qmvp   Active        6s
namespace/test-namespace-7pxsm   Terminating   5s
namespace/test-namespace-w25d8   Active        0s
namespace/test-namespace-wv85k   Terminating   1s

NAME                                                              CONTROLLER        ACCEPTED   AGE
gatewayclass.gateway.networking.k8s.io/gwc-test-namespace-4r6cl   kuadrant.io/bar   Unknown    0s
gatewayclass.gateway.networking.k8s.io/gwc-test-namespace-6qmvp   kuadrant.io/bar   Unknown    6s
gatewayclass.gateway.networking.k8s.io/gwc-test-namespace-w25d8   kuadrant.io/bar   Unknown    0s

NAMESPACE              NAME                                                    CLASS                      ADDRESS     PROGRAMMED   AGE
test-namespace-4r6cl   gateway.gateway.networking.k8s.io/test-gateway1         gwc-test-namespace-4r6cl   172.0.0.1   Unknown      0s
test-namespace-4r6cl   gateway.gateway.networking.k8s.io/test-gateway2         gwc-test-namespace-4r6cl   172.0.0.1   Unknown      0s
test-namespace-6qmvp   gateway.gateway.networking.k8s.io/test-placed-gateway   gwc-test-namespace-6qmvp   172.0.0.1   Unknown      6s
test-namespace-w25d8   gateway.gateway.networking.k8s.io/test-placed-gateway   gwc-test-namespace-w25d8   172.0.0.1   Unknown      0s

NAMESPACE              NAME                                     AGE
test-namespace-4r6cl   dnspolicy.kuadrant.io/test-dns-policy1   0s
test-namespace-4r6cl   dnspolicy.kuadrant.io/test-dns-policy2   0s
test-namespace-6qmvp   dnspolicy.kuadrant.io/test-dns-policy    6s
test-namespace-w25d8   dnspolicy.kuadrant.io/test-dns-policy    0s

tests: Allow overriding packages for integration test

Adds a new variable INTEGRATION_TEST_PACKAGES which sets the packages used by the test-integration make target allowing it to be more easily modified for local development testing.

Example:

INTEGRATION_TEST_PACKAGES=tests/common/dnspolicy/... INTEGRATION_TESTS_EXTRA_ARGS='-v --repeat=4 --focus="valid target"' INTEGRATION_TEST_NUM_PROCESSES=4 INTEGRATION_TEST_NUM_CORES=2 make test-integration

tests: Ensure all dnsrecords are removed in cleanup

Ensures all DNSrecord resources in the current spec test namespace are marked for deletion and removed before removing the secret.

All resources created with the common helpers in the integration test
suite have a comman label added to more easily find resources created by
the test suite:

```
kubectl get ns,gatewayclass,gateway,dnspolicy -l app.kubernetes.io/part-of=kuadrant-test-suite -A
```

Signed-off-by: Michael Nairn <mnairn@redhat.com>
Ensures all DNSrecord resources in the current spec test namespace are
marked for deletion and removed before removing the secret.

Signed-off-by: Michael Nairn <mnairn@redhat.com>
Adds a new variable `INTEGRATION_TEST_PACKAGES` which sets the packages
used by the `test-integration` make target allowing it to be more easily
modified for local development testing.

Example:
```
INTEGRATION_TEST_PACKAGES=tests/common/dnspolicy/... INTEGRATION_TESTS_EXTRA_ARGS='-v --repeat=4 --focus="valid target"' INTEGRATION_TEST_NUM_PROCESSES=4 INTEGRATION_TEST_NUM_CORES=2 make test-integration
```

Signed-off-by: Michael Nairn <mnairn@redhat.com>
Copy link
Contributor

@KevFan KevFan left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@mikenairn mikenairn merged commit 76ca68f into Kuadrant:main Oct 16, 2024
24 checks passed
@mikenairn mikenairn deleted the test_updates branch October 16, 2024 11:27
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.

2 participants